aboutsummaryrefslogtreecommitdiff
path: root/src/taleruri.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-11-01 18:39:23 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-11-01 18:39:23 +0100
commitae8a00527168b13aa59ddc2fbd1f88a0f1e2669c (patch)
treea8599ee8efd254d468ec1ab29ce4ebdabd29c276 /src/taleruri.ts
parent1c5a9d2474f6281869c0ed0accbff4944359722a (diff)
downloadwallet-core-ae8a00527168b13aa59ddc2fbd1f88a0f1e2669c.tar.xz
protocol changes
Diffstat (limited to 'src/taleruri.ts')
-rw-r--r--src/taleruri.ts27
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,
};