Skip to content

fix(ramps): improve external-browser callback redirection cp-7.71.0#27804

Merged
georgeweiler merged 8 commits into
mainfrom
codex/ramps-callback-redirection
Mar 23, 2026
Merged

fix(ramps): improve external-browser callback redirection cp-7.71.0#27804
georgeweiler merged 8 commits into
mainfrom
codex/ramps-callback-redirection

Conversation

@georgeweiler
Copy link
Copy Markdown
Contributor

@georgeweiler georgeweiler commented Mar 23, 2026

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, 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

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

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

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

  • 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.

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.

Written by Cursor Bugbot for commit 0eabfd6. This will update automatically on new commits. Configure here.

@georgeweiler georgeweiler requested a review from a team as a code owner March 23, 2026 13:40
@github-actions
Copy link
Copy Markdown
Contributor

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.

@georgeweiler georgeweiler changed the title Codex/ramps callback redirection fix(ramps): improve external-browser callback redirection Mar 23, 2026
@github-actions github-actions Bot added size-M risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 23, 2026
Comment thread app/components/UI/Ramp/Views/OrderDetails/OrderDetails.tsx
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 23, 2026
@georgeweiler georgeweiler added the team-money-movement issues related to Money Movement features label Mar 23, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 23, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/components/UI/Ramp/Views/OrderDetails/OrderDetails.test.tsx
Comment thread app/components/UI/Ramp/Views/OrderDetails/OrderDetails.tsx Outdated
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeRamps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are entirely within the Ramps (on-ramp/off-ramp) feature area. The PR refactors the external browser callback flow:

  1. BuildQuote.tsx: Removed the immediate getOrderFromCallback call after returning from external browser. Instead, it now passes callbackUrl, providerCode, and walletAddress as navigation params to OrderDetails.

  2. OrderDetails.tsx: Now handles the deferred callback URL fetching that was previously in BuildQuote. Added new state management, retry logic, and error handling for the callback fetch flow.

  3. rampsNavigation.ts: Extended types to support the new callbackUrl-based navigation variant alongside the existing orderCode-based variant.

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 SmokeRamps tag covers on-ramp and off-ramp flows including the order details screen and navigation flows.

No other feature areas are impacted:

  • No changes to shared navigation infrastructure (TabBar, modals)
  • No changes to confirmations, accounts, networks, or other wallet features
  • No changes to Engine, controllers, or core services
  • Changes are isolated to Ramp-specific components and utilities

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:
The changes are logic/flow refactoring within the Ramps feature - moving callback URL fetching from BuildQuote to OrderDetails. There are no UI rendering changes, no list component changes, no state management changes that would affect app performance metrics. No performance test tags are warranted.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@georgeweiler georgeweiler added this pull request to the merge queue Mar 23, 2026
@georgeweiler georgeweiler removed this pull request from the merge queue due to a manual request Mar 23, 2026
@georgeweiler georgeweiler changed the title fix(ramps): improve external-browser callback redirection fix(ramps): improve external-browser callback redirection cp-7.71.0 Mar 23, 2026
@georgeweiler georgeweiler added this pull request to the merge queue Mar 23, 2026
Merged via the queue into main with commit 4efb704 Mar 23, 2026
165 of 167 checks passed
@georgeweiler georgeweiler deleted the codex/ramps-callback-redirection branch March 23, 2026 20:35
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 23, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants