#shehzadnizamani_api

1 messages ¡ Page 1 of 1 (latest)

warm coralBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1316670542727614486

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

silver ivy
#

Thanks for waiting! Looking at the req_6MaUsCDCOErbII

keen tide
#

Thanks, if you need an event id I can provide that as well where subscription status changes from past_due to active

silver ivy
keen tide
#

This doesn't seems right to me, because user was never charged, their first invoice is still unpaid/retrying.
And we perform an upgrade API call to upgrade user's subscription with payment_behavior: 'pending_if_incomplete', then if user's payment method is always rejecting payments they get a free monthly subscription. Because their first invoice for downgraded plan is still retrying.
Stripe should not update subscription status from past_due to active in this case

#

And what is worse is that pending_update always expires in 23 hours according to your documentation, which means that if our code attempts to upgrade a user's subscription who have past unpaid invoice and their subscription status is past_due they will get a free subscription for 1 month?

silver ivy
#

In https://dashboard.stripe.com/test/subscriptions/sub_1QV6nYCYufzy4qbXICi74oby, the first invoice was paid, the second invoice was retried and last invoice was voided.

The pending_if_incomplete will not affect the subscription status as the subscription changes have not been made. Subscription will only change to the new price once the payment has been made and won't affect the current status of the subscription.

#

If the invoice is failed, the new price will not be updated to the subscription.

If the invoice is successful, the new price will be updated to the subscription.

In any case, it doesn't affect the existing subscription.

keen tide
#

I understand all that, first invoice which was paid is trial invoice, second invoice is what was actually supposed to charge the user once their trial ended. I made an API call to end user's trial instantly with request id: req_xQd9V8Gu7FGVbF
And as soon as trial ended subscription status changed to past_due and it was past_due until most recent invoice was voided. Subscription status was changed from past_due to active even though it should have remained past_due.
Please let me know if this makes sense, user is getting a free subscription for whole month which is the issue we are trying to avoid here

silver ivy
keen tide
#

Ok is there any way to avoid voiding invoice when upgrade fails. Because if upgrade fails we will get pending_update hash and an unpaid invoice, this unpaid invoice get voided after 23 hours if we do nothing. I tested this with test clock simulations and your documentation also mentions same thing

silver ivy
#

I'm afraid there is no workaround. You should ensure that your customer pays any outstanding invoice / payment first before doing any upgrade.

#

Since same payment method is used for the invoice payment for upgrade, the likelihood for the failed payment is very high

keen tide
#

Ok thanks for letting me know, we will write our code accordingly. One last question, when we perform an upgrade with payment_behavior: 'pending_if_incomplete' the invoice is it one-off invoice, meaning whenever we make an upgrade Stripe attempts to charge customer and doesn't retry that invoice again. Or is that invoice retried based on our retry settings for failed payments?

warm coralBOT
vague marsh
#

hmm, that's a great question

#

when I test it, it has auto_advance": false so I think it's not retried automatically

keen tide
#

Yeah that is what I found when I was testing advance clock simulations, but we need to know this for sure. Could you let me know for sure what will be behavior of pending_update invoice. Because we need to write our code accordingly, and I can't find answer to this in your documentation. If you have a link to Stripe documentation that would be great too, so that we can document this with references

vague marsh
#

I'm really not sure, it's not explicitly documented. I think if we both tested it and it works that way that's probably the right answer