Skip to content

Commit

Permalink
Patch return URL status
Browse files Browse the repository at this point in the history
  • Loading branch information
samholmes committed Dec 13, 2024
1 parent ee30006 commit 5958580
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/plugins/gui/providers/banxaProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/gui/providers/simplexProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 5958580

Please sign in to comment.