#phonicuk-subscription-events
1 messages · Page 1 of 1 (latest)
Customer has set up a subscription that is paid monthly, first month is paid immediately - a month later, they make another payment on that subscription
This outlines the expected events in a regular billing cycle: https://stripe.com/docs/billing/subscriptions/overview#subscription-events
Ah okay so for payments in the middle of subscription there's no charge event, so I should be more interested in the payment_intent.succeeded to know that the payment for that month went through
and from there I can go payment_intent.succeeded -> invoice -> subscription id
There'd be a charge.succeeded event evetually yes. But we generally don't reference them as Charges is an older API
payment_intent.succeeded is what you want, yes
gotcha, I was talking to someone yesterday about charges - when you say it's an older API does that imply that I shouldn't be using a charge ID as a transaction ID?
When I say it's an older API, I mean you shouldn't really interface with them directly (i.e. POST /v1/charges, etc)
The Charge objects won't be going away as they are the object that represents the payment. The Payment Intent is the state machine that wraps them
Gotcha, right now I'm mostly using the CheckoutSessionCompleted for my 'new thing has been purchased' so that I can look up the payment_intent.charges and the line item products so from what you're saying this is probably the best way to do it
I'd generally recommend using the associated pi_xxx ID instead
oh really?
Does that hold true for situations where you're essentially ignoring any failures? I'm not using a full checkout, this just responds to payment links
so it either goes through and they get their product or it's all ignored
Not sure I understand the Q
don't worry then, as long as its some ID I can shove into the dashboard to look up a transaction then I'm happy xD
thank you for your time 🙂
Yeah I mean both pi_xxx and ch_xxx are surfaceable in the Dashboard
But in theory you could have a single PI with multiple Charges
righto, so I should probably use the PI in case I change things in the future then
i.e. multiple captures