#yagnesh-p_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/1382036701022654680
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
The payment Intent will only be there in Payment mode: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-payment_intent
In subscription mode, you'd retrieve the Invoice look at payments.data.payment.payment_intent to get the Payment Intent ID.
and to get the checkout-session i have to use that paymet_intent right?
I am just trying to get payment_intent in the checkout session because I am creating business logic depends on checkout session.
Since it is not available in subscription mode, I have to retrieve it using the Stripe.Checkout.Session API call, by passing the payment_intent.
Why are you creating business logic that depends on the Checkout Session?
Or rather: what exactly are you trying to accomplish by doing this?
While displaying the data like amount and all in the frontend of my application, I am using it as fallback.
Each checkout-session will have payment_intent or not, regardless of payment mode?
Okay thanks for the help.
You are trying to create a 'record' that represents a 'transaction', ya?
ya, kinda.
I mean if i am able to get the checkout session by retrieving through the payment_intent then it will help me to indetify the unique record like which checkout session and which payment intent
You're still describing how you want to implement whatever you're implementing, but you haven't described what you are trying to implement.
There is functionality in my website to view the payment that is received from the customer so while viewing, I wanted like if i don't get data from the invoice then take that from the checkout session like invoice name, customer email, name, amount.
subscription
Okay so basically when you receive checkout.session.completed you would want to retrieve the Checkout Session and expand the related invoice: https://docs.stripe.com/api/checkout/sessions/object?api-version=2025-05-28.basil#checkout_session_object-invoice if you want that data.
Okay,
I just wanted to ask if payment_intent is available or not in checkout.session.complete event, but seems it is only available in the payment mode and not in subscription mode.
Correct, you would access the payment_intent from the Subscription/Invoice that is generated.
Yes, from that payment_intent I can retrieve the checkout session by Stripe.Checkout.Session API call.
Yeah I'm saying you can't go directly from Checkout Session --> PaymentIntent. You would go Checkout Session --> Invoice --> PaymentIntent.
Okay,
In short i will be able to retrieve the checkout session after getting the payment intent right?
For subscription mode you would use the Subscription ID via the List Checkout Session API: https://docs.stripe.com/api/checkout/sessions/list#list_checkout_sessions-subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.