#gkiokan - update subscriptions

1 messages ยท Page 1 of 1 (latest)

copper kraken
#

Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐Ÿ™‚

#

What do you mean by "lose your old invoices" here?

#

Can you share an example?

sick stirrup
#

Sure, I am about to put that online so you guys can test it on a production / test environment but the issue is really strange for me now

#

I am using the invoices endpoint to get all invoices, so I can list the old invoices and upcomming ones

#

But when you do what I described with update, swap tier, cancel, somehow I lost the "old" invoices that where set already

#

gimme around 10 minutes, I will deploy the updates on the public server and you can check it together with me

copper kraken
#

okie dokie

sick stirrup
#

I was just testing the following:
Subscribe to packet A
Then cancel
Subscribe to packet B

only the upcomming invoice for packet B is shown

copper kraken
#

Shown where?

sick stirrup
#

On my dashboard

copper kraken
#

OK, and what is the problem?

sick stirrup
#

I try to figure it out when it happens. But the "old" invoices are gone when a certain action is done

copper kraken
#

Well, you're speaking about an upcoming invoice, not a real past paid invoice

sick stirrup
#

See that. I have swapped from Business to another tier (bottom to top)

copper kraken
#

Past paid invoices should be viewable on both the customer and subscription

sick stirrup
#

If i cancel the subscription it shows me thoose 2 invoices - as expected until now.

The topest invoice is the upcomming invoice so this is clear so far

#

But look now. When I subscribe to a new tier, everything else is gone

copper kraken
#

You're showing me your own UI -- I have no idea how that works. Is something not working for you with the Strike API/SDK?

#

Forget the display -- what's not working like you expect with the data/code that drives this?

sick stirrup
#

My UI just renderes the /invoices api results, nothing special. So you can see the bottom pat with the header "Bisherige Rechnung" are the invoices that are gathered from the api

#

If I subscribe to a new tier after a cancled subscription, the old existing invoices are gone

copper kraken
#

Gone from where? How are you retrieving them?

sick stirrup
#

Though the Stripe PHP SDK with laravel cashier which calls the /invoices endpoint

copper kraken
#

Are you listing invoices by subscription ID or customer?

sick stirrup
#

customerID

copper kraken
sick stirrup
#

lemme double chck if they exists on the dashbaord actualy

#

You mean my primary subscription id gets overriden and the old invoices belongs to another subscription id?

#

That could make sense and explain why my invoice list for the subscrption is empty

#

Lemme investigate the docs you send me

copper kraken
#

primary subscription id
This is not a thing

#

after a cancled subscription
you said you cancel a subscription before subscribing to a new server. This would be a new subscription with a new ID.

sick stirrup
#

Yea that makes sense. Didn't thought about that

#

Is there a way to call the invoices api by customerID? * Ok I think I found it. Lemme try it out.

#

I just double checked my code, it gets all invoices for a subscription. With your explanation it makes total sense why they are gone.

copper kraken
#

OK great, so now you have the info you need to get those invoices for the cancelled subscription separately then?

sick stirrup
copper kraken
#

If you like, sure. You can use the customer and sort by subscription in your own code

sick stirrup
#

A canceled subscription is also a "finished" one which gets calculated until the canceled date.

#

By Default Laravel allows you to do this $org->subscription('default')->invoices(); but this doesn't allow to see the other invoices which breaks my flow

copper kraken
#

Ah, you're using laravel

sick stirrup
#

halleluya

#

it's working

copper kraken
#

I don't know what logic is adds for the customer/subscription relationship. You might need to reach out to the laravel devs/community to see what's possible there.

sick stirrup
copper kraken
#

๐Ÿ™Œ

sick stirrup
#

You saved my day. God damn I was struggling all the afternoon to figure out why invoices are gone. Shame on me

#

Sometimes a good documentation is also overhelming

#

jynoh looked before that but maybe you know that issue. He said thi sis not supported yet

#

On a invoice item there is an description. That is computed by stripe itself. But it doesn't get localized. Do you know anything about that?

copper kraken
#

This is something we're looking at but is currently expected yes

#

I've added your feedback here that this is not expected/desired