#jonathanbull
1 messages ยท Page 1 of 1 (latest)
AFAIK, you can't really. Let me confirm
What's the use case for understanding the difference?
We send our customers an email if their subscription payment failed. We don't want to send that email if they're paying an invoice manually.
(because they'll already have seen a message saying their payment failed โ your invoice payment screen tells them this)
Ah, got it. So you have some customers that aren't on automatic billing โ you explicitly send them an invoice to pay manually?
Everyone is on automatic billing, but sometimes we need to send them a manual invoice (mainly for customers in India, due to RBI regs).
Ah, I was going to suggest you could use the collection_method field on the Invoice object to differentiate the 2
Yeah unfortunately that's collection_method: automatic even if they pay manually
But if they're all charge_automatically, I'm not sure there's another way really without tracking it yourself on the Invoice
thanks for the suggestion though
ah I just noticed the "event source" is different for a payment made manually (API) vs automatic (Automatic)
is there any way we see that in the payload?
There's not unfortunately
Ah ๐ฆ
Well thanks anyway. Is there any way we could suggest this as a enhancement? Knowing how the customer paid an invoice (manual vs automatic) seems like quite pertinent info โ at least in our case!
Just so we're clear, you want to prevent actioning invoice.payment_failed events from payments initiated by the hosted page, and to do that you need a way to differentiate the events via the payload. Yes?
Exactly right.
Do you have an example event for scenario B to hand?
sure, one second
scenario a: evt_1MAyuSHZLNwo79Rqjxu1NmWk
scenario b: evt_1MAyKCHZLNwo79Rqbbd1VHy8
you can check for the presence/absence of https://stripe.com/docs/api/events/object#event_object-request-id
Ah fantastic! The docs you link even suggest this as being useful for this use case. Thank you.