#jslaybaugh-webhook
1 messages · Page 1 of 1 (latest)
evt_0KUZEBFJSLGHEP2XogHTjAJB
Thanks! Taking a look
well, we're not getting the source from the payload itself
but we use the charge to go get it, I think
our code is looking for if (invoice.Charge.Source is Stripe.Card card)
which for every other time ever, the source is that shape, but for this customer and this charge, the source has other properties and then the card nested inside that
yes just checked the code, so to be clear, this isn't technically related to the webhook. It is just that this charge is different from any other charge.
we're doing something like this
var invoice = invService.Get(invoiceId, new InvoiceGetOptions { Expand = new List<string> { "charge" } });
and in that expanded charge, the source has a different shape
Thanks for the extra context! Still looking, give me a moment.
Do you happen to have the request ID for when you retrieved that invoice?
Ah I think I know why this is
i don't have the request ID
That's fine, just confirming on my end, but pretty sure this is due to the payment coming via the Hosted Invoice Page.
Okay yep. So that source (the card) that appeared in your webhook, was created via a payment your customer made through the Hosted Invoice Page. Here is the relevant event that shows it being attached: evt_0KRP3gFJSLGHEP2XiXRiGDnT.
The Hosted Invoice Page creates sources, so if that is a method that you expect your customers to potentially pay, then you will want to handle the source object as well in your retrieval.
This happened when they were paying for in_0KRLlzFJSLGHEP2XmOLwNJkM. Here is the request ID for the payment through the Hosted Invoice Page if you want to take a look at it: req_je3gyzdCDxAwEd