diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-10-01 20:45:36 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-10-01 20:46:22 +0200 |
commit | 1a23fbcb4fdad661feb9ea923761f7e02d7f6e8d (patch) | |
tree | b34c72c43f69cd755b1aa5acff8a52345628bd3e /src/taleruri.ts | |
parent | 831d27c4df6412a6e1920341cbe6770a994a5804 (diff) | |
download | wallet-core-1a23fbcb4fdad661feb9ea923761f7e02d7f6e8d.tar.xz |
adapt to instance changes
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 +} |