-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SetupIntents and skipping the confirm step for PaymentIntents #203
Conversation
That's nothing short of astounding, folks! Superb work! I still need to go through the code, but the flow looks very consistent. I hope the authorization prompts are also consistent (:crossed_fingers:, I think they will), and I look forward to hearing your ideas for the guest checkout flow. The incoming webhooks are what you could expect: no surprises! First successful checkout
Subsequent successful checkout with the same source
Setup failure (using the same source, tested with card 4000000000000002)
Payment failure (using the same source, tested with card 4100000000000019)
I'm pretty sure you're aware of at least some of the following mostly minor issues that we need to address if we can settle it as the path forward:
I also tried to go back from the |
As discussed offline, |
Yes, and that's what's happened with every other payment method (unless I'm missing something). One good thing is that at least the Stripe form states what's happening very clearly. BTW I imagine this to be an issue with guest checkouts only, and in that case we could explore deleting the setup intent after the checkout is placed (if we still have the ability to capture/void via admin using the payment intent generated at confirm) |
Pave the way to using it for both payment and setup intents. Co-Authored-By: Elia Schito <elia@schito.me> Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Allow each payment method to pick which flow to use. Co-Authored-By: Elia Schito <elia@schito.me> Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Co-Authored-By: Marc Busqué <marc@lamarciana.com> Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Co-Authored-By: Marc Busqué <marc@lamarciana.com> Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
…t intents Pave the way for future refactorings. Co-Authored-By: Marc Busqué <marc@lamarciana.com> Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
No longer use the payment as the connection point. Co-Authored-By: Marc Busqué <marc@lamarciana.com> Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Co-Authored-By: Marc Busqué <marc@lamarciana.com> Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Co-Authored-By: Marc Busqué <marc@lamarciana.com> Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
98eeda5
to
8064f1c
Compare
Recap after another pairing session: Guest checkout through setup intentWe implemented the guest checkout flow through setup intents by creating a Stripe customer with the order email and the number as a reference in its metadata fields. It worked. However, we didn't try to remove the created setup intent. That means that it's possible to charge the customer afterward from the Stripe dashboard: That doesn't happen when charged through a payment intent (when you try to create a payment for the same customer, you're forced to enter a new card): Besides, Stripe renders a notice message that will be confusing even if we manage to remove the setup intent: Another important issue is that some bank-associated payment methods are designed as one-off payments (Sofort, Ideal...), but Stripe translates them into SEPA Debit authorizations when used through a setup intent. There're two major issues with that:
Configurable flow: setup intent vs. payment intentBecause of the problems abovementioned, we're now supporting both flows: setup intent and payment intent. Users can choose which one they use through the Squashing
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a self approval… because it is! 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@elia, @rainerdema, @kennyadsl, I added another commit to prove that we can implement guest checkout through setup intents without opening gates to future charges. It's more of a workaround for Stripe's semantics for a setup intent, but it can be done. Some considerations:
|
@waiting-for-dev that's great, super quick and simple, given the specs are red, would you prefer to fix them here or would be ok to merge and have a dedicated PR for this feature? |
e8e4d85
to
8064f1c
Compare
As discussed offline, we'll defer that for later and, for now, we'll be clear in the README |
Summary
Checkout specs covering the happy path for each case have been added, this should avoid regression and demonstrate the expected flows.
Authors
@kennyadsl @elia @rainerdema @waiting-for-dev
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: