diff options
Diffstat (limited to 'packages/taler-util/src/taleruri.ts')
-rw-r--r-- | packages/taler-util/src/taleruri.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/taler-util/src/taleruri.ts b/packages/taler-util/src/taleruri.ts index 54b7525e3..d3186d2f5 100644 --- a/packages/taler-util/src/taleruri.ts +++ b/packages/taler-util/src/taleruri.ts @@ -29,6 +29,7 @@ import { opFixedSuccess, opKnownTalerFailure } from "./operation.js"; import { TalerErrorCode } from "./taler-error-codes.js"; import { AmountString } from "./taler-types.js"; import { URL, URLSearchParams } from "./url.js"; + /** * A parsed taler URI. */ @@ -89,6 +90,7 @@ export interface WithdrawUriResult { type: TalerUriAction.Withdraw; bankIntegrationApiBaseUrl: string; withdrawalOperationId: string; + externalConfirmation?: boolean; } export interface RefundUriResult { @@ -140,7 +142,12 @@ export function parseWithdrawUriWithError(s: string) { if (pi.type === "fail") { return pi; } - const parts = pi.body.rest.split("/"); + + const c = pi.body.rest.split("?", 2); + const path = c[0]; + const q = new URLSearchParams(c[1] ?? ""); + + const parts = path.split("/"); if (parts.length < 2) { return opKnownTalerFailure(TalerErrorCode.WALLET_TALER_URI_MALFORMED, { @@ -166,6 +173,7 @@ export function parseWithdrawUriWithError(s: string) { `${pi.body.innerProto}://${p}/`, ), withdrawalOperationId: withdrawId, + externalConfirmation: q.get("external-confirmation") == "1", }; return opFixedSuccess(result); } |