aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-01-19 14:25:02 -0300
committerSebastian <sebasjm@gmail.com>2023-01-19 14:25:02 -0300
commit4f376297dc3f0fc4c967de588367d62478fc85fe (patch)
tree41940ccc751c8598fb0f6e52e66f0e55cdbc115d /packages/taler-wallet-core
parente263fe35080bcf3ef5af729b121e30dfbff81910 (diff)
downloadwallet-core-4f376297dc3f0fc4c967de588367d62478fc85fe.tar.xz
fix: order will stay in queryRefund state forever
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r--packages/taler-wallet-core/src/operations/pay-merchant.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts b/packages/taler-wallet-core/src/operations/pay-merchant.ts
index 54ebdb5a4..14d80d17a 100644
--- a/packages/taler-wallet-core/src/operations/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts
@@ -2685,6 +2685,15 @@ export async function processPurchaseQueryRefund(
waitForAutoRefund,
);
if (Amounts.isZero(awaitingAmount)) {
+ // Maybe the user wanted to check for refund to find out
+ // that there is no refund pending from merchant
+ await ws.db
+ .mktx((x) => [x.purchases])
+ .runReadWrite(async (tx) => {
+ purchase.purchaseStatus = PurchaseStatus.Paid;
+ await tx.purchases.put(purchase);
+ });
+
return OperationAttemptResult.finishedEmpty();
}
}