aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core
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
parent6106caeba9e017242dfd334c34c8473aefb6ffb0 (diff)
downloadwallet-core-6a4da88719bc7a1506433c1117b2402d2bd48f36.tar.xz
wallet-core: expose more info about refund query
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r--packages/taler-wallet-core/src/operations/pay-merchant.ts15
-rw-r--r--packages/taler-wallet-core/src/operations/transactions.ts3
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,