Skip to content

Prefer Banxa's current payment processor over the one it supersedes - #6148

Open
j0ntz wants to merge 1 commit into
developfrom
jon/banxa-googlepay-psp-priority
Open

Prefer Banxa's current payment processor over the one it supersedes#6148
j0ntz wants to merge 1 commit into
developfrom
jon/banxa-googlepay-psp-priority

Conversation

@j0ntz

@j0ntz j0ntz commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Description

Asana task

Asana: https://app.asana.com/1/9976422036640/project/1213880789473005/task/1210642564105750

Banxa reports that Edge orders are still arriving on the OLD Google Pay processor, a month after #6071 mapped the new one. Adding PRIMERGP to the allowlist was necessary but not sufficient.

Banxa runs a replacement PSP alongside the PSP it supersedes until the old one is switched off, so several ACTIVE payment methods share one Edge FiatPaymentType. Selection took the first match out of a map keyed by Banxa's numeric payment id:

const payments = banxaPaymentsMap[direction][fiat][banxaCoin]
const paymentId = Object.values(payments).find(p => p.type === type)

Integer-like object keys iterate in ascending numeric order, so the four legacy WORLDPAYGOOGLE ids (6033, 6034, 6035, 6036) are always found before PRIMERGP (6142). Every Google Pay quote and order therefore carried a legacy payment_method_id, which is exactly what Banxa is seeing.

This ranks the candidates instead of taking the first: a deprecatedPaymentTypes set marks the superseded PSPs (WORLDPAYGOOGLE, ZHACHSELL), and pickPreferredPayment selects a deprecated one only when no current PSP serves the fiat/coin pair.

Deleting the legacy mapping outright was rejected. Banxa's live api/payment-methods shows PRIMERGP is a superset of the WORLDPAYGOOGLE entries except for KRW, and covers 127 coins against the legacy entries' union of 136: APE, EURQ, EUSD, GALA, INJ, MELANIA, MYTH, S, TRUMP, USDQ and VFX exist only on the legacy PSP. Ranking keeps those combinations working while every combination Banxa has migrated moves to the new PSP.

Both Banxa integrations get the same change, as in #6071: the live ramps plugin (src/plugins/ramps/banxa/banxaRampPlugin.ts) and the legacy provider (src/plugins/gui/providers/banxaProvider.ts).

The sell side needed no equivalent fix: ZHACHSELL is gone from Banxa's live sell response, so BRDGACHSELL (6151) is already the only ACH candidate. It is in the deprecated set anyway, so a re-listing cannot regress it.

Testing

Driven in-app on the iOS simulator against Banxa's live production API: ramps Buy, Texas/USA, USD 500 to BTC, on edge-funds. A temporary probe appended the resolved Banxa payment method to the provider's display name, giving a matched pair from the same running app:

  • Before (pre-fix selection): Banxa PROBE[WORLDPAYGOOGLE:6033], 500.00 USD to 0.00721889 BTC
  • After (this change): Banxa PROBE[PRIMERGP:6142], 500.00 USD to 0.00722104 BTC

Google Pay is filtered out of the iOS quote list by useRampQuotes.ts, so that filter was disabled locally to render the row. Both probe edits were reverted before committing.

New unit test src/__tests__/plugins/ramps/banxa/pickPreferredPayment.test.ts covers the selection order: the current PSP wins when both are present, the result does not depend on candidate order, the deprecated PSP is still used when it is the only candidate, and a non-matching type returns nothing.

verify-repo.sh passes (CHANGELOG, npm run prepare, eslint on changed files, jest).


Note

Medium Risk
Changes which Banxa payment_method_id is sent on buy quotes/orders (fiat on-ramp path); behavior is covered by new unit tests and matches an intentional PSP migration fix.

Overview
Banxa Google Pay (and similar overlaps) no longer pick the legacy processor just because its numeric payment id sorts first in the internal map.

Selection for a given FiatPaymentType now goes through pickPreferredPayment, which treats WORLDPAYGOOGLE (superseded by PRIMERGP) and ZHACHSELL (superseded by BRDGACHSELL) as deprecated and only uses them when no current PSP exists for that fiat/coin pair. Payment map entries carry paymentType so that ranking can run.

The same logic is applied in banxaRampPlugin.ts and banxaProvider.ts, with unit tests in pickPreferredPayment.test.ts.

Reviewed by Cursor Bugbot for commit d5a002e. Bugbot is set up for automated code reviews on this repo. Configure here.

@j0ntz

j0ntz commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

📸🪓 Test evidence

🪓 Hack-forced evidence: disabled the iOS googlepay filter in useRampQuotes.ts so the row renders on the sim, and appended the resolved Banxa payment method to the provider display name as a probe; both reverted before committing. Temporary uncommitted edit, reverted before commit; the marked frames prove the rendering, not the trigger.

🪓 HACK-FORCED: googlepay before fix legacy worldpaygoogle 6033

🪓 HACK-FORCED: googlepay before fix legacy worldpaygoogle 6033

🪓 HACK-FORCED: googlepay after fix primergp 6142

🪓 HACK-FORCED: googlepay after fix primergp 6142

Captured by the agent's in-app test run (build-and-test).

Banxa runs a replacement payment service provider alongside the one it
supersedes until the old one is switched off, so several ACTIVE methods
can share a single Edge FiatPaymentType. Selection read whichever entry
came first out of a map keyed by Banxa's numeric payment id, which is
ascending order, so the older PSP always won: every Google Pay order went
out on the legacy WORLDPAYGOOGLE ids (6033-6036) rather than the
consolidated PRIMERGP id (6142) added when the code was first mapped.

Rank candidates instead of taking the first: a deprecated PSP is only
selected when no current PSP serves the fiat/coin pair, which keeps the
coverage that exists solely on the legacy methods (KRW, plus eleven
coins) working.
@j0ntz
j0ntz marked this pull request as ready for review August 11, 2026 00:53
@j0ntz
j0ntz force-pushed the jon/banxa-googlepay-psp-priority branch from 3107489 to d5a002e Compare August 11, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant