From 6ee0354940c09d1065c3b3b7bf08e41fd6014268 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 8 Mar 2022 23:09:20 +0100 Subject: wallet: improve retry handling for payments, update error codes --- .../taler-wallet-core/src/operations/refund.ts | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/refund.ts') diff --git a/packages/taler-wallet-core/src/operations/refund.ts b/packages/taler-wallet-core/src/operations/refund.ts index a5846f259..106c79365 100644 --- a/packages/taler-wallet-core/src/operations/refund.ts +++ b/packages/taler-wallet-core/src/operations/refund.ts @@ -65,6 +65,23 @@ import { InternalWalletState } from "../common.js"; const logger = new Logger("refund.ts"); +async function resetPurchaseQueryRefundRetry( + ws: InternalWalletState, + proposalId: string, +): Promise { + await ws.db + .mktx((x) => ({ + purchases: x.purchases, + })) + .runReadWrite(async (tx) => { + const x = await tx.purchases.get(proposalId); + if (x) { + x.refundStatusRetryInfo = initRetryInfo(); + await tx.purchases.put(x); + } + }); +} + /** * Retry querying and applying refunds for an order later. */ @@ -578,23 +595,6 @@ export async function processPurchaseQueryRefund( ); } -async function resetPurchaseQueryRefundRetry( - ws: InternalWalletState, - proposalId: string, -): Promise { - await ws.db - .mktx((x) => ({ - purchases: x.purchases, - })) - .runReadWrite(async (tx) => { - const x = await tx.purchases.get(proposalId); - if (x) { - x.refundStatusRetryInfo = initRetryInfo(); - await tx.purchases.put(x); - } - }); -} - async function processPurchaseQueryRefundImpl( ws: InternalWalletState, proposalId: string, -- cgit v1.2.3