I'm creating a subscription based service with payment gateway, discounts and other feature. I am stuck at a point on how to manage the subscriptions, transactions and invoice.
My tables are: (I've listed only the relevant tables below )
- users
- packages (package_id being the P.K )
- subscriptions
- transactions
- transaction_details
Using the above structure I won't be able to create/ store the invoice, won't be able to apply any discount for the subscription and difficult to manage any refund/ cancellation.
Any suggestions to improve the structure would be highly appreciated.