#rzahng-Webhook

1 messages · Page 1 of 1 (latest)

ripe minnow
#

Hi there, Checkout Session will implicitly create a PaymentIntent under the hood. Therefore when a checkout session using a delayed payment method finally succeeds, both checkout.session.async_payment_succeeded and payment_intent.succeeded are fired.

broken pond
#

cool! Also say the user used credit card to pay. Since credit card is instant, will it still fire checkout.session.completed and checkout.session.async_payment_succeeded in that order?

ripe minnow
#

it will fire checkout.session.completed and payment_intent.succeeded. It won't fire checkout.session.async_payment_succeeded because credit card is not a delayed payment method.

In addition, Stripe does not guarantee delivery of events in the order in which they are generated. see https://stripe.com/docs/webhooks/best-practices#event-ordering

broken pond
#

i see, since paymentintent has sort of all the events that checkout.session has, do u recommend that I just catch payment intent events?

ripe minnow
#

It really depends on your business. If you only care about the payment result then you can just listen to payment_intent related webhook events.

broken pond
#

is there a payment intent equivalent of checkout.session.completed?

ripe minnow
#

checkout.session.completed means the checkout session is completed. However it doesn't always guarantee that the payment is succeeded. For immediate payment method (i.e., card) the payment is succeeded when the checkout session is completed, but for delayed payment method, the payment is still pending when checkout session is completed .
payment_intent.succeeded means the payment is succeeded regardless of the payment method type.

broken pond
#

gotcha, thanks! When we create a session or a payment intent, how do we identify the buyer who is purchasing the items?

ripe minnow
#

You can pass in a customer param to associate this checkout session.

broken pond
#

ok i see thanks, so we are trying to make a marketplace that enables buyer initiated offers, meaning the buyer has the ability to set a price for the seller, and seller can choose which offer to pick. Does paymentIntent work for this use case? I just dont know how can a buyer input their payment information where it will not be processed until the supplier accepts the offer

ripe minnow
#

You can use setup mode Checkout Session to collect the payment details from customers without charging them.

#

Once the supplier has accepted the offer, you can use PaymentIntent API to perform an off_session charge.

#

Also you might be interested in Stripe Connect, so that you can register your suppliers as connected accounts and manage the payouts.

broken pond
#

yes we plan to give sellers connect accounts, but where can ifind the setup mode?

ripe minnow
broken pond
#

gotcha thanks!

ripe minnow
broken pond
#

how does checkout session work for setup? Once we execute stripe.checkout.sessions.create, does it redirect user to a url to enter payment information? Once user enters info, does it fire checkout.session.completed?

#

Also, whats the paymentIntent API to execute an off_session charge?

ripe minnow
broken pond
#

how do we link the setupIntent with the paymentIntent when creating paymentIntent?

ripe minnow
#

You should get the payment_method from the setupIntent and use it to create the paymentIntent

broken pond
#

i see thanks, and when we create a session, it does not create a payment intent?

ripe minnow
#

it depends on the checkout session mode, if it's setup, a SetupIntent will be created under the hood

broken pond
#

i see thanks! One more thing: I read this under sessions object: "For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the payment flow". How can we create a customer object for setup mode?

ripe minnow
#

You need to create a customer first and pass the customer to the checkout session creation API call.