Project is in - Code-igniter.
We would like to add below feature to our existing billing subscription module. We already have 3 plans where we charge users monthly. However, want to change the code to accommodate below points.
1. Currently regular subscription uses Stripe [login to view URL] which doesn't allow coupon. We need to add our custom checkout with coupon field. Remember this coupon field is different from # 2 coupon field. This one is visible once user selects the regular plans and now he/she is ready to enter the credit card details.
2. Add two more plans on the front end which allow users to subscribe to Stripe's $ 0 plan (defined in the stripe as a $ 0 / month, two separate plans) by entering a coupon code. So e.g. if coupon type 1 is entered it will select plan 1 and if coupon type 2 is entered then plan 2 will be selected. We will need a table to validate these coupons entry by user. This table will contain which coupon is type 1 and type 2. So add a table that stores info about it as well as who redeemed it. Because once it is redeemed then it should not be reused. Now, this flow is bit different from # 1 above - here user selects the plan e.g. special lifetime plan 1, then enters the coupon code, it is validated against the table, if good then user is subscribed to stripe lifetime plan 1 ($ 0 plan), and user is subscribed now.