Repository navigation
fix(ramps-controller): scope getAutoramps to the current customer - #10507
Closed
georgeweiler wants to merge 2 commits into
Closed
georgeweiler wants to merge 2 commits into
georgeweiler wants to merge 2 commits into
Conversation
`NeoBankService.getAutoramps` called `GET /neobank/autoramps` with no filter.
That route is unsupported unfiltered (it 404'd), and MoonPay's `GET /api/autoramps`
returns every partner customer's autoramps when `customer_id` is omitted — never
what a single-user client wants. As a result `hydrateVbaOnboarding` could not
discover a customer's existing autoramp and account provisioning failed.
Resolve the current customer from the signed-in profile (via the existing
`getMoonpayCustomerId`) and pass it as `customer_id`, and parse MoonPay's
paginated `{ items }` envelope. This rediscovers an existing autoramp after a
reinstall or SRP restore on a new device, keyed on identity rather than local
state. The public `getAutoramps()` signature is unchanged, so callers
(RampsController, hosts) are unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
georgeweiler
temporarily deployed
to
default-branch
September 28, 2026 12:25 — with
GitHub Actions
Inactive
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Explanation
NeoBankService.getAutorampscalledGET /neobank/autorampswith no query filter. Two problems:GET /neobank/autorampsreturned404 "Cannot GET /neobank/autoramps".GET /api/autorampstreatscustomer_idas optional and, when omitted, returns every partner customer's autoramps — never what a single-user client wants, and served under the shared partner token.Because of this,
hydrateVbaOnboardingcould not discover a customer's existing autoramp: after KYC it fell through to a create attempt that MoonPay rejects with400 "Customer already has a Pix onramp", dead-ending account provisioning ("couldn't create your account") — reproducible after clearing app state or restoring an SRP on a new device.This resolves the current customer from the signed-in profile (reusing the existing
getMoonpayCustomerId()— canonical MetaMask profile id → Iron customer id) and passes it ascustomer_id, then parses MoonPay's paginated{ items }envelope. Discovery is now keyed on identity, not local state, so an existing autoramp is found on a fresh install.Non-breaking: the public
getAutoramps()signature is unchanged — the customer is resolved internally — soRampsController.hydrateVbaOnboardingand hosts (mobile) need no changes.References
Changelog
@metamask/ramps-controllerNeoBankService.getAutorampsscopes the query to the current customer (customer_id, resolved from the signed-in profile) and parses MoonPay's paginated response, sohydrateVbaOnboardingrediscovers an existing autoramp after reinstall/SRP restore instead of failing provisioning. PublicgetAutoramps()signature unchanged.Checklist
🤖 Generated with Claude Code
Note
Medium Risk
Changes neo-bank autoramp discovery used in VBA onboarding and relies on a matching neobank-proxy list route deploy; mis-scoping or response parsing would break account provisioning for returning users.
Overview
NeoBankService.getAutorampsno longer calls an unfilteredGET /neobank/autoramps(which 404'd on the proxy and would have been unsafe on MoonPay anyway). It now resolves the MoonPay customer id from the signed-in profile viagetMoonpayCustomerId(), requestsGET /neobank/autoramps?customer_id=…, and maps results from MoonPay's paginated{ items, cursor, prev_cursor }envelope instead of a bare array.The public
getAutoramps()signature is unchanged, sohydrateVbaOnboardingand hosts can rediscover an existing autoramp after reinstall or SRP restore without attempting a duplicate create. Tests and action-type docs were updated to match the scoped query and paginated response shape.Reviewed by Cursor Bugbot for commit 46bb488. Bugbot is set up for automated code reviews on this repo. Configure here.