From 5958580cd28a9f2c2ee0405641440e45d63bbd11 Mon Sep 17 00:00:00 2001 From: Sam Holmes Date: Fri, 13 Dec 2024 10:43:09 -0800 Subject: [PATCH] Patch return URL status --- src/plugins/gui/providers/banxaProvider.ts | 6 +++++- src/plugins/gui/providers/simplexProvider.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/gui/providers/banxaProvider.ts b/src/plugins/gui/providers/banxaProvider.ts index 0646e452055..764cc732611 100644 --- a/src/plugins/gui/providers/banxaProvider.ts +++ b/src/plugins/gui/providers/banxaProvider.ts @@ -601,8 +601,12 @@ export const banxaProvider: FiatProviderFactory = { const orderResponse = await banxaFetch({ method: 'GET', url, hmacUser, path: `api/orders/${banxaQuote.data.order.id}`, apiKey }) const order = asBanxaOrderResponse(orderResponse) + // Banxa will incorrectly add their query string parameters + // to the url with a simple concatenation of '?orderId=...', + // and this will break our query string. + const status = link.query.status?.replace('?', '') - switch (link.query.status) { + switch (status) { case 'success': { await showUi.trackConversion('Buy_Success', { conversionValues: { diff --git a/src/plugins/gui/providers/simplexProvider.ts b/src/plugins/gui/providers/simplexProvider.ts index 4bf22318593..81a3a23432a 100644 --- a/src/plugins/gui/providers/simplexProvider.ts +++ b/src/plugins/gui/providers/simplexProvider.ts @@ -366,8 +366,12 @@ export const simplexProvider: FiatProviderFactory = { if (link.direction !== 'buy') return const orderId = link.query.orderId ?? 'unknown' + // Simplex _may_ incorrectly add their query string parameters + // to the url with a simple concatenation of '?orderId=...' + // (like Banxa), and this will break our query string. + const status = link.query.status?.replace('?', '') - switch (link.query.status) { + switch (status) { case 'success': { await showUi.trackConversion('Buy_Success', { conversionValues: {