Skip to content

Commit 0ef166f

Browse files
authored
feat: add useTestClock param when starting subscription (#7129)
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> Subscription controller add `useTestClock` param to `StartSubscriptionRequest`, `StartCryptoSubscriptionRequest`, `CachedLastSelectedPaymentMethod` ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] 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/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds optional `useTestClock` to `StartSubscriptionRequest`, `StartCryptoSubscriptionRequest`, and `CachedLastSelectedPaymentMethod`. > > - **Types**: > - Add optional `useTestClock` to `StartSubscriptionRequest` and `StartCryptoSubscriptionRequest` in `packages/subscription-controller/src/types.ts`. > - Add optional `useTestClock` to `CachedLastSelectedPaymentMethod`. > - **Docs**: > - Update `packages/subscription-controller/CHANGELOG.md` under Unreleased Added section to note new `useTestClock` params. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f9ec0a8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 0237263 commit 0ef166f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/subscription-controller/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- added `useTestClock` param to `StartSubscriptionRequest`, `StartCryptoSubscriptionRequest`, `CachedLastSelectedPaymentMethod` ([#7129](https://github.com/MetaMask/core/pull/7129))
13+
1014
### Changed
1115

1216
- Bump `@metamask/transaction-controller` from `^61.1.0` to `^61.2.0` ([#7126](https://github.com/MetaMask/core/pull/7126))

packages/subscription-controller/src/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export type StartSubscriptionRequest = {
132132
isTrialRequested: boolean;
133133
recurringInterval: RecurringInterval;
134134
successUrl?: string;
135+
useTestClock?: boolean;
135136
};
136137

137138
export type StartSubscriptionResponse = {
@@ -151,6 +152,7 @@ export type StartCryptoSubscriptionRequest = {
151152
tokenSymbol: string;
152153
rawTransaction: Hex;
153154
isSponsored?: boolean;
155+
useTestClock?: boolean;
154156
};
155157

156158
export type StartCryptoSubscriptionResponse = {
@@ -416,4 +418,5 @@ export type CachedLastSelectedPaymentMethod = {
416418
paymentTokenAddress?: Hex;
417419
paymentTokenSymbol?: string;
418420
plan: RecurringInterval;
421+
useTestClock?: boolean;
419422
};

0 commit comments

Comments
 (0)