Repository navigation
feat(ramps): wait for the deposit rail before creating the VBA autoramp - #38651
Conversation
MoonPay rejects an autoramp create with a 422 while the deposit rail is not Active, even for an Active customer. ensureMusdAutoramp now reads the customer's rail abilities first: a pending rail keeps the user waiting and re-checks on the next poll, a blocked rail surfaces the account-create error without sending the create, and a failed abilities fetch falls back to creating as before. The NeoBankService messenger now also delegates AuthenticationController:getSessionProfile, which NeoBankService needs to resolve the MoonPay customer id for the abilities call. Uses the ramps-controller preview build from MetaMask/core#11225 until it is released. TRAM-4391
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…es-check # Conflicts: # app/components/UI/Ramp/Views/VirtualBankAccount/ensureMusdAutoramp.test.ts # yarn.lock
A blocked rail now reports Money VBA Autoramp Create Updated with status failed and failure_reason vba_create_failed before surfacing the 422 error, the same as the create would have reported. TRAM-4391
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Smart E2E Test SelectionSelected E2E tags: ALL AI Confidence: 100 E2E reasoningExpand to readHard rule seed (controller-version-update) mandates ALL tags due to @metamask/ramps-controller being bumped from v28 to v29 in package.json. Beyond the hard rule, the changes include:
Primary affected E2E tags: SmokeMoney (ramps, card flows). Secondary risk: any test using the initial-background-state fixture. The controller version bump warrants running ALL smoke tags to ensure no regressions across the full test suite. |
…es-check # Conflicts: # app/core/Engine/messengers/neo-bank-service-messenger/neo-bank-service-messenger.test.ts # app/core/Engine/messengers/neo-bank-service-messenger/neo-bank-service-messenger.ts
|



Description
MoonPay rejects an autoramp create with a 422 ("Customer is unable to complete the action. Consult the customer abilities API") when the customer is Active but the deposit rail the autoramp needs is not. Today that sends the user to the account-create error screen with "Contact support", even though the rail usually turns Active on its own shortly after.
ensureMusdAutorampnow reads the customer's rail abilities (RampsController.refreshCustomerAbilitiesandgetMusdAutorampDepositRailReadinessfrom MetaMask/core#11225) right before it creates the autoramp, both for the first fiat and for an additional fiat:active: creates the autoramp as before.pending: returnsawaiting_provider, so VbaDetails keeps the existing "Waiting for MoonPay to approve your account" screen and re-checks on its poll. The autoramp is created once the rail turns Active.blocked: throws the same account-create error a MoonPay 422 produces, without sending the create.The NeoBankService messenger now also delegates
AuthenticationController:getSessionProfile. NeoBankService needs it to resolve the MoonPay customer id for the abilities URL. Without it the abilities call throws inside the app and the check silently falls back to creating.Blocked by MetaMask/core#11225.
@metamask/ramps-controllerpoints at the preview build@metamask-previews/ramps-controller@28.1.0-preview-acf55e6fduntil core releases the change. That release is a major (29.0.0) becauseRAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONSgainsNeoBankService:getCustomerAbilities, which mobile already picks up by spreading the constant. This PR stays a draft until the dependency is switched to^29.0.0.Tested on an iOS device against dev with a local neobank-proxy and a temporary stub for the abilities response (fresh SRP, Brazil KYC): with the rail Pending the app polled for about 1.5 minutes and never sent a create; with Pending twice, then Active, it created the BRL autoramp on the next poll.
Changelog
CHANGELOG entry: Fixed Money Account bank account setup showing an error while MoonPay was still enabling the deposit method; the app now waits and finishes setup once it is ready
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-4391
Refs: https://consensyssoftware.atlassian.net/browse/TRAM-4364, MetaMask/core#11225
Manual testing steps
Screenshots/Recordings
Before
N/A
After
ScreenRecording_11-02-2026.15-47-54_1.compressed.mp4
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes Money VBA autoramp creation timing and external abilities API usage; fail-open on fetch errors could still allow a 422 from MoonPay if abilities are wrong.
Overview
ensureMusdAutorampno longer calls create as soon as KYC/hydrate says ready. It refreshes customer abilities (RampsController.refreshCustomerAbilities) and usesgetMusdAutorampDepositRailReadinessfrom@metamask/ramps-controller29 before every create (first fiat and additional fiat).Pending rails return
awaiting_providersoVbaDetailskeeps the existing “waiting for MoonPay” poll without hitting create (avoids MoonPay 422 when the customer is Active but the deposit method is not). Blocked rails fail like a 422 with analytics, without sending create. If abilities refresh fails, behavior fails open (log + create as before).Tests add rail-readiness coverage and mock
refreshCustomerAbilitiesinVbaDetails/ensureMusdAutoramptests; testinitial-background-stateaddsvbaCustomerAbilities.Dependency bump:
@metamask/ramps-controller^28 → ^29.Reviewed by Cursor Bugbot for commit 138a36f. Bugbot is set up for automated code reviews on this repo. Configure here.