Stripe metadata

How do I retrieve metadata from webhook event payment_intent which was part of my checkout session submitted to stripe The response I get from the webhook doesn’t include the metadata i had used in my checkout session creation

Stripe webhook events include the associated object data under the data attribute. You can consult the webhook event list to see what types of events you can listen to and what object will be returned under data.

PS: Stripe has a Discord channel that’s a great resource for getting answers to questions like this.

There’s no occurences of the word metadata in the paymnet_intent.succeeded returned object I doubt that channel would be of use to me because the stripe api reference isn’t ruby-on-rails, all requests are shown being made with curl If I were to join discuss.stripe.org i’d just be told this wasn’t a stripe question

I found in the docs payment_intent_data.metadata but so far I haven’t been able to use it in checkouts_controller code without getting a syntax error The idea was that the metadata included in my Stripe::Checkout::Session post request to the Stripe api server would be available in the returned object of the webhook event I’m listening for, payment_intent.succeeded

This is the section in the webhook event list documentation for the event you’re listening to.

It’s showing that the data.object of the payload would be a payment intent.

This payment intent documentation shows that metadata is an attribute of that object.

I’ve been working on integrating Stripe into my Rails application for payment processing, and I’m facing a bit of a challenge with retrieving metadata from the webhook events. I set some important metadata during the creation of the checkout session, but when I receive the payment_intent webhook event from Stripe, it doesn’t include the metadata that I need to process the payment correctly. I’ve checked my code to ensure I passed the metadata correctly during the checkout session creation, and it seems fine.

I’m dealing with webhook events, specifically the payment_intent event, in my application. The challenge I’m facing is that the metadata I included during the checkout session creation doesn’t seem to be showing up in the webhook response. It’s a bit puzzling since I expected to see that metadata in the response payload.