#kosherslayer

1 messages · Page 1 of 1 (latest)

acoustic quiverBOT
viral moth
#

Hi 👋 how are you controlling access to your product? Is it based on the state of a Subscription object?

bold kestrel
#

It's based on the webhook events i receive

#

so invoice_payment_suceeded -> provision access

#

invoice_payment_failed -> remove access

acoustic quiverBOT
iron totem
#

Hello! I'm taking over and catching up...

#

However, if you want to always do something exactly 30 days after something is past due that's something you should set up on your end, where you have a countdown running from the point at which the payment is past due.

bold kestrel
#

im wondering though if I can do a work around because I see I can set the subscription_status to be unpaid after an invoice status is 30 days past due. So once that happens, won't I receive a stripe webhook event that I can use?

iron totem
#

Yes, if you set that option you'll get a webhook for that change to the Subscription.

bold kestrel
#

okay so the event ill receive is a subscription updated event with a status of 'unpaid'?

#

Are there any other cases where I can receive a subscription_updated event with status of unpaid? Or is that it

iron totem
#

I think that's it if that's how you have your settings configured.

bold kestrel
#

and then once they pay it, do i provision access based on invoice.payment_succeeded or subscription.updated with status=succeeded?

iron totem
#

I recommend using invoice.paid, not invoice.payment_succeeded. Or you can use customer.subscription.updated and check the status.

bold kestrel
#

How come? jw

iron totem
#

How come what?

bold kestrel
#

to use invoice.paid and not payment_succeeded