chore(runway): cherry-pick fix(ramps): improve external-browser callback redirection cp-7.71.0#27829
Conversation
…ack redirection cp-7.71.0 (#27804) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Fixes the external-browser return flow for unified ramps by moving callback resolution out of Build Quote and into Order Details. The bug was that external-browser returns were resolved too early in BuildQuote. If callback parsing or order lookup failed there, users could get bounced around or end up on a broken Order Details screen. This change fixes that by moving callback resolution into Order Details itself. BuildQuote now only hands off the callback context, and Order Details fetches the real order itself. That makes the flow more reliable: bailed callbacks return to Build Quote, and real fetch failures show a retryable error instead of a broken redirect. **What changed** - **Build Quote -> Order Details callback handoff** After a successful external-browser return, Build Quote now navigates to Order Details with the full `callbackUrl`, `providerCode`, and `walletAddress` instead of trying to resolve the order immediately. - **Order Details callback bootstrap** Order Details now supports loading from callback params, fetching the real order on first render, and updating route params once the order has been resolved. - **Bailed / invalid callback handling** If the callback resolves to a bailed order state or no usable order, the user is sent back to Build Quote instead of landing on a blank or broken Order Details screen. - **Retryable callback error state** If fetching the order from the callback URL fails, Order Details now shows a retryable error screen rather than silently resetting away. This makes transient backend/network failures recoverable. - **Navigation tests updated** Tests were updated to reflect the callback-based route shape and the new Order Details retry behavior. **What stays untouched** This PR does not change Order Content amount rendering, list display formatting, or duplicate placeholder cleanup. It is scoped only to fixing the external-browser redirection and callback-resolution path. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> Paypal Order going to build quote page first: Uploading Screen Recording 2026-03-23 at 1.00.39 PM.mov… ### **After** <!-- [screenshots/recordings] --> Native Transak Redirection https://github.com/user-attachments/assets/32d1a7f9-23c7-4df1-aba8-f639338d7a6f Bailed Paypal order (return to build quote page): https://github.com/user-attachments/assets/8ed07fa3-e7df-4b69-b2f0-9318799c8249 Paypal order going to order details page: https://github.com/user-attachments/assets/5a2e8489-a4b0-488d-8aca-7982df63c45c ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes the unified ramps external-browser return flow and navigation params, which can impact users reaching the correct order state after checkout; failures may surface as new retry/error behaviors. > > **Overview** > Fixes unified ramps external-browser return handling by **moving callback URL resolution out of `BuildQuote` and into `OrderDetails`**. > > `BuildQuote` no longer calls `getOrderFromCallback`/`addOrder` on InAppBrowser success; it now resets navigation to `OrderDetails` with `callbackUrl`, `providerCode`, and `walletAddress`. `OrderDetails` bootstraps from these callback params, fetches the real order (bailing back to `BuildQuote` for invalid/bailed statuses), updates route params to the resolved `orderId`, and shows a retryable error state if the callback fetch fails. > > Updates `rampsNavigation` to support an `OrderDetails` route shaped around callback params (and makes `orderId` optional), and adjusts/adds tests to cover the new handoff and retry behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0eabfd6. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes directly affect the on-ramp purchase flow - specifically the critical path where a user returns from an external browser after completing a purchase. The No other feature areas are impacted - no shared navigation components, no controllers, no Engine changes, no other UI components outside Ramp are touched. The changes don't affect performance-sensitive code paths (no list rendering, no heavy state management, no startup/initialization code). Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |



Description
Fixes the external-browser return flow for unified ramps by moving
callback resolution out of Build Quote and into Order Details.
The bug was that external-browser returns were resolved too early in
BuildQuote. If callback parsing or order lookup failed there, users
could get bounced around or end up on a broken Order Details screen.
This change fixes that by moving callback resolution into Order Details
itself. BuildQuote now only hands off the callback context, and Order
Details fetches the real order itself. That makes the flow more
reliable: bailed callbacks return to Build Quote, and real fetch
failures show a retryable error instead of a broken redirect.
What changed
Build Quote -> Order Details callback handoff
After a successful external-browser return, Build Quote now navigates to
Order Details with the full
callbackUrl,providerCode, andwalletAddressinstead of trying to resolve the order immediately.Order Details callback bootstrap
Order Details now supports loading from callback params, fetching the
real order on first render, and updating route params once the order has
been resolved.
Bailed / invalid callback handling
If the callback resolves to a bailed order state or no usable order, the
user is sent back to Build Quote instead of landing on a blank or broken
Order Details screen.
Retryable callback error state
If fetching the order from the callback URL fails, Order Details now
shows a retryable error screen rather than silently resetting away. This
makes transient backend/network failures recoverable.
Navigation tests updated
Tests were updated to reflect the callback-based route shape and the new
Order Details retry behavior.
What stays untouched
This PR does not change Order Content amount rendering, list display
formatting, or duplicate placeholder cleanup. It is scoped only to
fixing the external-browser redirection and callback-resolution path.
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
Paypal Order going to build quote page first:
Uploading Screen Recording 2026-03-23 at 1.00.39 PM.mov…
After
Native Transak Redirection
Screen.Recording.2026-03-23.at.12.46.56.PM.mov
Bailed Paypal order (return to build quote page):
Screen.Recording.2026-03-23.at.12.38.45.PM.mov
Paypal order going to order details page:
Screen.Recording.2026-03-23.at.12.33.26.PM.mov
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Changes the unified ramps external-browser return flow and navigation
params, which can impact users reaching the correct order state after
checkout; failures may surface as new retry/error behaviors.
Overview
Fixes unified ramps external-browser return handling by moving
callback URL resolution out of
BuildQuoteand intoOrderDetails.BuildQuoteno longer callsgetOrderFromCallback/addOrderonInAppBrowser success; it now resets navigation to
OrderDetailswithcallbackUrl,providerCode, andwalletAddress.OrderDetailsbootstraps from these callback params, fetches the real order (bailing
back to
BuildQuotefor invalid/bailed statuses), updates route paramsto the resolved
orderId, and shows a retryable error state if thecallback fetch fails.
Updates
rampsNavigationto support anOrderDetailsroute shapedaround callback params (and makes
orderIdoptional), and adjusts/addstests to cover the new handoff and retry behavior.
Written by Cursor
Bugbot for commit
0eabfd6. This will update automatically
on new commits. Configure
here.