#mxd

1 messages · Page 1 of 1 (latest)

next muralBOT
hollow dew
#

Hi there

versed crypt
#

hi

hollow dew
#

You want to provision access for a paid Subscription?

versed crypt
#

Yes, and Ive been led to webhooks, and now Im staring at a huge list of events, and I am unsure which one I really need

hollow dew
#

Got it. You want customer.subscription.updated

#

But you basically want to use customer.subscription.updated and examine the Sub's status in that Webhook in order to provision

#

When the status is active then that means the most recent invoice was paid

#

Otherwise, it will be something like past_due, which means payment failed.

versed crypt
#

whoa

#

ok, so am I creating a table that references the logged in user, and storing those event statuses in that table?

#

and thats how to provision the access?

hollow dew
#

You would store the status of the Subscription, yes.

versed crypt
#

like table membership, active = 1 or 0 <-- something like that?

hollow dew
#

This is mostly up to you but I'd likely use an Enum like we do with our Sub status's instead of a binary like that

versed crypt
#

ok so, the webhook can control all of that, thats basically its function to flip the statuses

#

just confirming

hollow dew
#

That is one way to look at it, yes. I would more say its function is to inform you of events that occur, and then you take action based on those events (like provisioning access or removing access).

#

But we are mostly saying the same thing

#

And using Webhooks is the proper way to handle provisioning, yes.

versed crypt
#

ok thanks for providing valuable insight

#

have a great weekend