#Ludvig
1 messages · Page 1 of 1 (latest)
Hi there!
Can you clarify the issue? I'm not sure I follow.
When I receive the Customer.Subscription.Created webhook, I parse it as following:
var StripeEvent = EventUtility.ParseEvent(QueueItem);
var TransactionData = StripeEvent.Data.Object as Subscription;
The Subscription class includes CustomerId and Customer, but the real Webhook body request does not include CustomerId.
Instead, Customer is returned as a string (see first message), when it should be the Customer class.
Oh, I see! Which version of stripe-dotnet are you using?
41.3.0
<PackageReference Include="Stripe.net" Version="41.3.0" />
So basically the class does not match the real body of your webhook.
Hi there 👋 I'm jumping in as my teammate needs to step away soon. Could you share the ID of an event (evt_123) where you saw the behavior you're referring to, and what in the body of that event didn't match what you were expecting to see?
evt_1MJH2aLxHYPQiQHHajsbPqsU
Gotcha, thank you for that. I see that event includes the ID of a Customer, but I'm not sure I fully understand your concern. Is the behavior that you're concerned with happening during the processing of the event received by your webhook endpoint?
In the webhook request, Customer is a string, when it should acutally be the Customer class according to your Stripe.net typing.
Can you see what the issue is?
Data.Object.Customer is a string when it should be Customer()
Those webhook events do contain just the ID of the Customer object, they don't transmit the full Customer object along with them.
To clarify, since you mentioned referencing Data.Object.Customer, are you referencing this value while it is still an Event object, or are you waiting to reference it later after you've converted it to a Subscription object?
I am trying to get the Customer ID after converting it in to a Subscription object.
Can you guide me in how to do that?
It sounds like Data.Object.Customer is providing that ID, or am I misunderstanding and you're seeing something different in that field?
Yes it does provide that ID, but not according to Subscription() class.
Should I use Customer or CustomerId?
Gotcha, I believe CustomerId is the better option there, but let me know if that doesn't hold the value that you're expecting.
Let's see!
Thank you, actually, now CustomerId works.
Sorry for wasting your time.
I'm glad we were able to find a solution!