I am trying to create a subscription based payment module for a project.
There are three plans
- Will cost 49$ but right now it will be free till we acquire users.
- 499$ which will have 15 days trial
- 799$ which will also have 15 days trial.
We are using Stripe for Payment Integration.
I have a users table with as follows
users(name, email, password, ….)
Now i want to store the following
- Define and Maintain Plans
- Which plan a user is subscribed to
- When a user is subscribed to a plan – details regarding the payments – upgrade – downgrade etc.
Can some one share how i can do it via Mysql tables and if i am missing any key information that i need to store ?
Here it is a little sketch of what i would do in this scenario :
Tables
Users
id, nameemail, password, …
MaintainPlans
id, user_id, name, …
Payments
id, name, user_id, …
Operations
id, type, user_id, name, …
Notes