diff options
Diffstat (limited to 'src/taleruri.ts')
-rw-r--r-- | src/taleruri.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/taleruri.ts b/src/taleruri.ts index bd01abb65..0d68621b9 100644 --- a/src/taleruri.ts +++ b/src/taleruri.ts @@ -96,18 +96,19 @@ export function parsePayUri(s: string): PayUriResult | undefined { } if (maybePath === "-") { - maybePath = "public/proposal"; + maybePath = ""; } else { - maybePath = decodeURIComponent(maybePath); + maybePath = decodeURIComponent(maybePath) + "/"; } - if (maybeInstance === "-") { - maybeInstance = "default"; + let maybeInstancePath = ""; + if (maybeInstance !== "-") { + maybeInstancePath = `instances/${maybeInstance}/`; } const downloadUrl = new URI( - "https://" + host + "/" + decodeURIComponent(maybePath), + "https://" + host + "/" + decodeURIComponent(maybePath) + maybeInstancePath + "public/proposal", ) - .addQuery({ instance: maybeInstance, order_id: orderId }) + .addQuery({ order_id: orderId }) .href(); return { @@ -207,4 +208,4 @@ export function parseRefundUri(s: string): RefundUriResult | undefined { return { refundUrl, }; -}
\ No newline at end of file +} |