I am working through updating some of the billing in my application and have got a little stuck.
A user can buy 3 levels:
If you assume 1 quantity is an email account that is active for that month.
I have 1 plan which is $10 and then its worked out with the quantity
I understand that the first bill gets paid and discounted as soon as the subscription is selected.
When I used the updateQuantity it changes the quantity to the new one and prorates the cost but does not charge straight away. This will be prorated in the next billing cycle along with the next months billing at the new quantity.
The part i get stuck around is how do I check how many quantity (email accounts) can be active during the month. If i check the quantity in the db it will only show the updated quantity so if you move from bronze to silver it will show a quantity of 5, but in reality I should be able to have 6 as I have already paid for 1 active upfront, then at the end of the billing cycle for that month it should drop to 5.
This is more of an issue when a customer wants to downgrade and I am really not sure how to handle this.
I hope someone can help and I have explained it well enough :) Thanks!