Skip to content

feat(ramps-controller): add neobank onboarding stage lookup - #10116

Draft
roz0n wants to merge 6 commits into
mainfrom
feat/TRAM-3916-neobank-state-machine
Draft

feat(ramps-controller): add neobank onboarding stage lookup#10116
roz0n wants to merge 6 commits into
mainfrom
feat/TRAM-3916-neobank-state-machine

Conversation

@roz0n

@roz0n roz0n commented Sep 4, 2026

Copy link
Copy Markdown

Explanation

Adds RampsController.hydrateNeobankStore({ walletAddress }) and persisted state.neobank so clients can resume Money Account onboarding from authoritative Core state.

The lookup refreshes KYC first, then checks wallet registration and autoramp readiness only after KYC completes. It returns one NeobankOnboardingStage. It does not navigate, launch SumSub, register a wallet, or create an autoramp.

Final KYC behavior:

  • Missing vendor or provider terms stays in the matching terms stage.
  • SumSub abandoned or retryable failed returns KycStartedIncomplete.
  • SumSub vendorProcessing and user status pending return KycPending and must not relaunch the SDK.
  • Controller phase error returns LookupFailed.
  • KycRejected is reserved for user status terminal-failure.
  • Mobile owns routing. A dedicated KYC page hook owns controller initialization when SumSub should be open.

Hosts must delegate the exported required KYC actions.

References

Checklist

  • Tests updated
  • Documentation updated
  • Changelog updated

roz0n added a commit that referenced this pull request Sep 4, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
roz0n added a commit that referenced this pull request Sep 8, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@roz0n
roz0n force-pushed the feat/TRAM-3916-neobank-state-machine branch from 9883790 to 8928d7c Compare September 8, 2026 15:12
@roz0n roz0n self-assigned this Sep 8, 2026
@roz0n roz0n changed the title feat(ramps-controller): add hydrateNeobankStore onboarding stage lookup feat(ramps-controller): add neobank onboarding stage lookup Sep 8, 2026
* SumSub + idOS provider disclaimers (submitted as a batch — if either is
* missing after a partial accept, Mobile routes back to Terms 2).
*/
export enum NeobankOnboardingStage {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Review final states before merging

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the final states against KYC controller statuses and the SumSub launch rule (mount KYCPage + page hook; do not launch from a router method).

Kept the funnel: NoUser / EmailOtp / VendorTerms / ProviderTerms → KYC stages → wallet → autoramp → LookupFailed. Core still returns a stage only.

Derivation fixes in c05e25b:

  • abandoned and retryable SumSub failedKycStartedIncomplete (KYCPage hook may resume / relaunch)
  • vendorProcessing and userStatus === pendingKycPending (do not launch the SDK)
  • phase === errorLookupFailed, not a terminal KYC reject
  • form / check count as in-progress, not KycNotStarted
  • KycRejected is only userStatus === terminal-failure

Mobile should map KycNotStarted / KycStartedIncomplete / KycNeedsReview to KYCPage, and T&C stages elsewhere. No LaunchSumsub stage or Core launch action.

roz0n and others added 4 commits September 11, 2026 09:56
Give Mobile a single idempotent Core action that refreshes KYC/wallet/autoramp signals and returns the Money Account onboarding stage without navigating or auto-submitting.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…leased

Keep the onboarding stage entry out of released 20.3.0 so the changelog check can see it, and format the hydrateNeobankStore tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@roz0n
roz0n force-pushed the feat/TRAM-3916-neobank-state-machine branch from 8928d7c to 49def7a Compare September 11, 2026 14:16
roz0n and others added 2 commits September 11, 2026 10:24
Treat abandoned/retryable SumSub as KYCPage-resume, vendorProcessing as pending without launching the SDK, and controller errors as lookup failures rather than terminal rejects.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* registration / autoramp checks after KYC is complete.
* @returns The derived {@link NeobankOnboardingStage}.
*/
async hydrateNeobankStore({

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GW: do we need walletAddress passed here? (might be ok)

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