#ijsje

1 messages · Page 1 of 1 (latest)

stiff oliveBOT
oblique prawn
#

Hi there

runic kestrel
#

Hello, do I need to calculate the totals of everything that is due now myself?

oblique prawn
#

So to clarify, you only want to show the amount associated with the update

#

Or you want the pending invoice items as well?

runic kestrel
#

I want to show the customer the amount associated with the update. So in this example 02 mrt 2023

#

I can get it from the api call as shown in the pic, but I still need to calculate the totals myself it looks like

#

I was wondering if maybe I used the upcoming invoice api wrong.

#

upcoming_invoice = stripe.Invoice.upcoming( customer=subscription_obj.stripe_id, subscription=subscription_obj.subscription, subscription_items=items, subscription_proration_date=int(time.time()) )

oblique prawn
#

Oh okay so you want to show as if you are going to invoice right now

#

Not for the next cycle?

runic kestrel
#

Yes, because when the customer clicks on update, I am invoicing the proration immediatly

oblique prawn
#

Then yeah the above should do the trick

runic kestrel
#

I have that

oblique prawn
#

?

#

That isn't in your code above

runic kestrel
#

Ok so there is nothing more I could do from the upcoming invoice api. Yes everything works fine.

#

response = stripe.Subscription.modify( subscription_obj.subscription, items=items, proration_behavior='always_invoice', payment_behavior='allow_incomplete', )

#

This is my code when a customer clicks on "Upgrade"

#

The "problem" is that the upcoming invoice acts like always invoice doesn't exist. So I get the data as shown in the picture above.

#

the total tax and total amount are for april 2nd, not for right now.

oblique prawn
#

I'm talking about adding proration_behavior: 'always_invoice' to the upcoming Invoice API

runic kestrel
#

I am purely talking what I show to the customer. The actual subscription modification works perfectly.

#

oh!

oblique prawn
#

I understand

#

See the link to the API Ref I shared above

#

We support that parameter in the upcoming invoice API as well

runic kestrel
#

It's fixed now