aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/taler-integrationtests/src/test-refund.ts1
-rw-r--r--packages/taler-wallet-core/src/util/taleruri.ts7
2 files changed, 5 insertions, 3 deletions
diff --git a/packages/taler-integrationtests/src/test-refund.ts b/packages/taler-integrationtests/src/test-refund.ts
index f88a399b5..bda609c95 100644
--- a/packages/taler-integrationtests/src/test-refund.ts
+++ b/packages/taler-integrationtests/src/test-refund.ts
@@ -86,6 +86,7 @@ runTest(async (t: GlobalTestState) => {
let r = await wallet.apiRequest("applyRefund", {
talerRefundUri: ref.talerRefundUri,
});
+ t.assertTrue(r.type === "response");
console.log(r);
await wallet.runUntilDone();
diff --git a/packages/taler-wallet-core/src/util/taleruri.ts b/packages/taler-wallet-core/src/util/taleruri.ts
index 43a869afe..56b46c0ff 100644
--- a/packages/taler-wallet-core/src/util/taleruri.ts
+++ b/packages/taler-wallet-core/src/util/taleruri.ts
@@ -199,12 +199,13 @@ export function parseRefundUri(s: string): RefundUriResult | undefined {
}
const c = pi?.rest.split("?");
const parts = c[0].split("/");
- if (parts.length < 2) {
+ if (parts.length < 3) {
return undefined;
}
const host = parts[0].toLowerCase();
- const orderId = parts[parts.length - 1];
- const pathSegments = parts.slice(1, parts.length - 1);
+ const sessionId = parts[parts.length - 1];
+ const orderId = parts[parts.length - 2];
+ const pathSegments = parts.slice(1, parts.length - 2);
const p = [host, ...pathSegments].join("/");
const merchantBaseUrl = `${pi.innerProto}://${p}/`;