aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/pay.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/pay.ts17
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay.ts b/packages/taler-wallet-core/src/operations/pay.ts
index d41a20e71..8193bf86a 100644
--- a/packages/taler-wallet-core/src/operations/pay.ts
+++ b/packages/taler-wallet-core/src/operations/pay.ts
@@ -47,6 +47,7 @@ import {
j2s,
Logger,
NotificationType,
+ parsePaytoUri,
parsePayUri,
PayCoinSelection,
PreparePayResult,
@@ -241,6 +242,20 @@ export async function getCandidatePayCoins(
continue;
}
+ const wireTypes = new Set<string>();
+ for (const acc of exchangeDetails.wireInfo.accounts) {
+ const p = parsePaytoUri(acc.payto_uri);
+ if (p) {
+ wireTypes.add(p.targetType);
+ }
+ }
+
+ if (!wireTypes.has(req.wireMethod)) {
+ // Exchange can't be used, because it doesn't support
+ // the wire type that the merchant requested.
+ continue;
+ }
+
// is the exchange explicitly allowed?
for (const allowedExchange of req.allowedExchanges) {
if (allowedExchange.exchangePub === exchangeDetails.masterPublicKey) {
@@ -1338,7 +1353,7 @@ export async function getContractTermsDetails(
throw Error("proposal is in invalid state");
}
- return proposal.download.contractData
+ return proposal.download.contractData;
}
/**