fix(payments-next): use pending_setup_intent#20530
Draft
StaberindeZA wants to merge 1 commit intomainfrom
Draft
Conversation
Contributor
There was a problem hiding this comment.
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 viaSetupIntentManager.confirm(). - Update
CheckoutServiceto confirmsubscription.pending_setup_intentwhen 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.
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
c9dca03 to
da2dea4
Compare
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.
Because
This pull request
Issue that this pull request solves
Closes: (issue number)
Checklist
Put an
xin the boxes that applyHow to review (Optional)
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.