summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-02-23 12:42:21 -0300
committerSebastian <sebasjm@gmail.com>2024-02-23 12:42:21 -0300
commit467eb5e090bbce7436bd4eb41902d19235da4dba (patch)
treee25fb20930ed00c0fc5d32c54786fe4f8b1b9bd8
parent5427327ffa99d40028a1058234c178850c465191 (diff)
downloadwallet-core-467eb5e090bbce7436bd4eb41902d19235da4dba.tar.gz
wallet-core-467eb5e090bbce7436bd4eb41902d19235da4dba.tar.bz2
wallet-core-467eb5e090bbce7436bd4eb41902d19235da4dba.zip
repuchase detected previous unpaid purchased
-rw-r--r--packages/taler-wallet-core/src/pay-merchant.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts
index 09e9e1fb3..adc8b42e9 100644
--- a/packages/taler-wallet-core/src/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/pay-merchant.ts
@@ -828,7 +828,9 @@ async function processDownloadProposal(
}
// FIXME: Adjust this to account for refunds, don't count as repurchase
// if original order is refunded.
- if (otherPurchase && otherPurchase.refundAmountAwaiting === undefined) {
+ if (otherPurchase && (otherPurchase.purchaseStatus == PurchaseStatus.Done
+ || otherPurchase.purchaseStatus == PurchaseStatus.PendingPaying
+ || otherPurchase.purchaseStatus == PurchaseStatus.PendingPayingReplay)) {
logger.warn("repurchase detected");
p.purchaseStatus = PurchaseStatus.DoneRepurchaseDetected;
p.repurchaseProposalId = otherPurchase.proposalId;
@@ -1719,7 +1721,7 @@ async function internalWaitPaymentResult(
};
}
- if (txRes.purchase.purchaseStatus > PurchaseStatus.Done) {
+ if (txRes.purchase.purchaseStatus >= PurchaseStatus.Done) {
return {
type: ConfirmPayResultType.Done,
contractTerms: d.contractTermsRaw,