#Tejesh

1 messages · Page 1 of 1 (latest)

sick pagodaBOT
zealous wing
tropic leaf
#

Yes but that's after upgrading subscription

#

I need to get the next billing date and I need to show the user

#

So if you upgrade then the next billing date will be blabla

zealous wing
tropic leaf
#

That property is giving me present date

#

I need next billing date

zealous wing
tropic leaf
#

req_f0ru82Efxfy0ue

zealous wing
#

OK. You should refer to the created property. This is the timestamp of the invoice creation time.

tropic leaf
#

I want next billing date

zealous wing
#

The created property of the upcoming invoice is the next invoice date.

tropic leaf
#

That's giving me next billing date but it's not prorated date

#

Whenever an user changing his subscription from basic to pro

#

Obviously he the next billing date should not be the same

zealous wing
#

No. the invoice date stays the same, and the prorated charge will be included in the upcoming invoice.

tropic leaf
#

We can't let user use all the professional sercvices withohut paying for it.

#

We should be either reducing the current subscription period on prorated basis or let user do payment for next subscription period.

rich birch
#

i'm not entirely sure what's the ask here now. if you want to show the user the changes assuming they upgrade, then use the upcoming invoice and pass in the relevant parameters like the new price, whether you want to prorate etc

tropic leaf
#

const invoice = await stripe.invoices.retrieveUpcoming({
customer: customer_id,
subscription: subscription_id,
subscription_items: items,
// subscription_proration_behavior: 'always_invoice',
subscription_proration_date: proration_date,
});

#

Fetching the upcoming invoice from this api

rich birch
#

alright, what's the issue with this?

tropic leaf
#

I need to get next billing date

#

As the user moving from a basic to a pro subscription

#

Before he proceeds