Skip to content

fix(payments-next): Block new customers from checking out for free trial with prepaid card#20419

Merged
elizabeth-ilina merged 1 commit intomainfrom
PAY-3661-block-new-customers-from-checking-out-for-free-trial-with-prepaid-card
Apr 22, 2026
Merged

fix(payments-next): Block new customers from checking out for free trial with prepaid card#20419
elizabeth-ilina merged 1 commit intomainfrom
PAY-3661-block-new-customers-from-checking-out-for-free-trial-with-prepaid-card

Conversation

@elizabeth-ilina
Copy link
Copy Markdown
Contributor

@elizabeth-ilina elizabeth-ilina commented Apr 21, 2026

Because

  • We want to block newly created account (< 24 hours) who are using a prepaid card to start a free trial.

This pull request

  • Implements the above and shows user an informative message.
  • Note: I was originally planning to check the confirmation token in the CheckoutForm component and send a boolean to checkoutCartWithStripe, but decided it might be a better idea to get the confirmationToken in checkout service, since we already have the confirmationTokenId available. Please let me know if the former is a better idea.

Issue that this pull request solves

Closes #PAY-3661

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

Checking out with new prepaid card:

prepaid-new-blocked.mov

Checking out with saved prepaid card:

prepaid-saved-blocked.mov

Other information (Optional)

Any other information that is important to this pull request.

@elizabeth-ilina elizabeth-ilina force-pushed the PAY-3661-block-new-customers-from-checking-out-for-free-trial-with-prepaid-card branch 3 times, most recently from e3a52bd to 6e771f4 Compare April 21, 2026 18:31
@elizabeth-ilina elizabeth-ilina marked this pull request as ready for review April 21, 2026 18:47
@elizabeth-ilina elizabeth-ilina requested review from a team as code owners April 21, 2026 18:47
@elizabeth-ilina elizabeth-ilina force-pushed the PAY-3661-block-new-customers-from-checking-out-for-free-trial-with-prepaid-card branch 2 times, most recently from f3776fb to 7c85cbd Compare April 22, 2026 13:52
new PayWithStripeNullCurrencyError(cart.id, price.id)
);

if (freeTrial && Date.now() - accountCreatedAt < 24 * 60 * 60 * 1000) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we pull 24 out of here and have it be a constant. FREE_TRIAL_PREPAID_CARD_BLOCKED_HOURS

…ial with prepaid card

Because:

* We want to block newly created account (< 24 hours) who are using a prepaid card to start a free trial.

This commit:

* Implements the above and shows user an informative message.

Closes #[PAY-3661](https://mozilla-hub.atlassian.net/browse/PAY-3661)
@elizabeth-ilina elizabeth-ilina force-pushed the PAY-3661-block-new-customers-from-checking-out-for-free-trial-with-prepaid-card branch from 7c85cbd to 2a79209 Compare April 22, 2026 15:54
@elizabeth-ilina elizabeth-ilina merged commit 30933ba into main Apr 22, 2026
21 checks passed
@elizabeth-ilina elizabeth-ilina deleted the PAY-3661-block-new-customers-from-checking-out-for-free-trial-with-prepaid-card branch April 22, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants