Commit 6bb27e9
authored
refactor(ramp): remove checkout callback registry from unified Checkout (#28417)
## **Description**
Removes the **`checkoutCallbackRegistry`** indirection from the unified
Ramp [`Checkout`](app/components/UI/Ramp/Views/Checkout/Checkout.tsx)
screen and
[`useTransakRouting`](app/components/UI/Ramp/hooks/useTransakRouting.ts)
(Transak buy flow). Handlers are passed as **`onNavigationStateChange`**
on Checkout route params;
[`Checkout`](app/components/UI/Ramp/Views/Checkout/Checkout.tsx) applies
URL de-duplication before invoking that callback. The registry module
and its unit tests are deleted.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Refs:
## **Manual testing steps**
```gherkin
Feature: Transak buy payment webview
Scenario: User opens Checkout after KYC approved
Given user completes Transak flow until the unified Checkout WebView opens
When the provider redirects through the expected success or callback URL
Then order handling and navigation behave as before
```
## **Screenshots/Recordings**
Not applicable — wiring-only change.
### **Before**
N/A
### **After**
https://github.com/user-attachments/assets/e16f92bf-ed0e-459a-9005-90ff8dadc489
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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.
## **Labels note**
This PR sets **CHANGELOG entry: null**. If your release or CI workflow
expects it, add the `no-changelog` label on GitHub (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
`team-money-movement` may already be applied by automation. Add
`team-ramps` if that better matches ownership for Ramp /
`app/components/UI/Ramp` changes.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes how the Checkout WebView callback is wired (route param
function instead of registry) and adds URL de-duplication, which could
affect provider redirect handling if any callers relied on the old
callbackKey behavior.
>
> **Overview**
> Removes the `checkoutCallbackRegistry` indirection and deletes its
implementation/tests, switching Checkout callback wiring to pass an
`onNavigationStateChange` handler directly via Checkout route params.
>
> Updates `Checkout` to invoke that param callback only after URL
de-duplication (while keeping the existing callback flow for
`providerCode`/`walletAddress`), and updates `useTransakRouting` and
related tests to use the new param-based callback.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
abb4c3f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 86b6748 commit 6bb27e9
File tree
6 files changed
+22
-151
lines changed- app/components/UI/Ramp
- Views/Checkout
- hooks
- utils
6 files changed
+22
-151
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 6 | | |
11 | 7 | | |
12 | 8 | | |
| |||
352 | 348 | | |
353 | 349 | | |
354 | 350 | | |
355 | | - | |
356 | | - | |
| 351 | + | |
| 352 | + | |
357 | 353 | | |
358 | | - | |
359 | 354 | | |
360 | 355 | | |
361 | 356 | | |
362 | 357 | | |
363 | | - | |
| 358 | + | |
364 | 359 | | |
365 | 360 | | |
366 | 361 | | |
| |||
374 | 369 | | |
375 | 370 | | |
376 | 371 | | |
377 | | - | |
378 | | - | |
379 | 372 | | |
380 | 373 | | |
381 | 374 | | |
382 | 375 | | |
383 | | - | |
384 | 376 | | |
385 | 377 | | |
386 | 378 | | |
387 | 379 | | |
388 | | - | |
| 380 | + | |
389 | 381 | | |
390 | 382 | | |
391 | 383 | | |
| |||
396 | 388 | | |
397 | 389 | | |
398 | 390 | | |
399 | | - | |
400 | | - | |
401 | 391 | | |
402 | 392 | | |
403 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
| |||
59 | 55 | | |
60 | 56 | | |
61 | 57 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 58 | + | |
68 | 59 | | |
69 | 60 | | |
70 | 61 | | |
| |||
99 | 90 | | |
100 | 91 | | |
101 | 92 | | |
102 | | - | |
103 | 93 | | |
104 | 94 | | |
105 | 95 | | |
106 | 96 | | |
107 | | - | |
108 | 97 | | |
109 | 98 | | |
110 | 99 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 100 | | |
121 | 101 | | |
122 | 102 | | |
| |||
291 | 271 | | |
292 | 272 | | |
293 | 273 | | |
294 | | - | |
295 | | - | |
296 | | - | |
| 274 | + | |
297 | 275 | | |
298 | 276 | | |
299 | | - | |
| 277 | + | |
300 | 278 | | |
301 | 279 | | |
302 | 280 | | |
| |||
380 | 358 | | |
381 | 359 | | |
382 | 360 | | |
383 | | - | |
| 361 | + | |
384 | 362 | | |
385 | | - | |
| 363 | + | |
386 | 364 | | |
387 | 365 | | |
388 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
143 | | - | |
| 147 | + | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
160 | 155 | | |
161 | 156 | | |
162 | 157 | | |
| |||
188 | 183 | | |
189 | 184 | | |
190 | 185 | | |
| 186 | + | |
191 | 187 | | |
192 | 188 | | |
193 | 189 | | |
| |||
299 | 295 | | |
300 | 296 | | |
301 | 297 | | |
| 298 | + | |
302 | 299 | | |
303 | 300 | | |
304 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | | - | |
| 51 | + | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
357 | 356 | | |
358 | 357 | | |
359 | 358 | | |
360 | | - | |
361 | 359 | | |
362 | 360 | | |
363 | 361 | | |
364 | | - | |
| 362 | + | |
365 | 363 | | |
366 | 364 | | |
367 | 365 | | |
| |||
Lines changed: 0 additions & 68 deletions
This file was deleted.
This file was deleted.
0 commit comments