aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/refund.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-03-08 23:09:20 +0100
committerFlorian Dold <florian@dold.me>2022-03-08 23:09:20 +0100
commit6ee0354940c09d1065c3b3b7bf08e41fd6014268 (patch)
tree7d127977b1517702082d0253099f25c3fa26289f /packages/taler-wallet-core/src/operations/refund.ts
parentd5a933e4cb685aab3e5e6bae5ca2358291e59130 (diff)
downloadwallet-core-6ee0354940c09d1065c3b3b7bf08e41fd6014268.tar.xz
wallet: improve retry handling for payments, update error codes
Diffstat (limited to 'packages/taler-wallet-core/src/operations/refund.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/refund.ts34
1 files changed, 17 insertions, 17 deletions
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<void> {
+ 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<void> {
- 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,