feat(ramps): add custom action order handling for external checkout flows#27364
Conversation
|
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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
…/v2-custom-actions-codeonly
…/v2-custom-actions-codeonly
| @@ -167,21 +167,35 @@ const Checkout = () => { | |||
| }, [uri, createEventBuilder, trackEvent, rampRoutingDecision]); | |||
|
|
|||
| useEffect(() => { | |||
| errorCount: 0, | ||
| }; | ||
| setCustomIdData(data); | ||
| dispatch(addFiatCustomIdData(data)); |
|
@cursoragent please fix the ramp bootstrap test |
…k/metamask-mobile into codex/v2-custom-actions-codeonly
…/v2-custom-actions-codeonly
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.
| status: RampsOrderStatus | undefined, | ||
| ): boolean { | ||
| return status != null && BAILED_ORDER_STATUSES.has(status); | ||
| } |
There was a problem hiding this comment.
Exported isBailedOrderStatus only used internally in BuildQuote
Low Severity
isBailedOrderStatus and BAILED_ORDER_STATUSES are defined at module scope and exported, but grep shows they are only referenced within BuildQuote.tsx itself. The function and the Set constant are better placed in a utility file (e.g., alongside extractOrderCode or rampsNavigation) or kept unexported, since mixing domain utility logic with a React component's module top-level scope reduces cohesion and readability.
Additional Locations (1)
…/v2-custom-actions-codeonly
…/v2-custom-actions-codeonly
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |







Description
Integrates new ramps-controller API for custom-action flows (e.g., PayPal) removes Redux-based custom ID tracking.
Simplifies ramps-controller state hydration system into a single
initcall on app start up.What changed:
getBuyWidgetDatainstead ofgetWidgetUrl. ForisCustomActionquotes, callsaddPrecreatedOrderbefore opening external browser (InAppBrowser orLinking.openURL) and passesorderIdto Checkout for WebView flows.addPrecreatedOrderinstead of ReduxaddFiatCustomIdData. Supports bothorderIdandcustomOrderIdfor backwards compatibility.useRampsOrdersexposesaddPrecreatedOrderandAddPrecreatedOrderParams;useRampsQuotesusesgetBuyWidgetDatareturningPromise<BuyWidget | null>;useRampsControllerexposes both.PaymentSelectionModalandProviderSelectionfilter outisCustomActionquotes where appropriate.What stays untouched: Non-custom-action flows (standard WebView checkout) unchanged. Existing ramps navigation and token selection preserved.
Dependencies: Requires MetaMask/core#8100 for the new controller API.
Changelog
CHANGELOG entry: Adds support for ramps providers such as PayPal, Robinhood & Coinbase that use a different checkout browser
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes the
BuildQuotecontinue flow to support external-browser widget checkouts with precreated order tracking and post-auth callback handling, which can affect buy navigation and order state. Mostly scoped to ramps UI/controller integration with expanded test coverage, but touches user-facing purchase flow and deep-link/callback paths.Overview
Updates the ramps BuildQuote flow to use the new controller API
getBuyWidgetData(replacinggetWidgetUrl) and to support widget providers that require external checkout. When external browser checkout is used, it now pre-creates an order viaaddPrecreatedOrder, opens the widget viaInAppBrowser.openAuth(orLinking.openURLfallback), parses the callback to fetch/add the resulting order, and resets navigation either back toBuildQuoteor intoRAMPS_ORDER_DETAILS.Refactors amount entry handling into a shared
updateAmountpath and consolidates user-facing errors underrampsErrorusingreportRampsError. Bootstrap is adjusted to runuseRampsProviderson mount (replacinguseHydrateRampsController), and tests are heavily rewritten/updated to cover the new routing, error, and callback/order-handling behavior.Written by Cursor Bugbot for commit 10e9092. This will update automatically on new commits. Configure here.