Skip to content

fix: for postquote payments payment token for MM Pay transaction should not be reset when accountOverride is changed#8787

Merged
jpuri merged 2 commits into
mainfrom
withdraw_payment_token_fix
May 13, 2026
Merged

fix: for postquote payments payment token for MM Pay transaction should not be reset when accountOverride is changed#8787
jpuri merged 2 commits into
mainfrom
withdraw_payment_token_fix

Conversation

@jpuri
Copy link
Copy Markdown
Contributor

@jpuri jpuri commented May 13, 2026

Explanation

For postquote payments payment token for MM Pay transaction should not be reset when accountOverride is changed. This is ensure on UI token selection is not reset when account selection is changes.

References

Related to https://consensyssoftware.atlassian.net/browse/CONF-1381

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Low risk: small conditional change to when paymentToken is cleared, limited to post-quote flows and covered by a new unit test.

Overview
Prevents TransactionPayController.setTransactionConfig from clearing transactionData.paymentToken when accountOverride changes in post-quote flows (isPostQuote: true), avoiding UI token selection resets.

Adds a regression test covering the new behavior, and documents the fix in CHANGELOG.md.

Reviewed by Cursor Bugbot for commit 6811719. Bugbot is set up for automated code reviews on this repo. Configure here.

…ld not be reset when accountOverride is changed
@jpuri jpuri requested a review from a team as a code owner May 13, 2026 10:31
@jpuri jpuri temporarily deployed to default-branch May 13, 2026 10:32 — with GitHub Actions Inactive
@jpuri jpuri requested a review from a team as a code owner May 13, 2026 10:32
@jpuri jpuri enabled auto-merge May 13, 2026 10:32
@jpuri jpuri added this pull request to the merge queue May 13, 2026
Merged via the queue into main with commit bb02c0c May 13, 2026
366 checks passed
@jpuri jpuri deleted the withdraw_payment_token_fix branch May 13, 2026 10:44
@OGPoyraz OGPoyraz mentioned this pull request May 13, 2026
4 tasks
pull Bot pushed a commit to Reality2byte/core that referenced this pull request May 13, 2026
## Explanation

Release `980.0.0` with minor version bumps for:

- **`@metamask/transaction-controller`** `65.3.0` → `65.4.0`
- **`@metamask/transaction-pay-controller`** `22.3.1` → `22.4.0`

### `@metamask/transaction-controller@65.4.0`

#### Added
- Add optional `fiat` object (with `orderId` and `provider` properties)
to `MetamaskPayMetadata` type for persisting fiat on-ramp order data on
transactions
- Add `predictAcrossWithdraw` to the `TransactionType` enum

#### Changed
- `estimateGasBatch` now falls back to the sum of per-tx `gas` values in
the EIP-7702 path when node simulation fails, instead of returning the
block-gas-limit fallback
- Bump `@metamask/network-controller` from `^31.0.0` to `^32.0.0`
- Bump `@metamask/accounts-controller` from `^38.1.0` to `^38.1.1`
- Bump `@metamask/controller-utils` from `^12.0.0` to `^12.1.0`

### `@metamask/transaction-pay-controller@22.4.0`

#### Added
- Add Across quote support for post-quote Predict withdraw flows

#### Changed
- Derive fiat order source amount from on-chain transaction data
(`order.txHash`) with fallback to `order.cryptoAmount`
- Persist fiat order ID and provider code on `transaction.metamaskPay`
before polling, so activity views can query order status after
controller state cleanup
- Bump `@metamask/assets-controller` from `^7.1.1` to `^7.1.2`
- Bump `@metamask/assets-controllers` from `^108.0.0` to `^108.1.0`

#### Fixed
- For postquote payments payment token for MM Pay transaction should not
be reset when accountOverride is changed

### Dependency updates

14 packages had their `@metamask/transaction-controller` dependency
range updated from `^65.3.0` to `^65.4.0` with corresponding changelog
entries under `[Unreleased]`:
- `@metamask/assets-controller`
- `@metamask/assets-controllers`
- `@metamask/bridge-controller`
- `@metamask/bridge-status-controller`
- `@metamask/earn-controller`
- `@metamask/eip-5792-middleware`
- `@metamask/gator-permissions-controller`
- `@metamask/network-enablement-controller`
- `@metamask/perps-controller`
- `@metamask/phishing-controller`
- `@metamask/profile-metrics-controller`
- `@metamask/shield-controller`
- `@metamask/subscription-controller`
- `@metamask/user-operation-controller`

## References

- [MetaMask#8694](MetaMask#8694) — Add fiat on-ramp
order data persistence on transactions
- [MetaMask#8759](MetaMask#8759) — Add
`predictAcrossWithdraw` transaction type
- [MetaMask#8735](MetaMask#8735) — EIP-7702 gas
estimation fallback improvements
- [MetaMask#8760](MetaMask#8760) — Across quote
support for post-quote Predict withdraw
- [MetaMask#8787](MetaMask#8787) — Fix payment
token reset on accountOverride change

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Mainly a release/version bump, but it pulls in updated
`@metamask/transaction-controller` behavior (gas estimation fallback,
new metadata/type fields) across many dependent controllers, which could
affect transaction handling paths.
> 
> **Overview**
> Bumps the monorepo release to `980.0.0`, publishes
`@metamask/transaction-controller@65.4.0`, and publishes
`@metamask/transaction-pay-controller@22.4.0` (with corresponding
changelog link updates).
> 
> Propagates the `@metamask/transaction-controller` dependency range
from `^65.3.0` to `^65.4.0` across multiple packages (e.g.
assets/bridge/network-enablement/perps/phishing/shield/subscription/user-operation
controllers) and records the bumps in each package’s `[Unreleased]`
changelog entries, with `yarn.lock` updates to match.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
699b516. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants