I am using Stripe.Net to handle the payments. When I start to test the "charge.refund" webhook, I am getting NULL invoice property in code behind but invoice value exists in Stripe webhook event and I confirmed the invoice is exist dashboard too.
Noticed the versions in Stripe.Net and configured webhook API is different.
Dashboard Webhook API version: 2017-08-15
Stripe.Net version: 16.12.0.0 (It support 2018-02-06).
Here is the Stripe webhook event
Here is the breaking code(charge.Invoice.SubscriptionId breaking with Null reference)
Anybody faced this issue before?
Thanks


Looking at the source code for the
Stripe.Mapper<T>.MapFromJsonwhich is deserializing the JSON using JSON.Net,
the fact that the
StripeCharge.Invoiceproperty is marked with[JsonIgnore]attribute.and finally how the
InternalInvoiceproperty is mapped via theStringOrObject<T>You can see in the class definition
That if the value passed is a
string, that it will set theInvoiceobject property to nullSo the behavior you describe is as designed based on the shown data and code.
You would probably need to extract the
InvoiceIdand try to retrieve it (the invoice) in order to use its members.