#manic - webhook event API payloads
1 messages · Page 1 of 1 (latest)
Hi there. One moment
Can you share a sample event?
And also an event before the change?
do you just need an event id?
Yeah 2 for both scenarios would be ideal
evt_1LFJzLAN9UGzw70gI2qmOUnv after the change
evt_1LBZ6WAN9UGzw70gUOeHBapC before
They are 2 different event types that's why
one is customer.source.created
other is customer.card.created
customer.source.created has a card property to specify that the type of source is a card
i'm not sure where you're seeing that. both show as customer.source.created
our webhook code has been processing this logic properly for more than a year without any errors so something definitely changed
we started seeing these issues on saturday
Got it thanks. My portal is showing it as 2 different event types. Let me connect with a colleague for a moment to ask some q's
Can you provide some more details about your integration in the mean time?
👋
Jumping in to help for a bit as the channel is busy and I have context
Back in 2015 we released this API version https://stripe.com/docs/upgrades#2015-02-18 which "unified" card and other types of payment methods under the "source" concept. customer.card.* because customer.source.* but the payload overall was the same
If you look at the raw JSON payload for both events where we sent them, not what we show in the Dashboard, both are customer.source.created events as expected
Now the real difference is that one of the event used a Card object https://stripe.com/docs/api/cards/object while another one used a Source object https://stripe.com/docs/api/sources/object
they are different API objects and so their shape is different
The difference is that the Card one comes from your own legacy code where you create card tokens tok_123 and then attach them. The Source one comes from the hosted invoice page which has always used Sources since launch
My guess is maybe you didn't use the hosted invoice page before?
@quick yoke does that make sense?
we haven't made any code changes related to invoices
not quite sure what invoices have to do with creation of customer sources in this case either
Your customer used the hosted invoice page where they paid for an invoice which in turn saved their card for future payments
doing that created a card Source https://stripe.com/docs/api/sources/object and attached it to the associated customer
I see, i'm not aware of flows that should be using the hosted invoices page but there could be some other flow I'm unaware of. How are you seeing that relationship for event evt_1LFJzLAN9UGzw70gI2qmOUnv ?
that links to the API request that created that card
I don't think you can load that one though (which seems like a bug) but I work for Stripe so I can and I know where it's coming from
i'm looking at the invoice, where is the indication that it was paid via the hosted invoice page?
there's no such indication
i guess i'm not really sure how i can debug this if there's no indication this is happening defined on the payload or in the dashboard
i feel like i'm missing something here as well, as if the card object is a result of our legacy API and you say the source should always be defined, why does the first event I posted not have source property?
because
this is all from 2015 years ago
The events differ in shape because they describe completely different API resources
if you carefully look at the JSON you can see one has object: 'card' which describes a Card object: https://stripe.com/docs/api/cards/object
the other one has object: 'source' which describes a Source object
Your code, if you continue to handle customer.source.* events needs to look at that property to know which object you are dealing with
If you used our legacy ACH integration you'd see object: 'bank_account' which describe https://stripe.com/docs/api/customer_bank_accounts/object for example
what determines whether the card object is present? it appears arbitrary that in the one case all of the properties that are nested under card are top level but in another they are under the card property.
is it just that object is source rather than card ? and we will get source objects if the card is added via the hosted invoice page?
yes
they are completely different API resources in our API
Card existed since our launch in 2010, Sources shipped in late 2015, they describe the same physical object (a credit/debit card) but are completely different in shape. They just look similar
My recommendation would be for you to move to our latest APIs: PaymentMethods and PaymentIntents. They are fully compatible with legacy objects and you'd get one unique API to represent them all
we have migration to payment intents in our roadmap but it isn't going to happen for a while. thanks for your help