#RamonP99
1 messages · Page 1 of 1 (latest)
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.
- ramon-checkout-customer, 22 hours ago, 21 messages
- RamonP99, 1 day ago, 10 messages
hi! you can use invoice.paid for that . https://stripe.com/docs/billing/subscriptions/webhooks#active-subscriptions
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
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
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!
if you're talking about Checkout for one-time payments yes, that doesn't use Invoices; you'd use checkout.session.completed for anything to do with that
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:
- When the invoice is paid.
- 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