diff options
author | Sebastian <sebasjm@gmail.com> | 2023-04-19 12:42:47 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-04-19 12:42:47 -0300 |
commit | d483a3f5574355ed9c43eb6ddea59e5734323cf0 (patch) | |
tree | 2f4e3830512b50808b396991791c3c8877e5676e /packages/taler-wallet-core/src/operations/pay-merchant.ts | |
parent | 7330f0daf907133876baf8831c44ec34cec326e5 (diff) |
fix #7704
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-merchant.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-merchant.ts | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts b/packages/taler-wallet-core/src/operations/pay-merchant.ts index 496641fe7..2419d32a2 100644 --- a/packages/taler-wallet-core/src/operations/pay-merchant.ts +++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts @@ -168,6 +168,7 @@ export async function getTotalPaymentCost( allDenoms, DenominationRecord.toDenomInfo(denom), amountLeft, + ws.config.testing.denomselAllowLate, ); costs.push(Amounts.parseOrThrow(pcs.coinContributions[i])); costs.push(refreshCost); @@ -1659,6 +1660,7 @@ async function applySuccessfulRefund( p: PurchaseRecord, refreshCoinsMap: Record<string, CoinRefreshRequest>, r: MerchantCoinRefundSuccessStatus, + denomselAllowLate: boolean, ): Promise<void> { // FIXME: check signature before storing it as valid! @@ -1688,6 +1690,7 @@ async function applySuccessfulRefund( allDenoms, DenominationRecord.toDenomInfo(denom), amountLeft, + denomselAllowLate, ); refreshCoinsMap[coin.coinPub] = { @@ -1714,6 +1717,7 @@ async function storePendingRefund( }>, p: PurchaseRecord, r: MerchantCoinRefundFailureStatus, + denomselAllowLate: boolean, ): Promise<void> { const refundKey = getRefundKey(r); @@ -1745,6 +1749,7 @@ async function storePendingRefund( allDenoms, DenominationRecord.toDenomInfo(denom), amountLeft, + denomselAllowLate, ); p.refunds[refundKey] = { @@ -1767,6 +1772,7 @@ async function storeFailedRefund( p: PurchaseRecord, refreshCoinsMap: Record<string, CoinRefreshRequest>, r: MerchantCoinRefundFailureStatus, + denomselAllowLate: boolean, ): Promise<void> { const refundKey = getRefundKey(r); @@ -1797,6 +1803,7 @@ async function storeFailedRefund( allDenoms, DenominationRecord.toDenomInfo(denom), amountLeft, + denomselAllowLate, ); p.refunds[refundKey] = { @@ -1905,11 +1912,28 @@ async function acceptRefunds( // Invariant: (!existingRefundInfo) || (existingRefundInfo === Pending) if (refundStatus.type === "success") { - await applySuccessfulRefund(tx, p, refreshCoinsMap, refundStatus); + await applySuccessfulRefund( + tx, + p, + refreshCoinsMap, + refundStatus, + ws.config.testing.denomselAllowLate, + ); } else if (isPermanentFailure) { - await storeFailedRefund(tx, p, refreshCoinsMap, refundStatus); + await storeFailedRefund( + tx, + p, + refreshCoinsMap, + refundStatus, + ws.config.testing.denomselAllowLate, + ); } else { - await storePendingRefund(tx, p, refundStatus); + await storePendingRefund( + tx, + p, + refundStatus, + ws.config.testing.denomselAllowLate, + ); } } |