#muslihiddin_docs
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/1418529509929648190
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Yeah unfortunately there's no perfect solution here. If you want to maintain the subscription prior to the upgrade if the payment fails then you need to use pending_if_incomplete
You'll need to workaround the limitations
Can you please help me to find the workaruonds, cause I am searching for solution since monday and it is becoming a huge pain.
price_data: {
currency: 'usd',
product: getProductIdFromPlan(plan),
unit_amount: getPriceFromPlanAndInterval(plan, interval),
recurring: { interval }
},
quantity: 1
}]
// push the deleted item of the old subscription item
const currentSubscriptionItem = subscription.items.data[0]
items.push({ id: currentSubscriptionItem.id, deleted: true })
...
await stripe.subscriptions.update(account.get('subscription').id, {
items,
billing_cycle_anchor: 'now',
proration_behavior: 'always_invoice',
payment_behavior: 'error_if_incomplete',
discounts: await getForeverMonthlyDiscountCoupon(account.get('foreverMonthlyDiscountPercentage'), interval)
})
I use discounts, recurring and deleted which is not supported by penidng_if_incomplete. Would very very appreciate if there is any hints or advices.
The workaround for deleted: true I believe is to set quantity: 0
There's no workaround for the lack of support for discounts, sorry
Okay, thank you very much