#Dkango

1 messages · Page 1 of 1 (latest)

fast arrowBOT
silent hill
#

It's the checkout.session.completed event

analog pulsar
#

Thank you. Can I please still ask my question as I have some conflicting readings by reading the documents?

#

I have a question with respect to the types of webhooks I receive when a Payment Link is processed by a client of my software. The mention of Invoice, in this question refers to the Invoices I create in my own software and not the Stripe Invoice Object. Consider it a PDF Invoice form for simplicity with a link to pay it online using a PaymentLink that I create from Stripe.
Every invoice in my application is issued a PaymentLink when it is created and the PaymentLinkID is stored with the Invoice. This is how I’d associate a Stripe Payment Link to an Invoice in my system and I then send this Payment Link to the Client in an email and it is also a link in the Invoice PDF itself. When the client pays the Invoice, I listen to webhooks in order to inform the project managers and accounts in the system and send receipts to the client etc. I’ve opened my webhook received to many types of the webhooks while I’m developing and I know that I receive the following webhooks when a payment by card happens on a Payment Link and I’ve mentioned the references that the Data node of these webhooks provide to help me associate these webhooks with an Invoice in my system;

#

payment_intent.succeeded (The object ID is the PaymentIntentID which is referenced in the checkout.session.completed object below)
charge.succeeded (No Useful Reference)
application_fee.created (No Useful Reference)
payment_intent.created (No Useful Reference)
checkout.session.completed (has a reference to the PaymentLinkID and PaymentIntentID above)
Based on above, the only useful webhook that I can listen to in order to determine if a payment associated with an Invoice in my system has been processed would be checkout.session.completed webhook.

#

On the other hand, the only webhook that gives me solid confirmation that the payment is collected is payment_intent.succeeded webhook which comes after the checkout.session.completed webhook.
I also have this article in the support section
https://stripe.com/docs/payments/checkout/fulfill-orders#delayed-notification
which says after the checkout.session.completed is received I should wait for payment_intent.succeeded before fulfilling the order.
On the other hand, by reading the following discussion
https://stackoverflow.com/questions/72165704/stripe-checkout-webhook-which-event-to-listen-for
it is suggested that if I only use card payments (and I assume Google Pay and Apple Pay as well), then relying on the checkout.session.completed only can be considered a safe assumption of payment.

Learn how to fulfill orders after a customer pays with Stripe Checkout or Stripe Payment Links.

#

Based on this background, here are my questions;
1- When I receive a checkout.session.completed webhook, does this mean that I can safely assume a payment is successfully processed and the funds are available and being set for transfer into the connected account? I use card payments and Google and Apple Pay methods.
2- If the answer to question 1 is negative, then I assume the only certain webhook to listen to would be payment_intent.succeeded as it has confirmed fields that the payment is received and details about the payment method etc. Please confirm or correct me if otherwise. This event happens after the checkout.session.completed but in a very short timeframe, like a second later so I can’t count on the fact that I’d already have stored a checkout.session.completed event in my database when the payment_intent.succeeded arrives. Is there a way to find the PaymentLinkID of the invoice from the payment_intent.succeeded json object itself by using it to pull the PaymentLinkID of the Payment Link that originated the checkout? Like by referencing a chain of objects leading to it?
3- Finally, I’m a new developer so if I’m doing it wrong from the base, since this is my first experience with Stripe as well, please guide me to the right direction.

#

Sorry for the long message. I just want to be comprehensive

silent hill
#

Hey, gimme some times to read through...

analog pulsar
#

Thank you very much. No rush

silent hill
#
  1. Yes, as you only use card
  2. N/A
  3. Np and you are doing it great!
analog pulsar
#

Many thanks. It is so reassuring to know I'm on the correct path. Have a wonderful day and stay safe 😇