summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/pay-merchant.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-merchant.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/pay-merchant.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts b/packages/taler-wallet-core/src/operations/pay-merchant.ts
index fe0cbeda0..97bf6e2a6 100644
--- a/packages/taler-wallet-core/src/operations/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts
@@ -103,6 +103,7 @@ import {
RefundGroupStatus,
RefundItemRecord,
RefundItemStatus,
+ timestampPreciseToDb,
} from "../index.js";
import {
EXCHANGE_COINS_LOCK,
@@ -644,7 +645,7 @@ async function createPurchase(
noncePriv: priv,
noncePub: pub,
claimToken,
- timestamp: TalerPreciseTimestamp.now(),
+ timestamp: timestampPreciseToDb(TalerPreciseTimestamp.now()),
merchantBaseUrl,
orderId,
proposalId: proposalId,
@@ -717,7 +718,7 @@ async function storeFirstPaySuccess(
if (purchase.purchaseStatus === PurchaseStatus.PendingPaying) {
purchase.purchaseStatus = PurchaseStatus.Done;
}
- purchase.timestampFirstSuccessfulPay = now;
+ purchase.timestampFirstSuccessfulPay = timestampPreciseToDb(now);
purchase.lastSessionId = sessionId;
purchase.merchantPaySig = payResponse.sig;
purchase.posConfirmation = payResponse.pos_confirmation;
@@ -941,7 +942,9 @@ async function unblockBackup(
.forEachAsync(async (bp) => {
bp.state = {
tag: BackupProviderStateTag.Ready,
- nextBackupTimestamp: TalerPreciseTimestamp.now(),
+ nextBackupTimestamp: timestampPreciseToDb(
+ TalerPreciseTimestamp.now(),
+ ),
};
tx.backupProviders.put(bp);
});
@@ -1447,7 +1450,7 @@ export async function confirmPay(
totalPayCost: Amounts.stringify(payCostInfo),
};
p.lastSessionId = sessionId;
- p.timestampAccept = TalerPreciseTimestamp.now();
+ p.timestampAccept = timestampPreciseToDb(TalerPreciseTimestamp.now());
p.purchaseStatus = PurchaseStatus.PendingPaying;
await tx.purchases.put(p);
await spendCoins(ws, tx, {
@@ -2791,7 +2794,7 @@ async function storeRefunds(
proposalId: purchase.proposalId,
refundGroupId: newRefundGroupId,
status: RefundGroupStatus.Pending,
- timestampCreated: now,
+ timestampCreated: timestampPreciseToDb(now),
amountEffective: Amounts.stringify(
Amounts.zeroOfCurrency(currency),
),
@@ -2802,7 +2805,7 @@ async function storeRefunds(
const newItem: RefundItemRecord = {
coinPub: rf.coin_pub,
executionTime: rf.execution_time,
- obtainedTime: now,
+ obtainedTime: timestampPreciseToDb(now),
refundAmount: rf.refund_amount,
refundGroupId: newGroup.refundGroupId,
rtxid: rf.rtransaction_id,