I need to make a change to my current subscription system and I need to add the option for users to be charged on a subscription basis based on the features (modules) they want. Here's an example:
BasePlan1_2015: $10
Feature1: $5
Feature2: $10
Feature3: $5
At the billing renewal, a user with BasePlan1_2015 and Feature1 & Feature2 should pay
$10 + ($5 + $10) = $25.
So far I have two options:
Option1: Listen to webhooks for invoice created and apply Invoice Lines based on the features that were selected. For the first time the user selects their feature I will add them to the invoice and and invoice it then. Then I would just add at every webhook received the invoice lines required.
Option2: Create new plans on the fly. I would store in my DB the cost of each feature and when the user selects a combination of features, I would create the plan on the fly, put the total equal to the cost of the base subscription plus the features selected and then subscribe them to that specific plan. If someone removes or adds a new feature I would create a new plan (if it is not already created) and prorate.
I incline to the second option since it is more automated and most likely everything is done on Stripe's end when it comes to renewal.
So far these two are the only options I could come up with but I have a sense that there might be something else.
Does anyone used or is using anything like this with Stripe and has another option?
EDIT 1
@koopajah I understand that Option 2 is more complicated (already tested it and it feels not so hard to manage) but so far I just cannot get my head around Option 1. I understand how it should work but I find it hard to put it in code. Basically, my issues comes to when users start adding or changing features and when I might need to prorate the time they did not use. I am using a yearly subscription and I have to prorate because of the longer billing cycle.
Do you have any idea of a package or maybe some resource that I can look at and understand better how to do Option 1?
Also, I cannot really test webhooks live with stripe but only if I do a daily subscription and wait for days to come and see how webhooks work.
UPDATE 1
Came across Option 3 (from here Stripe FAQ):
Have a BasicPlan1_2015 at $1. The base plan will have a quantity of 10 => $10. Each feature would have a quantity number assigned to them:
Feature1: quantity 5 means $5
Feature2: quantity 10 means $10
Feature3: quantity 5 means $5
Now when a user adds or removes one or more features I just update the plan quantity and I guess all should work fine.
BasicPlan1_2015 wit Feature 1 and Feature 2 should have a quantity of 10 + (5 + 10) = 25 with yields a $25 charge per billing cycle.
Now, comparing all three options I am inclining more to Option 3. Just one plan, multiple options and same result while the others require me to have either multiple plans or use webhooks!