#Fedegara
1 messages ยท Page 1 of 1 (latest)
Hi ๐ can you elaborate? Are you encountering an error when trying to include metadata?
Hi Toby
thanks for the help
look i create a new Session but i wanna retrieve some metadata when the client have payment erroes on the session checkout
but my session create is of a subscription so i receive an error that says "Yu can not pass setup_intent_data in subscription mode."
That is expected, as mentioned in our API spec, setup_intent_data is only available when you're creating a Checkout Session with mode set to setup.
When you set mode to subscription, you can use subscription_data instead:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes
but my question how can attach that payment intent for example to my checkout session without the metadata?
I don't understand. You don't attach Payment Intents to Checkout Sessions. When working in subscription mode, the Checkout Session will create a Subscription which will create an Invoice which will create a Payment Intent.
But i am creation a session that retrive me an url
to stripe to put my credit card and make the payment
if this credit card has a problem that generate a payment intent error
that i cannot attach to my system,because in the creation y cannot put metada to him
I believe you can still use subscription_data.metadata. When you received an event about a failed payment, you'll need to the check the Payment Intent to see if it is associated with an Invoice by checking its invoice field:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice
If it is associated with an Invoice, you then check whether that Invoice is associated with a Subscription by checking the Invoice's subscription field:
https://stripe.com/docs/api/invoices/object#invoice_object-subscription
You can then check the associated Subscription for the metadata that you included.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
that field dont return
exmaple
https://dashboard.stripe.com/test/events/evt_1M4QhHJSXHzR5XpLyAnU6bTY -> the rror indeed
https://dashboard.stripe.com/test/events/evt_1M4QhGJSXHzR5XpLLlFet9at -> the setup intent indeed
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I'm not sure what you're trying to convey. What field are you referring to when you say "field dont return"?
๐ happy to help!