mysql - Storing Payment Details and Subscription Details -
i trying create subscription based payment module project.
there 3 plans
- will cost 49$ right free till acquire users.
- 499$ have 15 days trial
- 799$ have 15 days trial.
we using stripe payment integration.
i have users table follows
users(name, email, password, ....)
now want store following
- define , maintain plans
- which plan user subscribed to
- when user subscribed plan - details regarding payments - upgrade - downgrade etc.
can 1 share how can via mysql tables , if missing key information need store ?
here little sketch of in scenario :
tables
-
users
id, nameemail, password, ...
-
maintainplans
id, user_id, name, ...
-
payments
id, name, user_id, ...
-
operations
id, type, user_id, name, ...
notes
- the user_id field reference of course id primary key of user table
- each tables can,of course, contains more columns containing more information or relations(i have inserted essentials.
- the operations type field should contain enumeration possible value (upgrade, downgrade), defined , enumerator or table referenced (even better) ...
Comments
Post a Comment