diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/taler-util/src/taleruri.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/taler-util/src/taleruri.ts b/packages/taler-util/src/taleruri.ts index 2aa9cb030..4d55d4c98 100644 --- a/packages/taler-util/src/taleruri.ts +++ b/packages/taler-util/src/taleruri.ts @@ -97,6 +97,7 @@ export function parseWithdrawUri(s: string): WithdrawUriResult | undefined { export enum TalerUriType { TalerPay = "taler-pay", TalerTemplate = "taler-template", + TalerPayTemplate = "taler-pay-template", TalerWithdraw = "taler-withdraw", TalerTip = "taler-tip", TalerRefund = "taler-refund", @@ -129,10 +130,10 @@ export function classifyTalerUri(s: string): TalerUriType { return TalerUriType.TalerPay; } if (sl.startsWith("taler://pay-template/")) { - return TalerUriType.TalerPay; + return TalerUriType.TalerPayTemplate; } if (sl.startsWith("taler+http://pay-template/")) { - return TalerUriType.TalerPay; + return TalerUriType.TalerPayTemplate; } if (sl.startsWith("taler://tip/")) { return TalerUriType.TalerTip; @@ -277,13 +278,14 @@ export function constructPayUri( result += `:${url.port}`; } result += `${url.pathname}${orderId}/${sessionId}`; - let queryPart = ""; + const qp = new URLSearchParams(); if (claimToken) { - queryPart += `c=${claimToken}`; + qp.append("c", claimToken); } if (noncePriv) { - queryPart += `n=${noncePriv}`; + qp.append("n", noncePriv); } + const queryPart = qp.toString(); if (queryPart) { result += "?" + queryPart; } |