#jasonfish568

1 messages · Page 1 of 1 (latest)

cerulean torrentBOT
slim jasper
#

Then you should just set proration_behaviour to none , You customer will be billed in the new price in next renewal.

idle grail
#

But I'd like to bill the customer $200 for the current month, too

#

If the customer upgrades, he needs to pay the gap for the current month.

slim jasper
#

Can you walk me through with an example?

idle grail
#

I have a subscription A $100/month, B $200/month.

Customer Tom purchased a subscription on 01/08/23, he paid $100 on that day.

On 14/08/23, Tom wants to switch to Subscription B. Now Tom should be charged another $100 because B is $100 more expensive than A.

slim jasper
#

That's the exactly what proration is doing

idle grail
#

Tom can enjoy the benifits of Subscription B if the payments succeeds.

#

But proration is calculating the time, right?

slim jasper
#

I believe proration_behaviour:always_invoice is exactly for your use case. have you tried it out?

idle grail
#

I tried but I'm confused with the logic.
For example, if Tom switches from A to B on 25/08/23, how does proration calculate the price gap?

slim jasper
#

Ok, when you do a proration, a few things happen

idle grail
#

I don't think I will be charging Tom $200 after the upgrading. Total charged amount will be:
$100 x (25/31) + $200 x (6/31) =$119.36

slim jasper
#

Basically

  1. The customer is getting back the money that don't need to spend on the old plan for the remaining month
  2. The customer needs to pay the money that they are going to spend on the new plan for the remaining month.
  3. The proration amount is the sum of these two
#

Not exactly like what your formula shows

idle grail
#

That's the problem. If Tom enjoyes all the benefits, I'd like to charge him $200. How can I get this done?

slim jasper
#

No, Tom only enjoys the benefits for the remainig month, not the full month, am I right?

idle grail
#

Nope. For example, Subscription A allows Tom to download 10 copies of the files, Subscription B allows him 100 copies of the files. After upgrading, he would be able to download the total 100 copies. Which means he enjoys the total benefits.

slim jasper
#

Still, Tom can only use the download service for just the remaining month, not the full month

idle grail
#

I think that's the problem. Proration is only based on time, but I'd like to charge on the actual number of copies he can download. So what is the best practice charging him the $100 gap.

#

Is proration_date helping ?

slim jasper
#

Your business model is indeed unique and you need to do some cutomization for it.

yes you can still set proration_behaviour:always_invoice to bill your customer immeidately, and you need to listen to invoice.created event, add add your custom invoice item, and manually finalize the invoice so that you can charge your customer with additional amount.

#

Or you can manually create a separate invoice of $100, and update your subscription with proration_behaviour:none when your customer has paid the invoice.

idle grail
#

For the second process, I will need custom meta data to identify this new invoice and process it right?

slim jasper
#

Yes you are right

idle grail
#

Let me read through the docs, I'll come back create a new chat in case I have more questions. Thanks!