I've implemented a simple Views-based interface for upgrading and downgrading subscription plans in my Drupal Commerce store. The plans are powered by Commerce License and Commerce License Billing. I've implemented a custom license type in order to provide the option of metered billing.
I'm noticing that the default behavior of changing the plan (
$license->product_id) is simply to change it and update the due amount on the next prepayment. However, it doesn't charge for the upgraded plan for the rest of the billing cycle right away. Is this something I can tell the license or the billing cycle to do, or is it something I have to handle on my own? If so, how can I properly calculate the prorated amount to charge?
The question is basically the same re. refunds, and I assume that once I know how to calculate a charge, I'd simply process a refund if the amount was negative. I guess I would have to refund some of the most recent payment...I'd actually prefer to give them a discount on their next order, but I don't know how to do that either. Because Commerce License Billing manages so much in the Order Refresh process, how to approach all this is a bit muddy for me.
Worth mentioning that I am using commerce_cardonfile and commerce_stripe.