#TayZ
1 messages · Page 1 of 1 (latest)
Hi there, is there reason why you don't want to listen to checkout.session.completed event?
Hi Jack! We're using a subscription creation payment so we saw that it's triggered with an invoice.paid
We also want to monitor for future invoice.paid events
I don't see a way to retrieve the checkout session from invoice or subscription. What data you want to get from a checkout session object?
Oh I see. I need the client_reference_id
OK. I'd suggest you to set a metadata to the subscription through https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata, so that you can get it from the invoice's subscription object when notified by invoice.paid.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ah got it thanks taking a look
A follow-up question, for future invoice.paid when people pay for next month's subscription
is payment_intent unique to a single customer?
Yes, in fact payment_intent is unique for each invoice that a subscription generates
Got it thanks for confirming!
So if I use payment_intent to map unique payments I should be good
I'm getting checkout sessions using payment_intent
Does that mean those checkout sessions are unique too?
Yes, checkout sessions are unique (i.e., one checkout session generates one subscription)
Got it awesome
thank you
So just to make sure I understand correctly:
- on invoice.paid event each month for a customer, I get the paymentIntent
- then I get the checkout sessions using the payment_intent
one strange thing I saw though on Stripe was if I click payment_intent, it maps to a lot of customers
I might be confusing something though, but wanted to double check!
2) then I get the checkout sessions using the payment_intent -> No, you can't get the checkout session from the payment_intent, because the payment_intent was created by the invoice. But you can get the checkout session for the subscription (https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-subscription), sorry I was wrong earlier, there is way to retrieve a checkout session from a 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.
Ah I see
I'm curious what this is doing stripe.checkout.sessions.list({ payment_intent: paymentIntent })
Theoretically I'm not supposed to be able to get the checkout sessions, so is it getting the old ones
That's for retrieve the payment mode checkout sessions by the payment intent that the checkout session created.
Ah got it thanks