diff options
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-merchant.ts | 15 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 3 |
2 files changed, 17 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts b/packages/taler-wallet-core/src/operations/pay-merchant.ts index 14d80d17a..2a89c59ed 100644 --- a/packages/taler-wallet-core/src/operations/pay-merchant.ts +++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts @@ -2415,6 +2415,13 @@ async function acceptRefunds( p.purchaseStatus = PurchaseStatus.Paid; } logger.trace("refund query done"); + ws.notify({ + type: NotificationType.RefundFinished, + transactionId: makeTransactionId( + TransactionType.Payment, + p.proposalId, + ), + }); } else { // No error, but we need to try again! p.timestampLastRefundStatus = now; @@ -2426,6 +2433,7 @@ async function acceptRefunds( ws.notify({ type: NotificationType.RefundQueried, + transactionId: makeTransactionId(TransactionType.Payment, proposalId), }); } @@ -2694,6 +2702,13 @@ export async function processPurchaseQueryRefund( await tx.purchases.put(purchase); }); + // No new refunds, but we still need to notify + // the wallet client that the query finished. + ws.notify({ + type: NotificationType.RefundQueried, + transactionId: makeTransactionId(TransactionType.Payment, proposalId), + }); + return OperationAttemptResult.finishedEmpty(); } } diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index c1b82f9c9..8aae2332c 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -58,7 +58,6 @@ import { WithdrawalGroupStatus, } from "../db.js"; import { InternalWalletState } from "../internal-wallet-state.js"; -import { assertUnreachable } from "../util/assertUnreachable.js"; import { checkDbInvariant } from "../util/invariants.js"; import { RetryTags } from "../util/retries.js"; import { @@ -846,6 +845,8 @@ async function buildTransactionForPurchase( ), proposalId: purchaseRecord.proposalId, info, + refundQueryActive: + purchaseRecord.purchaseStatus === PurchaseStatus.QueryingRefund, frozen: purchaseRecord.purchaseStatus === PurchaseStatus.PaymentAbortFinished ?? false, |