diff options
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/db.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay.ts | 17 |
2 files changed, 20 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index 903dfa47d..9c57a79c1 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -361,11 +361,15 @@ export interface ExchangeDetailsRecord { * Terms of service text or undefined if not downloaded yet. * * This is just used as a cache of the last downloaded ToS. + * + * FIXME: Put in separate object store! */ termsOfServiceText: string | undefined; /** * content-type of the last downloaded termsOfServiceText. + * + * * FIXME: Put in separate object store! */ termsOfServiceContentType: string | undefined; 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; } /** |