mysql - Storing Payment Details and Subscription Details -


i trying create subscription based payment module project.

there 3 plans

  1. will cost 49$ right free till acquire users.
  2. 499$ have 15 days trial
  3. 799$ have 15 days trial.

we using stripe payment integration.

i have users table follows

users(name, email, password, ....)

now want store following

  1. define , maintain plans
  2. which plan user subscribed to
  3. 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

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -