#aksharj-proration
1 messages ยท Page 1 of 1 (latest)
many thanks @final fog , will be really helpful
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
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
)
that code is helpful! you can find the request ID by toggling on "GETs" in https://dashboard.stripe.com/test/logs
thank you! looking
much appreciated ๐
ah ok I think I see now
- 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.
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?
what do you see in your upcoming Invoice, for period_start ?
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
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
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
here is the response i see
sorry, please see this link for the correct object
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
period start i see is Mon, 20 Sep 2021 18:40:13 +0200
period end is Tue, 20 Sep 2022 18:40:13 +0200
please let me know in case you need more information
hey still here, was catching up on some threads, back in a sec
ok cool ๐
ok so
-
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
-
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 -
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
cool, thank you so much for the detailed explanation
yes, thats the only thing not clear now
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
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
I think with subscription_proration_behavior: always_invoice ? try that in your upcoming Invoice request
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
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?
yes, would ideally want the user to make the payment and also change the billing cycle
Gotcha - then you'll also want to pass in subscription_billing_cycle_anchor: now.
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'
)```
Are you running into an issue or unexpected behavior with that update request?