#haoyee-webhook
1 messages ยท Page 1 of 1 (latest)
hi there! it depends on a lot of factors really, there are multiple types of events that can be sent a webhooks when making a payment.
depends how you make the payment and which events you are listening to as to what the best answer is. Do you have more context on what you've built so far for accepting payments?
cool! Then the payment details can be obtained by
- listening to that event
- getting the ID of the PaymentIntent in the session(event.data.object.payment_intent)
- retrieving that from the API https://stripe.com/docs/api/payment_intents/retrieve
- looking at intent.charges.data[0].payment_method_details https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card
cool, thanks
This step is only required if you plan to use any of the following payment methods: Bacs Direct Debit, Boleto, Canadian pre-authorized debits, OXXO, SEPA Direct Debit, SOFORT, or ACH Direct Debit.
So I need to disable these payment methods when creating checkout?
I wouldn't put it that way no
you always need webhooks (to listen to checkout.session.completed ). Some payment method (those ones) have async payment confirmation so for those you need the checkout.session.async_payment_succeeded event as well). The choice of payment methods is something you control (from https://dashboard.stripe.com/settings/payment_methods) and generally you should choose them based on what you want to offer and increase customer conversion instead of restricting them to simplify the backend integration
How do I know the webhook needs to handle the checkout.session.async_payment_succeeded event, depending on the payment method?
not sure I follow, can you clarify the question? are you asking how to know what payment method was used?
I want to know how the async_payment_succeeded event is judged in the code
judged by whom? In what code?
yes
?
sorry, you've completely lost me.
can you rephrase your question and ask again in detail please so I can try to help you?
How to know that there is a subsequent asynchronous event for an order
you could check the payment method type that was used when receiving the initial checkout.session.completed event(which is why I asked if that's what you meant)
by Bacs Direct Debit, Boleto, Canadian pre-authorized debits, OXXO, SEPA Direct Debit, SOFORT, or ACH Direct Debit ?
yes, you could check if the payment used one of those methods so then you know to expect a later async event
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
According to the above, you can help me match Bacs Direct Debit, Boleto, Canadian pre-authorized debits, OXXO, SEPA Direct Debit, SOFORT, or ACH Direct Debit
what do you mean? I think the enum is pretty easy, right?
like "Bacs Direct Debit" is bacs_debit , "Canadian pre-authorized debits" is acss_debit "SEPA Direct Debit" is sepa_debit
feel free to ask a more specific question if something is confusing
who should sofort match
sofort.
to know the type of payment method used in Checkout it's similar to the process above :
listening to that event
- getting the ID of the PaymentIntent in the session(event.data.object.payment_intent)
- retrieving that from the API https://stripe.com/docs/api/payment_intents/retrieve
- looking at intent.charges.data[0].payment_method_details.type https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-type
ACH Direct Debit
us_bank_account
Canadian pre-authorized debit
๐
hi here, who Canadian should pre-authorized debit match
I answered that above if you read up
it's acss_debit
the table tells you the exact mapping
Sorry, my damn English