gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 01/02: don't use outdated purchase info


From: gnunet
Subject: [taler-wallet-core] 01/02: don't use outdated purchase info
Date: Mon, 20 Feb 2023 16:37:14 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

commit 0b6b757f659cc1a1c770d994c05c361033b56c06
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Feb 20 12:36:48 2023 -0300

    don't use outdated purchase info
---
 packages/taler-wallet-core/src/operations/pay-merchant.ts | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts 
b/packages/taler-wallet-core/src/operations/pay-merchant.ts
index f84ac2567..19cd9c9e8 100644
--- a/packages/taler-wallet-core/src/operations/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts
@@ -2697,8 +2697,13 @@ export async function processPurchaseQueryRefund(
         await ws.db
           .mktx((x) => [x.purchases])
           .runReadWrite(async (tx) => {
-            purchase.purchaseStatus = PurchaseStatus.Paid;
-            await tx.purchases.put(purchase);
+            const p = await tx.purchases.get(proposalId);
+            if (!p) {
+              logger.warn("purchase does not exist anymore");
+              return;
+            }
+            p.purchaseStatus = PurchaseStatus.Paid;
+            await tx.purchases.put(p);
           });
 
         // No new refunds, but we still need to notify

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]