fix(ramps): improve external-browser callback redirection cp-7.71.0#27804
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. |
…/ramps-callback-redirection
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes affect the on-ramp purchase completion flow - specifically what happens after a user returns from an external browser after completing a purchase. The No other feature areas are impacted:
The SmokeRamps tag description mentions "region-aware on-ramp flows" and "deep link navigation into buy flows" which aligns with this callback URL handling change. 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
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
Pre-merge reviewer checklist
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/addOrderon InAppBrowser success; it now resets navigation toOrderDetailswithcallbackUrl,providerCode, andwalletAddress.OrderDetailsbootstraps from these callback params, fetches the real order (bailing back toBuildQuotefor invalid/bailed statuses), updates route params to the resolvedorderId, and shows a retryable error state if the callback fetch fails.Updates
rampsNavigationto support anOrderDetailsroute shaped around callback params (and makesorderIdoptional), and adjusts/adds tests to cover the new handoff and retry behavior.Written by Cursor Bugbot for commit 0eabfd6. This will update automatically on new commits. Configure here.