#aksharj-proration

1 messages ยท Page 1 of 1 (latest)

final fog
#

Good question, looking in to why this may be and will get back to you

valid hinge
#

many thanks @final fog , will be really helpful

candid relic
#

hello, looking one sec

#

@valid hinge mind sharing the request ID for the upcoming Invoice request you're making? Want to see the params you're passing to preview the Invoice

valid hinge
#

Hello @candid relic , sorry, can you please tell me how i can find the request ID?

#

below is my ruby code, not sure if this is of much help but i will paste it below

#
        customer: current_user.stripe_id,
        subscription: @subscription.stripe_id,
        subscription_items: [
          {id: stripe_subscription.items.data[0].id, deleted: true},
          {price: @plan.stripe_id, deleted: false}
        ],
        subscription_proration_date: (Time.zone.now + 360.days).to_i
      )
candid relic
valid hinge
#

cool, thanks ๐Ÿ™‚

#

here is the request id req_Lnmp0pQMOkFMKp

candid relic
#

thank you! looking

valid hinge
#

much appreciated ๐Ÿ™‚

candid relic
#

ah ok I think I see now

#
  1. 1 ร— Ultimate (at โ‚ฌ9,348.00 / year) $9,348.00
    so that is from the new Price that the user is being moved on to, so charging them for if they were to switch to Ultimate on 15 Sept 2022, to one year on from then.
valid hinge
#

ah ok, thats makes sense, but i don't see the subscription renewal date being changed to 20 Sept 2023

#

is that something that would happen automatically?

candid relic
#

what do you see in your upcoming Invoice, for period_start ?

valid hinge
#

let me quickly check

#

i get this Mon, 20 Sep 2021 18:15:52 +0200

#

which is todays date

#

so i see that period_start and period_end dont seem to change

candid relic
#

mind sharing the full response body of the upcomingInvoice() request?
(I can't view the response on my end)

You can share it on a pastebin link if needed

valid hinge
#

here is the response i see

#

sorry, please see this link for the correct object

#

period start i see is Mon, 20 Sep 2021 18:40:13 +0200

#

period end is Tue, 20 Sep 2022 18:40:13 +0200

valid hinge
#

please let me know in case you need more information

candid relic
#

hey still here, was catching up on some threads, back in a sec

valid hinge
#

ok cool ๐Ÿ™‚

candid relic
#

ok so

  1. Unused time on professional after 15 Sep 2022 -$45.63 -> it is crediting the Customer Balance for prorating off of Professional from 09/15 -> 09/20

  2. Remaining time on Ultimate after 15 Sep 2022 $127.41
    -> prorating to charge you for using Ultimate for the 5 days from 09/15 -> 09/20

  3. 1 ร— Ultimate (at โ‚ฌ9,348.00 / year) $9,348.00
    -> charging you for full year of Ultimate from 09/20/2022 to 09/20/2023

so the next payment will be 09/20/2022 and it will bundle in the upgrade proration and unused time proration, and the next full year's subscription.

#

still unclear on why period_start isn't what I would expect, that is the next Invoice ... looking

valid hinge
#

cool, thank you so much for the detailed explanation

#

yes, thats the only thing not clear now

candid relic
#

ah yeah I think that is expected that the Invoice's period_start and period_end will be for the previous cycle

where-as the actual previewed line items will have their start and end to be the new period

valid hinge
#

ah i see, ok

#

this is so helpful

#

just one more question though, is there a way to charge the user right away, because if the user upgrades 6 months prior to renewal and the amount is charged during the subscription renewal which is still 6 months away, the user might cancel the subscription before it renews

candid relic
#

I think with subscription_proration_behavior: always_invoice ? try that in your upcoming Invoice request

valid hinge
#

ah i passed it but now see that customer will only be charged $81.64

#

looks like this does not charge user for next year but for only the current billing cycle

#

this might not be intended as, customer would need to pay only a few dollars for higher plan (although only for few days) but can download all important data

brazen quartz
#

Yes, paying only for the difference of the two plans would be expected if you're using subscription_proration_behavior: always_invoice since you're not making any changes to the billing cycle.

Do you also want to be resetting the billing cycle when you make an update?

valid hinge
#

yes, would ideally want the user to make the payment and also change the billing cycle

brazen quartz
#

Gotcha - then you'll also want to pass in subscription_billing_cycle_anchor: now.

valid hinge
#

thank you so much, just one more question, this is for the upcoming invoice which previews the proration, if the user decides to update, i am making a call to Stripe::Subscription.update, do the same parameters work for the subscription update call as well?

#

i just tried the update call like this

#
        stripe_id,
        cancel_at_period_end: false,
        items: [{
          id: current_subscription.items.data[0].id,
          price: plan_id
        }],
        proration_behavior: 'always_invoice',
        billing_cycle_anchor: 'now'
      )```
brazen quartz
#

Are you running into an issue or unexpected behavior with that update request?

valid hinge
#

ah no, sorry i got it now. working very much as expected

#

many many thanks @candid relic @brazen quartz for such quick response, you guys rock