Conversation
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.
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
The V2 API returns a different providerOrderId format (e.g. PayPal's numeric ID or null) than the ramps order code used as the lookup key. When getOrder merged the API response onto an existing order, the spread overwrote providerOrderId, breaking all subsequent lookups via getOrderById and causing blank Order Details screens. Always set providerOrderId to orderCode after the merge so the canonical lookup key is never lost. Made-with: Cursor
|
@cursoragent fix the linting issue |
|
Fixed the linting issue! The problem was a negated condition at line 1949 in Changed:
The linting now passes successfully, and I've committed and pushed the fix to the |
Co-authored-by: George Weiler <georgejweiler@gmail.com>
| if (!buyWidget?.url) { | ||
| return null; | ||
| } | ||
| return buyWidget; |
There was a problem hiding this comment.
breaking: we are now returning both the URL and the extra data such as the supported browser type and custom order ID.


Explanation
Introduces controller API support for custom-action ramp flows (e.g., PayPal).
What changed:
getBuyWidgetData(quote)— ReplacesgetWidgetUrl. ReturnsBuyWidget | null(url, optionalbrowser, optionalorderId) instead ofstring | null. Returnsnullwhen fetch fails or no URL is available.addPrecreatedOrder(params)— New method accepting{ orderId, providerCode, walletAddress, chainId? }. Parses order IDs (including/orders/path format), normalizesproviderCode(strips/providers/prefix), and inserts a stubRampsOrderinPrecreatedstatus for existing polling to hydrate.What stays untouched: Existing controller state shape, polling behavior, and other order flows remain unchanged aside from the new API surface.
Dependencies: None in core; mobile and extension consume these changes.
References
Checklist
Note
Medium Risk
Medium risk due to a breaking public API change (
getWidgetUrl->getBuyWidgetData) and new order-state mutations (addPrecreatedOrder,getOrdernow inserts missing orders) that can affect ramp UI/polling behavior for consumers.Overview
BREAKING: Replaces
getWidgetUrlwithgetBuyWidgetData, returning aBuyWidget | null(includingbrowser/orderId) and now propagating service-call errors instead of swallowing them.Adds
addPrecreatedOrderto register a provider order ID (parsing/orders/IDs and normalizing provider codes) by inserting a stubRampsOrderinPrecreatedstatus so existing polling can hydrate it, and updatesgetOrderto push the order into state when it isn’t already present.Exports
normalizeProviderCode, updates tests to cover the new APIs/edge cases, and documents the breaking change in the changelog.Written by Cursor Bugbot for commit 64885db. This will update automatically on new commits. Configure here.