aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/pay-merchant.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-06-17 11:34:32 +0200
committerFlorian Dold <florian@dold.me>2024-06-17 11:34:32 +0200
commitb59e472465440d95525e7e3d1225234525948b67 (patch)
treedfbbda8378bcef48f543eaed9fd6f3168c203ee5 /packages/taler-wallet-core/src/pay-merchant.ts
parent61dbe85eec8856e2b0cc50873e0f0bb1fc59754b (diff)
downloadwallet-core-b59e472465440d95525e7e3d1225234525948b67.tar.xz
wallet-core: fix auto-refund state machine
Properly use the new finalizing state
Diffstat (limited to 'packages/taler-wallet-core/src/pay-merchant.ts')
-rw-r--r--packages/taler-wallet-core/src/pay-merchant.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts
index 5a0decd5c..118a338cc 100644
--- a/packages/taler-wallet-core/src/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/pay-merchant.ts
@@ -1060,7 +1060,7 @@ async function storeFirstPaySuccess(
if (protoAr) {
const ar = Duration.fromTalerProtocolDuration(protoAr);
logger.info("auto_refund present");
- purchase.purchaseStatus = PurchaseStatus.PendingQueryingAutoRefund;
+ purchase.purchaseStatus = PurchaseStatus.FinalizingQueryingAutoRefund;
purchase.autoRefundDeadline = timestampProtocolToDb(
AbsoluteTime.toProtocolTimestamp(
AbsoluteTime.addDuration(AbsoluteTime.now(), ar),
@@ -1460,6 +1460,7 @@ async function checkPaymentByProposalId(
const paid =
purchase.purchaseStatus === PurchaseStatus.Done ||
purchase.purchaseStatus === PurchaseStatus.PendingQueryingRefund ||
+ purchase.purchaseStatus === PurchaseStatus.FinalizingQueryingAutoRefund ||
purchase.purchaseStatus === PurchaseStatus.PendingQueryingAutoRefund;
const download = await expectProposalDownload(wex, purchase);
return {
@@ -2113,8 +2114,8 @@ export async function processPurchase(
case PurchaseStatus.PendingPayingReplay:
return processPurchasePay(wex, proposalId);
case PurchaseStatus.PendingQueryingRefund:
- case PurchaseStatus.FinalizingQueryingAutoRefund:
return processPurchaseQueryRefund(wex, purchase);
+ case PurchaseStatus.FinalizingQueryingAutoRefund:
case PurchaseStatus.PendingQueryingAutoRefund:
return processPurchaseAutoRefund(wex, purchase);
case PurchaseStatus.AbortingWithRefund: