I am new to bubble, and building apps. I am planning to add a simple monthly subscription system (like in any SaaS) to my app. I’m not concerned about the payment gateway right now, but the basic logic of implementing a subscription/membership system. Let’s assume we have only 1 pricing plan.
What I have in mind right now is to use a scheduled workflow.
I set up two variables in USER datatype to store the no. of days remaining for the subscription, and the subscription status (Active/inactive).
X number of days are added to the "days remaining " variable once a user subscribes/renews his subscription.
Every day, the workflow will check how many days are remaining in the subscription, and change the subscription variable’s value to “Inactive” if days remaining are <1. And we check each time a user logs in, if the user’s subscription status is active or inactive. If inactive then we can redirect to the renewal page (or any other appropriate step as we decide).
Is this the right approach for handling subscriptions, or is there a better way to do this? Also, how would you calculate the days remaining by calculating the:
“expiry date - Today’s Date” ?
Any tutorial reference will be highly appreciated