-
Notifications
You must be signed in to change notification settings - Fork 279
Jon/infinite v2 #5892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Jon/infinite v2 #5892
Conversation
Update challenge and verify endpoints to use the new headless API paths: - /v1/auth/wallet/challenge → /v1/headless/auth/wallet/challenge - /v1/auth/wallet/verify → /v1/headless/auth/wallet/verify
- Flatten customer request schema: remove nested 'data' wrapper - Remove residentialAddress from request (no longer supported) - Remove kycLinkUrl and usedPersonaKyc from response - New customers now start with PENDING status instead of ACTIVE - Add getKycLink API method for obtaining KYC verification links - Update kycWorkflow to use new getKycLink endpoint
- Change status values: PENDING, IN_REVIEW, ACTIVE, NEED_ACTIONS, REJECTED - Add sessionStatus field to KYC status response - Update kycWorkflow status checks for new format - ACTIVE replaces 'approved' as the completed status - PENDING replaces 'not_started'/'incomplete'
Change bridgeAccountId to externalAccountId in customer accounts response to match new API format that abstracts away the underlying provider.
The TOS (Terms of Service) workflow is no longer part of the new Infinite API: - Delete tosWorkflow.ts - Remove tosWorkflow import and call from infiniteRampPlugin.ts - Remove asInfiniteTosStatus, InfiniteTosStatus, asInfiniteTosResponse types - Remove getTos method from InfiniteApi interface and implementation - Remove ramp_tos_* locale strings from en_US.ts and all JSON files
For already-KYC'ed emails
Field focus doesn't properly move the focused field above the floating next button, so just changing it into `SceneButtons`
We should consider adding more information to this mostly blank scene...
Account and routing number length check failures will disable the next button, and length errors in these fields immediately show in the field on blur.
Fix spacing throughout, remove styled(), reuse existing components, add copy functionality.
| ) | ||
|
|
||
| const hasValidLengths = | ||
| accountNumber.trim().length >= 4 && routingNumber.trim().length === 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Account number validation length mismatch causes inconsistent behavior
The isFormValid check allows account numbers with 4+ digits (>= 4), but validateField shows an error message for account numbers with fewer than 8 digits (< 8). This inconsistency means a user entering 5-7 digits will see the submit button enabled until they blur the field, at which point an error appears and the button becomes disabled. The hasValidLengths check should use >= 8 to match the validation error threshold.
Additional Locations (1)
| // } | ||
| // // Re-throw other errors as-is | ||
| // throw err | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OTP verification catches all errors as invalid code
The verifyOtp catch block always throws an InfiniteApiError with the "invalid verification code" message, regardless of what error actually occurred. Network failures, server errors, or other issues will all be incorrectly reported to users as "Invalid verification code." The commented-out code suggests this was meant to only handle 400 errors specifically, but the conditional logic is disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const isFormValid = React.useMemo(() => { | ||
| return ( | ||
| const hasRequiredFields = | ||
| bankName.trim() !== '' && | ||
| accountNumber.trim() !== '' && | ||
| routingNumber.trim() !== '' && | ||
| accountName.trim() !== '' && | ||
| ownerFirstName.trim() !== '' && | ||
| ownerLastName.trim() !== '' | ||
| ) | ||
|
|
||
| const hasValidLengths = | ||
| accountNumber.trim().length >= 4 && routingNumber.trim().length === 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Account number min-length check can be bypassed
The form validity check only requires accountNumber.trim().length >= 4 even though the field validator shows an error when the value is shorter than 8 digits. Because field errors are cleared on every change, a user can edit the account number down to 4–7 digits and submit while the field still has focus, bypassing the 8-digit requirement and sending an under-length account number to onSubmit, which the backend is likely to reject.
Useful? React with 👍 / 👎.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneRequirements
If you have made any visual changes to the GUI. Make sure you have:
Note
Modernizes the Infinite ramp integration and UX to align with the new API and flows.
/v1/headlessendpoints; addverifyOtp,getKycLink; update KYC statuses (PENDING/IN_REVIEW/ACTIVE/...), quote/transfer optional fields, and bank account metadata (externalAccountId); remove TOS APIs; addInfiniteApiErrorand cleaners for new shapeskycWorkflowsupports existing-email OTP viaOtpVerificationModal, opens KYC viagetKycLink, and maps new statuses; improved graceful-exit handling and logging;translateErrorsurfacesInfiniteApiErrormessagesOtpVerificationModal; bank form adds inline validation and usesSceneContainer; routing details scene refactored with copy actions and sectioned rows; confirmation scene slider docks at bottom; centralize icons inThemedIconsand refactorEdgeRowto use themWritten by Cursor Bugbot for commit b220b75. This will update automatically on new commits. Configure here.