aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/pay.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/pay.ts23
1 files changed, 11 insertions, 12 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay.ts b/packages/taler-wallet-core/src/operations/pay.ts
index db157257a..325d07bd1 100644
--- a/packages/taler-wallet-core/src/operations/pay.ts
+++ b/packages/taler-wallet-core/src/operations/pay.ts
@@ -443,6 +443,7 @@ async function recordConfirmPay(
refundQueryRequested: false,
timestampFirstSuccessfulPay: undefined,
autoRefundDeadline: undefined,
+ refundAwaiting: undefined,
paymentSubmitPending: true,
refunds: {},
merchantPaySig: undefined,
@@ -987,18 +988,16 @@ async function storeFirstPaySuccess(
purchase.lastSessionId = sessionId;
purchase.payRetryInfo = resetRetryInfo();
purchase.merchantPaySig = paySig;
- if (isFirst) {
- const protoAr = purchase.download.contractData.autoRefund;
- if (protoAr) {
- const ar = Duration.fromTalerProtocolDuration(protoAr);
- logger.info("auto_refund present");
- purchase.refundQueryRequested = true;
- purchase.refundStatusRetryInfo = resetRetryInfo();
- purchase.lastRefundStatusError = undefined;
- purchase.autoRefundDeadline = AbsoluteTime.toTimestamp(
- AbsoluteTime.addDuration(AbsoluteTime.now(), ar),
- );
- }
+ const protoAr = purchase.download.contractData.autoRefund;
+ if (protoAr) {
+ const ar = Duration.fromTalerProtocolDuration(protoAr);
+ logger.info("auto_refund present");
+ purchase.refundQueryRequested = true;
+ purchase.refundStatusRetryInfo = resetRetryInfo();
+ purchase.lastRefundStatusError = undefined;
+ purchase.autoRefundDeadline = AbsoluteTime.toTimestamp(
+ AbsoluteTime.addDuration(AbsoluteTime.now(), ar),
+ );
}
await tx.purchases.put(purchase);
});