add payTemplate, fix missing ampersand
This commit is contained in:
parent
0fb6c098d7
commit
2291d460e8
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user