#lukez_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1287657603090092053
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, it really depends. For example, if a checkout session is completed with a ACH direct debit payment, you'll receive a checkout.session.completed event immediately, but you may receive a payment_intent_succeeded event a few days later when ACH network informs Stripe the payment result
okay and what about charge.succeeded?
In this case, it'll be fired at the same time as payment_intent.succeeded
ah okay.
because this is what the code uses I'm using.
So it is recommended to show the user a "charge pending" state as long as no charge.succeeded event is received. Right?
What do you want to achieve?
a subscription for my Discord bot. And I create checkout sessions with metadata for identification and receive the events via webhook.
As far as I've understood it, I get checkout.session.completed when the user finishes the checkout session and a charge.succeeded event later.
That's for payment method that can be confirmed immediately (i.e., card)
what do you mean by that and what are you referring to?
OK, the payment result of some payment method (like card) can be confirmed immediately, and that's why you receives checkout.session.completed and charge.succeeded almost at the same time.
oh
so I should listen to payment_intent.succeeded instead to verify that a user has definitely paid an amount?
Either payment_intent.succeeded or charge.succeeded
oh okay
oh, btw. I'm not working with payment intents, I'm just working with checkout sessions. So I think I'll stick to charge.succeeded
As far as I understand, a payment intent is usually used when working with a front-end website or when having one-time charges with varying amounts, but I'm using pre-defined products.
Am I right here?
Under the hood, the checkout session automatically creates a payment_intent, and payment_intent creates a charge object, that's why you receive charge.succeeded and payment_intent.succeeded events