fix refund URI parsing (due to merchant backend change)
This commit is contained in:
parent
421e613f92
commit
8d72b93a17
@ -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();
|
||||
|
@ -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}/`;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user