diff options
author | ng0 <ng0@n0.is> | 2019-11-02 15:54:43 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-11-02 15:54:43 +0000 |
commit | 5e05c22c57dfd6ed28516f10e3460567c3bbfc08 (patch) | |
tree | 0cfb3ee75054e04f626f6274d4718af2d2bd89e1 /src/taleruri.ts | |
parent | d5794f507b77110584eb38ec8be362b7ce3cca67 (diff) | |
parent | 70a232294035b2a08a701391495b65fdff696b7a (diff) |
Merge branch 'master' of git.taler.net:wallet-core
Diffstat (limited to 'src/taleruri.ts')
-rw-r--r-- | src/taleruri.ts | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/taleruri.ts b/src/taleruri.ts index 0af5c4c95..c810def29 100644 --- a/src/taleruri.ts +++ b/src/taleruri.ts @@ -147,17 +147,18 @@ export function parseTipUri(s: string): TipUriResult | undefined { } if (maybePath === "-") { - maybePath = "public/tip-pickup"; + maybePath = "public/"; } else { - maybePath = decodeURIComponent(maybePath); + maybePath = decodeURIComponent(maybePath) + "/"; } - if (maybeInstance === "-") { - maybeInstance = "default"; + let maybeInstancePath = ""; + if (maybeInstance !== "-") { + maybeInstancePath = `instances/${maybeInstance}/`; } const tipPickupUrl = new URI( - "https://" + host + "/" + decodeURIComponent(maybePath), - ).href(); + "https://" + host + "/" + maybePath + maybeInstancePath + "tip-pickup", + ).addQuery({ tip_id: tipId }).href(); return { tipPickupUrl, @@ -197,20 +198,20 @@ export function parseRefundUri(s: string): RefundUriResult | undefined { } if (maybePath === "-") { - maybePath = "public/refund"; + maybePath = "public/"; } else { - maybePath = decodeURIComponent(maybePath); + maybePath = decodeURIComponent(maybePath) + "/"; } - if (maybeInstance === "-") { - maybeInstance = "default"; + let maybeInstancePath = ""; + if (maybeInstance !== "-") { + maybeInstancePath = `instances/${maybeInstance}/`; } const refundUrl = new URI( - "https://" + host + "/" + decodeURIComponent(maybePath), + "https://" + host + "/" + maybePath + maybeInstancePath + "refund", ) - .addQuery({ instance: maybeInstance, order_id: orderId }) + .addQuery({ order_id: orderId }) .href(); - return { refundUrl, }; |