feat(ramps): open order details immediately after UB2 webview callbacks#29623
feat(ramps): open order details immediately after UB2 webview callbacks#29623
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. |
- Views/Checkout: reset to RampsOrderDetails with callbackUrl + provider params instead of awaiting getOrderFromCallback in the WebView sheet. - useTransakRouting: same pattern for Transak payment webview redirects (delegate fetch to OrderDetails). - OrderDetails: show V2 order toast after callback fetch; optional cryptocurrency route param for toast fallback; status metrics on callback resolution. - rampsNavigation: document optional cryptocurrency on order details params. Tests: Checkout, OrderDetails, useTransakRouting. Co-authored-by: Cursor <cursoragent@cursor.com>
0124e2a to
adb6c97
Compare
…k tests Co-authored-by: Cursor <cursoragent@cursor.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The E2E test This is a medium-risk change because:
No performance tests are needed as these changes are purely about navigation flow and order resolution logic, not UI rendering performance. Performance Test Selection: |
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.
Reviewed by Cursor Bugbot for commit 0a9a2cc. Configure here.
| fetchError instanceof Error && fetchError.message | ||
| ? fetchError.message | ||
| normalizedError.message | ||
| ? normalizedError.message |
There was a problem hiding this comment.
Error normalization can show raw strings to users
Low Severity
The error normalization in executeCallbackFetch wraps non-Error values via new Error(String(fetchError)), making normalizedError.message truthy for almost all non-Error exceptions (e.g., String(undefined) → "undefined", String({}) → "[object Object]"). This means the localized fallback at line 152–153 is nearly unreachable for non-Error values, and users could see raw strings like "undefined" or "[object Object]" as error messages. The sibling handleOnRefresh handler (line 232) correctly guards with fetchError instanceof Error && fetchError.message before showing the raw message, falling back to the localized string for all non-Error exceptions.
Reviewed by Cursor Bugbot for commit 0a9a2cc. Configure here.
|





Description
This PR improves the unified buy (UB2) checkout flow when purchasing via Transak in the WebView: after a successful checkout, the app navigates immediately to Ramps Order Details using callback URL parameters instead of leaving the user on a generic or stale screen.
Order Details now resolves the order from those callback params, surfaces the outcome with a toast, and records metrics so we can observe completion and errors in production.
Motivation: Users should land on a clear, order-specific screen right after Transak completes, with consistent feedback and observability aligned with other ramps flows.
Changelog
CHANGELOG entry: After completing a Transak purchase in unified buy, the app now opens Ramps Order Details with the order resolved from the callback, a confirmation toast, and updated metrics.
Related issues
Fixes: TRAM-3540
Manual testing steps
Screenshots/Recordings
Before
Simulator.Screen.Recording.-.Dev1.-.2026-05-01.at.15.24.41.mov
After
Simulator.Screen.Recording.-.Dev1.-.2026-05-01.at.15.14.26.mov
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes unified-buy checkout and Transak WebView redirect handling to navigate immediately to
RAMPS_ORDER_DETAILSand shift callback order resolution/toast+metrics intoOrderDetails, which could affect post-checkout navigation and error handling.Overview
Unified buy WebView callback handling now exits the WebView immediately and resets navigation to
RAMPS_ORDER_DETAILSusingcallbackUrl/providerCode/walletAddressparams (optionally passingcryptocurrency), rather than fetching the order insideCheckout/routing hooks.OrderDetailsnow owns resolving the order from callback params, including showing the v2 order toast, emitting status-change analytics viahandleOrderStatusChangedForMetrics, handling bailed/empty callback results by resetting back toBUILD_QUOTE, and normalizing non-Errorrejections to a localized error message. Tests were updated accordingly.Reviewed by Cursor Bugbot for commit 0a9a2cc. Bugbot is set up for automated code reviews on this repo. Configure here.