#myz123-metadata
1 messages ยท Page 1 of 1 (latest)
Hi ๐ it's hard to tell with how cropped those screenshots are, but it looks like you may be looking at two different objects. Is the first screenshot your request to create a Checkout Session with metadata, and then your second screenshot you looking at a Payment Intent?
The second screen is my stripe console. I listen to payment_intent.succeeded event
Yup, so those are two different objects, one is a Checkout Session and the other is a Payment Intent. Most of the time metadata is not copied from one object to related objects, so you will either need to change how you're setting the metadata or where you're looking for it.
If you want to pass metadata to the Payment Intent that a Checkout Session creates, then you will want to use the payment_intent_data.metadata field when creating the Checkout Session:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
myz123-metadata
Thanks
@vapid remnant payment_intent.succeeded and checkout.session.completed. Do you both work after a successful payment. What are the differences between them?
They both work if you're only creating Checkout Sessions with a mode of payment.
payment_intent.succeeded is triggered when a Payment Intent moves to a succeeded state.
checkout.session.completed is triggered when a Customer completes the flow in a Checkout Session. Since Checkout Sessions can be run in three different modes, this could be them completing a payment, a setup, or creating a Subscription.
The Events will also contain different objects. payment_intent.succeeded will contain a Payment Intent, whereas checkout.session.completed will contain a Checkout Session object.