Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch return URL status #5398

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading