Commit 8d570c5
authored
fix(ramps-controller): remove nested widgetUrl field from Quote type (#7881)
## Explanation
During development of the quotes functionality in PR #7747, the
`widgetUrl` field was mistakenly added to the nested `quote.quote`
object when the API format was still being finalized. The API has since
been corrected to use a top-level `url` field instead.
This PR removes the incorrect nested structure before the quotes feature
is released.
## Changes
- Remove `widgetUrl` from the nested `quote.quote` object in the `Quote`
type
- Simplify `getWidgetUrl()` method to only check the top-level
`quote.url` field
- Update all test mocks to use the top-level `url` field instead of
nested `widgetUrl`
- Keep all provider metadata types (`ProviderType`, `ProviderFeatures`,
etc.) that were correctly added
## References
Related to PR #7747
tests:
https://github.com/user-attachments/assets/07e4ea98-6436-4613-b118-1fbcb92af185
https://github.com/user-attachments/assets/6bab6f39-e526-4e71-a9ef-450394eacd06
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Introduces a breaking async API and adds a network call in the
widget-launch path; failures or malformed responses now affect
redirect-provider flows and must be handled by consumers.
>
> **Overview**
> **BREAKING:** Changes `RampsController.getWidgetUrl()` from a
synchronous `quote.quote.widgetUrl` lookup to an async call that fetches
widget details from the `quote.quote.buyURL` endpoint via a new
`RampsService:getBuyWidgetUrl` messenger action.
>
> Extends `RampsService` with `getBuyWidgetUrl()` (with retry/policy
handling and response validation), updates the `Quote` type to replace
`widgetUrl` with `buyURL`, exports new `BuyWidget`/browser types and
action types, and updates/extends unit tests to cover success and
failure cases.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3a70d9e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent adafd9c commit 8d570c5
7 files changed
Lines changed: 268 additions & 26 deletions
File tree
- packages/ramps-controller
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
3686 | 3687 | | |
3687 | 3688 | | |
3688 | 3689 | | |
3689 | | - | |
3690 | 3690 | | |
3691 | 3691 | | |
3692 | 3692 | | |
| |||
5651 | 5651 | | |
5652 | 5652 | | |
5653 | 5653 | | |
5654 | | - | |
5655 | | - | |
| 5654 | + | |
| 5655 | + | |
5656 | 5656 | | |
5657 | | - | |
| 5657 | + | |
5658 | 5658 | | |
5659 | 5659 | | |
5660 | 5660 | | |
5661 | 5661 | | |
5662 | | - | |
| 5662 | + | |
| 5663 | + | |
5663 | 5664 | | |
5664 | 5665 | | |
5665 | 5666 | | |
5666 | | - | |
| 5667 | + | |
| 5668 | + | |
| 5669 | + | |
| 5670 | + | |
| 5671 | + | |
| 5672 | + | |
| 5673 | + | |
| 5674 | + | |
| 5675 | + | |
| 5676 | + | |
5667 | 5677 | | |
5668 | | - | |
| 5678 | + | |
5669 | 5679 | | |
5670 | 5680 | | |
5671 | 5681 | | |
5672 | | - | |
5673 | | - | |
| 5682 | + | |
| 5683 | + | |
5674 | 5684 | | |
5675 | 5685 | | |
5676 | 5686 | | |
| |||
5680 | 5690 | | |
5681 | 5691 | | |
5682 | 5692 | | |
5683 | | - | |
| 5693 | + | |
5684 | 5694 | | |
5685 | 5695 | | |
5686 | 5696 | | |
5687 | 5697 | | |
5688 | 5698 | | |
5689 | 5699 | | |
5690 | | - | |
| 5700 | + | |
5691 | 5701 | | |
5692 | 5702 | | |
5693 | 5703 | | |
5694 | 5704 | | |
5695 | | - | |
| 5705 | + | |
| 5706 | + | |
| 5707 | + | |
| 5708 | + | |
| 5709 | + | |
| 5710 | + | |
| 5711 | + | |
| 5712 | + | |
| 5713 | + | |
| 5714 | + | |
| 5715 | + | |
| 5716 | + | |
| 5717 | + | |
| 5718 | + | |
| 5719 | + | |
| 5720 | + | |
| 5721 | + | |
| 5722 | + | |
| 5723 | + | |
| 5724 | + | |
| 5725 | + | |
| 5726 | + | |
| 5727 | + | |
| 5728 | + | |
| 5729 | + | |
| 5730 | + | |
| 5731 | + | |
| 5732 | + | |
| 5733 | + | |
| 5734 | + | |
| 5735 | + | |
| 5736 | + | |
| 5737 | + | |
| 5738 | + | |
| 5739 | + | |
| 5740 | + | |
| 5741 | + | |
| 5742 | + | |
| 5743 | + | |
| 5744 | + | |
| 5745 | + | |
| 5746 | + | |
| 5747 | + | |
| 5748 | + | |
| 5749 | + | |
| 5750 | + | |
| 5751 | + | |
| 5752 | + | |
| 5753 | + | |
| 5754 | + | |
| 5755 | + | |
| 5756 | + | |
| 5757 | + | |
| 5758 | + | |
| 5759 | + | |
5696 | 5760 | | |
5697 | 5761 | | |
5698 | 5762 | | |
| |||
5820 | 5884 | | |
5821 | 5885 | | |
5822 | 5886 | | |
5823 | | - | |
| 5887 | + | |
| 5888 | + | |
5824 | 5889 | | |
5825 | 5890 | | |
5826 | 5891 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
322 | 324 | | |
323 | 325 | | |
324 | 326 | | |
325 | | - | |
| 327 | + | |
| 328 | + | |
326 | 329 | | |
327 | 330 | | |
328 | 331 | | |
| |||
1614 | 1617 | | |
1615 | 1618 | | |
1616 | 1619 | | |
1617 | | - | |
1618 | | - | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
1619 | 1623 | | |
1620 | | - | |
1621 | | - | |
| 1624 | + | |
| 1625 | + | |
1622 | 1626 | | |
1623 | | - | |
1624 | | - | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
1625 | 1643 | | |
1626 | 1644 | | |
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
| |||
105 | 118 | | |
106 | 119 | | |
107 | 120 | | |
108 | | - | |
| 121 | + | |
| 122 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1710 | 1710 | | |
1711 | 1711 | | |
1712 | 1712 | | |
1713 | | - | |
1714 | 1713 | | |
1715 | 1714 | | |
1716 | 1715 | | |
| |||
2250 | 2249 | | |
2251 | 2250 | | |
2252 | 2251 | | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
2253 | 2336 | | |
2254 | 2337 | | |
2255 | 2338 | | |
| |||
0 commit comments