aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/pay-merchant.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-02-14 11:16:58 +0100
committerFlorian Dold <florian@dold.me>2023-02-14 11:17:19 +0100
commit6a4da88719bc7a1506433c1117b2402d2bd48f36 (patch)
tree7094aed1a6a8e1fe85854225c8744c955d7d973c /packages/taler-wallet-core/src/operations/pay-merchant.ts
parent6106caeba9e017242dfd334c34c8473aefb6ffb0 (diff)
downloadwallet-core-6a4da88719bc7a1506433c1117b2402d2bd48f36.tar.xz
wallet-core: expose more info about refund query
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-merchant.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/pay-merchant.ts15
1 files changed, 15 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 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();
}
}