taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 407caa9e28478d78fda66d704c950fe0dafb4835
parent c7adf74c9dd6b9b74588b37cbc6fbbcadc7c6a2e
Author: Florian Dold <florian@dold.me>
Date:   Wed, 22 Jul 2026 12:40:09 +0200

also handle nfc=1 for pay-template URIs

Diffstat:
Mpackages/taler-util/src/taleruri.ts | 7+++++++
Mpackages/taler-wallet-core/src/pay-merchant.ts | 6++++--
2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/packages/taler-util/src/taleruri.ts b/packages/taler-util/src/taleruri.ts @@ -794,6 +794,11 @@ function parsePayTemplate( amount = amountParam; } + let nfc: boolean | undefined; + if ("nfc" in params) { + nfc = params["nfc"] === "1"; + } + return Result.of({ type: TalerUriAction.PayTemplate, merchantBaseUrl: merchant ?? (cs[0] as HostPortPath), @@ -804,6 +809,7 @@ function parsePayTemplate( editableAmount: truthyArg(params["editable_amount"]), editableSummary: truthyArg(params["editable_summary"]), summary: params["summary"], + nfc, }); } @@ -1088,6 +1094,7 @@ export interface TalerPayTemplateUri { summary?: string; editableAmount?: boolean; amount?: AmountString; + nfc?: boolean; } export interface TalerWithdrawUri { diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts @@ -96,7 +96,6 @@ import { TalerErrorCode, TalerErrorDetail, TalerPreciseTimestamp, - TalerUri, TalerUriAction, TalerUris, TokenUseSig, @@ -264,7 +263,10 @@ export class PayMerchantTransactionContext implements TransactionContext { let nfc: boolean | undefined; if (purchaseRec.talerUri) { const uri = Result.orUndefined(TalerUris.parse(purchaseRec.talerUri)); - if (uri?.type === TalerUriAction.Pay) { + if ( + uri?.type === TalerUriAction.Pay || + uri?.type === TalerUriAction.PayTemplate + ) { nfc = uri.nfc; } }