#phonicuk-subscription-events

1 messages · Page 1 of 1 (latest)

split harbor
#

Can you clarify what you mean by a 'mid-term payment'?

keen mantle
#

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

split harbor
keen mantle
#

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

split harbor
#

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

keen mantle
#

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?

split harbor
#

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

keen mantle
#

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

split harbor
#

I'd generally recommend using the associated pi_xxx ID instead

keen mantle
#

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

split harbor
#

Not sure I understand the Q

keen mantle
#

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 🙂

split harbor
#

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

keen mantle
#

righto, so I should probably use the PI in case I change things in the future then

split harbor
#

i.e. multiple captures