#xxxxxxxxxxxx_api
1 messages · Page 1 of 1 (latest)
👋 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/1316003946229268500
📝 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.
- xxxxxxxxxxxx_api, 21 hours ago, 18 messages
- xxxxxxxxxxxx_api, 4 days ago, 11 messages
Sorry guys, it's me again. There is the two other threads where I spoke about my problems and you gave me solution to try to fix it but it didn't work unfortunately...
https://discord.com/channels/841573134531821608/1315656770605027409
https://discord.com/channels/841573134531821608/1314227263746609254
hi there!
• If the payment fails (e.g., due to 3D Secure), the subscription is already updated to yearly, so users get access without paying.
to avoid this, you could use a pending update: https://docs.stripe.com/billing/subscriptions/pending-updates
No I can't
What have you already attempted?
- revert sub to initial state with 100% off coupon => generate invoice and reset billing cycle
- use error_if_incomplete => no invoice but can't pay with 3DSecure
- use pending_if_incomplete => doesn't work when recurring time of products are different (monthly and yearly)
- use default_incomplete => If payment is canceled (3D secure refused by user), it still update the sub from monthly to yearly
why not?
having a look
use pending_if_incomplete => doesn't work when recurring time of products are different (monthly and yearly)
can you share a request ID (req_xxx) where you tried this and it didn't work? because it should be possible.
I can't really find you that since it's been a week of working and trying stuff to make it work. I do remember the actual error message which was
“You cannot update a subscription to include prices with different billing intervals when using pending_if_incomplete. You must ensure all prices in the subscription have the same billing interval, or handle the update manually.”
well, you can't have a subscription that includes prices with different billing intervals. so the error makes sense.
but if you are switching from a monthly price to a yearly price, pending_if_incomplete will work (I just tried on my end)
How are you deleting item from a subscription using pending_if_incomplete ?
you have a few options. do you want to replace one monthly price by one yearly price? or there are multiple prices to delete?
There is two monthly price and I need to upgrade to two yearly price. deleted: true was not working for pending_if_incomplete so I needed to make the quantity to 0 when updating it to make it work. Sadly it didn't work too because of the billing interval of the price that were not the same
Your collegue karlleko also said last week "Ideally the best practise is to use the pending updates feature but it's not possible in many cases and this is about the only workaround I can suggest. "
instead of deleting the price, you could replace it. something like this (in Node):
const subscription = await stripe.subscriptions.update('sub_xxx',
{
items: [
{
id: 'si_xxx', // existing subscription item for monthly price
price: 'price_xxx', // new yearly price
},
],
}
);
What about quantity ?
This is how I am doing it for the moment :
"items": {
"0": {
"id": "si_pnV",
"deleted": "true"
},
"1": {
"id": "si_xM",
"deleted": "true"
},
"2": {
"quantity": "4",
"price": "price_1tUriG7"
},
"3": {
"quantity": "2000",
"price": "price_1mVWl"
}
},
Oh I got it, I replace only the price but not the subscriptionItem at all.
Oh I got it, I replace only the price but not the subscriptionItem at all.
correct. can you give this a try and let me know if it works?