From b59e472465440d95525e7e3d1225234525948b67 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 17 Jun 2024 11:34:32 +0200 Subject: wallet-core: fix auto-refund state machine Properly use the new finalizing state --- packages/taler-wallet-core/src/pay-merchant.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/taler-wallet-core/src/pay-merchant.ts') 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: -- cgit v1.2.3