Add VBA onboarding stage hydration - #10278
Open
georgeweiler wants to merge 7 commits into
Open
georgeweiler wants to merge 7 commits into
georgeweiler wants to merge 7 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop local KycVendor/KycProvider/KycStatus stubs and action types in favor of the package exports introduced in #10279. Co-authored-by: Cursor <cursoragent@cursor.com>
…t on hydrate Before reading the VBA stage gates, hydrateVbaOnboarding now calls KycController:refreshVbaOnboardingStatus so each stage reflects the vendor account (vendor-terms re-signing, KYC status) rather than only device-local state. The action is declared as a local structural messenger-action type so the ramps package does not require a kyc-controller release that already exports it (the KYC PR merges first). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Draft
10 tasks
… 0.4.0 session API
…not finalStatus finalStatus is already 'pending' once the session + consents exist (pre-SumSub), so route to KycRequired until vendorStatus/kycStatus leaves 'new'/'retry'; only show KycPending once the applicant has actually submitted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 24656d6. Configure here.
| if (vendorStatus === 'pending' || kycStatus === 'pending') { | ||
| return this.#setVbaOnboardingStage(VbaOnboardingStage.KycPending); | ||
| } | ||
| return this.#setVbaOnboardingStage(VbaOnboardingStage.KycRequired); |
There was a problem hiding this comment.
Partial KYC approval completes onboarding
High Severity
The new stage mapping treats any of finalStatus, vendorStatus, or kycStatus being approved as KYC acceptance. The documented vendor-processing state (kycStatus: approved, finalStatus: pending) therefore skips KycPending and proceeds to wallet registration, autoramp creation, and Completed before the vendor has finalized.
Reviewed by Cursor Bugbot for commit 24656d6. Configure here.
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.


Summary
vbaOnboardingStagecontract for Mobile routinghydrateVbaOnboardingrefreshes KYC state from the customer's account viaKycController:refreshVbaOnboardingStatusbefore reading the stage gates, then maps Iron/SumSub getters (KycVendor/KycProvider/KycStatusfrom feat(kyc-controller): add VBA onboarding KYC getters #10279) to a routable stagekyc-controllerrelease that already exports it (KYC PR merges first)NeoBankService:getAutorampsaction before deciding whether account creation is neededThis is a simplified replacement for #10116. KYC flow interpretation stays in
KycController; this PR imports the shared enums/action types from@metamask/kyc-controllerrather than declaring them locally.Depends on: #10279 (KYC getters + VBA status refresh). Until that lands, this branch is expected not to typecheck against main's
kyc-controllerpackage — that is intentional.The proxy is expected to support authenticated
GET /neobank/autorampsrequests.Testing
yarn jest src/NeoBankService.test.ts src/RampsController.test.ts --runInBand --no-coverageyarn workspace @metamask/ramps-controller run testyarn build(may fail until feat(kyc-controller): add VBA onboarding KYC getters #10279 merges)yarn workspace @metamask/ramps-controller run messenger-action-types:checkyarn changelog:validate🤖 Generated with Claude Code
Note
High Risk
Touches KYC gating, wallet registration (keyring signatures), and neobank autoramp creation with new cross-controller messenger contracts and persisted onboarding state.
Overview
Adds VBA (Virtual Bank Account) onboarding for Mobile: a persisted
vbaOnboardingStageandhydrateVbaOnboarding, which reads Iron KYC session/disclaimer state via newKycControllermessenger actions, maps it to seven routable stages (email OTP through completed), and after approval registers the Money Account wallet, syncs autoramps from the backend, and creates one only when none is usable for the wallet.NeoBankService:getAutorampscalls authenticatedGET /neobank/autoramps, maps responses like single-autoramp fetch, and is wired into hydration so local autoramp cache matches the server before deciding whether to create.Breaking: hosts must delegate
KycController:getSessionStatusForVendor,hasCompletedVendorDisclaimers, andhasCompletedSessionDisclaimers, plusNeoBankService:getAutoramps. Adds@metamask/kyc-controllerdependency. OverlappinghydrateVbaOnboardingcalls are coalesced to avoid duplicate signatures and autoramp creation during polling; setup failures leave the previous stage unchanged.Reviewed by Cursor Bugbot for commit 24656d6. Bugbot is set up for automated code reviews on this repo. Configure here.