#RamonP99

1 messages · Page 1 of 1 (latest)

fleet gullBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

fringe mural
frozen current
#

Thanks!

#

Quick followup question

#

I have both one-time purchaseable items and subscriptions.
I can now listen for the paid invoices, however one-time purchaseable items in my checkout session won't trigger that event

#

To what event can I listen if I want to know when a user succesfully paid for a product which is not a subscription?

#

I looked into: CheckoutSessionCompleted, however that triggers for both subscriptions and single time purchases

fringe mural
#

well there is a subscription field on the Invoice object, in the invoice.paid payload, and that is null if the Invoice is not from a recurring subscription

frozen current
#

the invoice.paid does not seem to trigger when you do a purchase for a product without a recurring price

#

But i think it is payment.intent.succeeded

#

I'll debug some more, thanks for your help so far!

fringe mural
frozen current
#

Yeah indeed

#

But the problem is that checkout.session.completed also triggers for subscriptions when initially creating them

#

And my logic needs to run whenever a single time purchase is made, or when a subscription is created/extended

#

So if I were to listen to the checkout.session.completed event in my case, that would case the logic to fire twice:

  1. When the invoice is paid.
  2. When the checkout is completed
#

So I think i need to listen to the invoice.paid event for subscriptions, and the paymentintent.succeeded for single time purchases