Skip to content

fix(payments-next): use pending_setup_intent#20530

Draft
StaberindeZA wants to merge 1 commit intomainfrom
fix-use-pending-setup-intent
Draft

fix(payments-next): use pending_setup_intent#20530
StaberindeZA wants to merge 1 commit intomainfrom
fix-use-pending-setup-intent

Conversation

@StaberindeZA
Copy link
Copy Markdown
Contributor

Because

  • Checkout for zero invoice amount currently always creates and confirms a new setup intent, instead of using the pending setup intent on the subscription.

This pull request

  • When available, confirm the pending setup intent on the newly created subscription.

Issue that this pull request solves

Closes: (issue number)

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)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Any other information that is important to this pull request.

Copilot AI review requested due to automatic review settings May 6, 2026 19:37
@StaberindeZA StaberindeZA requested a review from a team as a code owner May 6, 2026 19:37
@StaberindeZA StaberindeZA marked this pull request as draft May 6, 2026 19:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Stripe checkout flow for zero-amount invoices so that, when a newly created subscription includes a pending_setup_intent, the system confirms that existing setup intent instead of always creating and confirming a new one. This aligns the checkout behavior with Stripe’s subscription state and avoids redundant setup intent creation.

Changes:

  • Add StripeClient.setupIntentConfirm() and expose it via SetupIntentManager.confirm().
  • Update CheckoutService to confirm subscription.pending_setup_intent when present (instead of creating a new setup intent).
  • Minor formatting-only changes (line wrapping / lint) in a few places.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
libs/payments/stripe/src/lib/stripe.client.ts Adds a Stripe client wrapper for confirming an existing SetupIntent.
libs/payments/customer/src/lib/setupIntent.manager.ts Adds a manager method to confirm a SetupIntent with a confirmation token.
libs/payments/cart/src/lib/checkout.service.ts Uses pending_setup_intent on the subscription to drive setup intent confirmation path during checkout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/payments/cart/src/lib/checkout.service.ts Outdated
Comment thread libs/payments/cart/src/lib/checkout.service.ts
Comment thread libs/payments/customer/src/lib/setupIntent.manager.ts
Because:

* Checkout for zero invoice amount currently always creates and confirms a new
  setup intent, instead of using the pending setup intent on the subscription.

This commit:

* When available, confirm the pending setup intent on the newly created
  subscription.

Closes #PAY-3696
@StaberindeZA StaberindeZA force-pushed the fix-use-pending-setup-intent branch from c9dca03 to da2dea4 Compare May 7, 2026 14:36
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.

2 participants