#harsha

1 messages ยท Page 1 of 1 (latest)

viscid finchBOT
minor holly
tardy patio
#

@minor holly Thanks for the reply. Is there a possibility if proration_behavior is set to create_proration then can we invoke payment immediately?

#

For me, I have a different logic for pro rata and I want to charge immediately on subscription update.

minor holly
tardy patio
#

@minor holly I went through the docs but still confused. I cant see how to set pro rata amount.

minor holly
#

Pro-rated amount is calculated by Stripe and you can't set it on your own with proration_behavior parameter. Do you mean you'd like to calculate the pro-rated amount on your own instead of using the one calculated by Stripe?

tardy patio
#

yes. Is there any alternative that you could suggest?

minor holly
tardy patio
#

@minor holly Just to confirm as mentioned in second step add_invoice_items.price_data.unit_amount will be the final amount that will be charged for current payment and for next recurring payment charges will be based on add_invoice_items.price amount.

minor holly
tardy patio
#

@minor holly For pro-rata changes in items.data will be only for current payment and will not be applicable in future payment ( will be done on higher plan price amount)right?

distant ember
#

Hi! What do you mean by "will be only for current payment and will not be applicable in future payment"?

distant ember
#

If you add invoice items, they will be automatically added the next invoice for that subscription.

tardy patio
#

Let says my current plan A ($100) needs to be updated to plan B ($200) both are yearly recurring subscriptions. I want to update plan B after six months of purchase.

According to stripe pro-rata charges (six months) for used will be ($50) but I want to charge $70) with some different logic. So that the customer charge will be charged $170 (instead of $100 which stripe does) immediately upon the update. When I say current_payment ($170) I meant immediate payment on update. and future_payment ($200) is like the next recurring payment.

#

@distant ember For my use case if I set items as below

items.price to higher plan id let's say plan B ($200)
items.price_data.unit_amount will be set ($170)
Will that work for my use case?

distant ember
#

Hum... one way to achieve what you want would be to:

  • Update the subscription with the new price ($200) and set the proration_behavior to none. This way the subscription is upgraded, but there will be no payments.
  • Manually create a new invoice with the prorated amount that you compute on your end, and pay it immediately
    But there might be a better way, let me think about this for a moment.
tardy patio
#

payment has to be off_session

distant ember
#

Yes when you create the invoice you can set it to charge_automatically, and it will use the default payment method of the customer.

tardy patio
#

Ok. Please let me if there is better solution.

frigid socket
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

tardy patio
#

@frigid socket With this approach, it may not work for me. As extra can be negative (for example instead of $70 in some cases it can be $30 ).

frigid socket
#

if it's negative, then you can add a discount on the invoice with the amount

#

e.g. discount $20

tardy patio
#

ok

#

For next recurring payment it will be charged $200 only right.

frigid socket
#

if the coupon you apply is created to be used once then yes

tardy patio
frigid socket
#

price and price_data can't be both set on the same item

#

that's not possible

tardy patio
#

ok got it

#

The only issue here is that I have to create many different coupons on updation.

frigid socket
#

yes I agree, the only other solution would be to create a subscription Schedule

#

with 2 phases

#

first with the $170 price (with 1 iteration) and the next phase with the $200 price

tardy patio
#

Can you send a reference to schedule with phases?

frigid socket
tardy patio
#

thanks

frigid socket