fix(ramps-controller): compare internal order ids during order processing#9159
Merged
Conversation
Contributor
Author
|
@metamaskbot publish-previews |
2 tasks
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
3 tasks
roz0n
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes duplicate fiat-on-ramp Activity rows (TRAM-3539) when redirect providers (Moonpay, PayPal, Coinbase, etc.) return a provider-native id in
providerOrderIdwhile the precreated stub used MetaMask's internal order code (c-{guid}).Root cause:
RampsControllermerged orders onproviderOrderId. After precreate, stub and API/callback updates often disagree on that field even though they represent the same buy.Fix: Introduce
getInternalOrderCode()to derive the canonical code fromorder.id(/providers/{provider}/orders/{code}), then merge/heal inaddOrder,getOrder, andaddPrecreatedOrderon that key. StoredproviderOrderIdis normalized to the internal code so polling continues to usec-{guid}(supported by on-ramp-api → Moonpay/v1/transactions/ext/{code}).Changes
getInternalOrderCode()from@metamask/ramps-controllerproviderOrderIdproviderOrderId→ single merged row[Unreleased]→ FixedPreview build
@metamask-previews/ramps-controller@14.2.0-preview-589a499Related PRs
Out of scope
c-code)@metamask/ramps-controller(drop preview)Test plan
yarn workspace @metamask/ramps-controller run jest packages/ramps-controller/src/RampsController.test.ts(285 tests)Fixes TRAM-3539