Prefer Banxa's current payment processor over the one it supersedes - #6148
Open
j0ntz wants to merge 1 commit into
Open
Prefer Banxa's current payment processor over the one it supersedes#6148j0ntz wants to merge 1 commit into
j0ntz wants to merge 1 commit into
Conversation
Contributor
Author
📸🪓 Test evidence
🪓 HACK-FORCED: googlepay before fix legacy worldpaygoogle 6033 🪓 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
marked this pull request as ready for review
August 11, 2026 00:53
j0ntz
force-pushed
the
jon/banxa-googlepay-psp-priority
branch
from
August 11, 2026 00:53
3107489 to
d5a002e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have:
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
PRIMERGPto 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:Integer-like object keys iterate in ascending numeric order, so the four legacy
WORLDPAYGOOGLEids (6033, 6034, 6035, 6036) are always found beforePRIMERGP(6142). Every Google Pay quote and order therefore carried a legacypayment_method_id, which is exactly what Banxa is seeing.This ranks the candidates instead of taking the first: a
deprecatedPaymentTypesset marks the superseded PSPs (WORLDPAYGOOGLE,ZHACHSELL), andpickPreferredPaymentselects 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-methodsshowsPRIMERGPis a superset of theWORLDPAYGOOGLEentries 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:
ZHACHSELLis gone from Banxa's live sell response, soBRDGACHSELL(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:Banxa PROBE[WORLDPAYGOOGLE:6033], 500.00 USD to 0.00721889 BTCBanxa PROBE[PRIMERGP:6142], 500.00 USD to 0.00722104 BTCGoogle 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.tscovers 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.shpasses (CHANGELOG,npm run prepare, eslint on changed files, jest).Note
Medium Risk
Changes which Banxa
payment_method_idis 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
FiatPaymentTypenow goes throughpickPreferredPayment, which treatsWORLDPAYGOOGLE(superseded byPRIMERGP) andZHACHSELL(superseded byBRDGACHSELL) as deprecated and only uses them when no current PSP exists for that fiat/coin pair. Payment map entries carrypaymentTypeso that ranking can run.The same logic is applied in
banxaRampPlugin.tsandbanxaProvider.ts, with unit tests inpickPreferredPayment.test.ts.Reviewed by Cursor Bugbot for commit d5a002e. Bugbot is set up for automated code reviews on this repo. Configure here.