diff options
author | Sebastian <sebasjm@gmail.com> | 2023-03-10 01:22:07 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-03-10 01:22:07 -0300 |
commit | 2291d460e833bd6b63df0a7e9a9a16f801f39007 (patch) | |
tree | 8bf412e922be85f1a4092bc8a7953cef9a40907f | |
parent | 0fb6c098d78de77d100ef405585040118aa61312 (diff) |
add payTemplate, fix missing ampersand
-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; } |