Let's assume a billing cycle that's 30 days long.
We have a counter called "bandwidth", measuring gigs of bandwidth.
We have two plans, Plan A (5GB free) and Plan B (10GB free).
The user subscribes and uses Plan B for the first 15 days. Then he switches to Plan A for the next 15 days.
How do we price the usage and determine how much free usage he was entitled to?
Reminder: usage is reported independently for each period, we have distinct values for both periods.
Options:
1) For the first period we charge usage that's over 10GB, for the second period we charge usage that's over 5GB
This is the current implementation.
2) We prorate the free quantities, so first period has 5GB free (half of plan B) and the second period has 2.5GB (half of plan A).
Any usage over those amounts gets charged.
3) We do some kind of an average?
How do companies usually implement this logic?
Comments
Comment #1
bojanz commentedComment #2
bojanz commentedDiscussed it with DamZ, agreed to implement #2 by default + #2141281: Make it possible to postpone the plan change to the end of the billing cycle.
There are different use cases, in which case the usage plugin can be inherited and the chargableUsage() method overridden with custom logic.
Comment #3
robertdouglass commented+1 to the prorated option.
Comment #4
bojanz commentedDone in http://drupalcode.org/project/commerce_license_billing.git/commitdiff/93...
The other issue referenced in #2 has also been fixed.