#acaiafa
1 messages · Page 1 of 1 (latest)
Hello! No, I don't believe Invoices have that property.
So how can I know in the invoice.paid webhook that the payment is referring exactly to the customer id within my application?
I had understood that this tag was exactly for that
The client_reference_id property exists on the Checkout Session: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-client_reference_id
Are you using Checkout to create a Subscription?
The Pricing Table creates Checkout Sessions.
You can access the data from the API.
but if I'm using the pricing table embedded in my page, how am I going to get the checkout session, still make sure it was paid and do all this binding? does not make sense.
You would write code to do it. Are you a developer?
yes I am and I figured with the webhook this would be solved. All I had to do was enter a unique id and that same id would be returned in the webhook. If I need to use an api to get the session checkout to be able to interpret what comes in the webhook, and I don't even have access to the moment the customer completed or not the purchase, it makes no sense to anyone
I think you're listening for the wrong Event.
Try listening for checkout.session.completed.
now it makes sense
I will try this way
in invoice.paid is when the payment is confirmed, I didn't find the reference to session checkout in it
There are several Events that will be emitted, all of which serve a specific purpose and describe a different object involved in the process. checkout.session.completed is the high-level Event that says "this Checkout Session completed" and it contains the Checkout Session object. Other Events that will fire in your use case include ones for the Subscription, the Invoice, the Payment Intent, and so on. You can listen to whichever Events make sense for your use case and suit your needs.
If your Checkout Session is creating a Subscription, for example, the the Subscription will create an Invoice, and that Invoice will create a Payment Intent, and that Payment Intent will create a Charge.
All of those objects have associated Events.
This video might help clarify the object relationships: https://stripe.com/docs/payments/tour#payment-objects
There's a good overview of the Events related to Subscriptions here: https://stripe.com/docs/billing/subscriptions/overview#subscription-events
thanks