#abaldo1977
1 messages · Page 1 of 1 (latest)
Good morning! If you are setting the metadata on the SubscriptionData property, it will be set on the subscription itself, so you can see it in customer.subscription.* events or you can retrieve the subscription itself to see the metadata
And you can also set the metadata on the Checkout Session itself if you want it in the checkout.session.completed event
Thanks for your response. I'm doing it in .net c# using the stripe nuget package. I'm setting the metadata in SubscriptionData property in a SessionCreateOptions object.
And trying to retrive it in a c# webhook, asking for CheckoutSessionCompleted event, using stripeEvent.Data.Object. stripeEvent is built using EventUtility.ConstructEvent
Gotcha, can you try setting this via the Metadata argument at the top level of the SessionCreateOptions
SubscriptionData will only set the data on the subscription itself, we don't automatically copy it from the subscription to the checkout session
I can't find a Metadata property in SessionCreateOptions class. I'm using this package version: <package id="Stripe.net" version="32.0.0" targetFramework="net45" />
Should I update it?
Good question. Checking in to this
I think it should be there if you can set metadata otherwise. I may have gotten the syntax a bit wrong
Actually it looks like metadata on Checkout Sessions wasn't added until 34.16.0 https://github.com/stripe/stripe-dotnet/blob/master/CHANGELOG.md#34160---2020-01-17
So yeah upgrading would be required here. Keep in mind that major versions of our .NET library map to different Stripe API versions, so you will need to make sure your webhook endpoint is working with version 2019-12-03 of our library https://github.com/stripe/stripe-dotnet/blob/master/CHANGELOG.md#3400---2019-12-03
And it can just be the endpoint, you don't have to upgrade the entire account if you want to go this way