#mangle_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/1224807539644829848
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
invoicePreviewParams {
customer: 'cus_Pq1Wd0DN6aRLr9',
subscription: 'sub_1P0nmRDmVlmqORBIbTw0RGWC',
subscription_items: [
{
id: 'si_PqUlRbXcW2QnPX',
quantity: 2,
price: 'price_1Oyc62DmVlmqORBIaeesFUkm'
}
]
}
these are the params for invoicePreview
If you cancel the subscription now then I don't think there'll be a new invoice yeah?
I have 2 types of subscriptions.
Standard Subscriptions that users can make prorated refunds and i use
subscription_proration_behavior = 'create_prorations';
subscription_cancel_now = true;
Which works fine.
and i have Company Subscriptions in which i don't want to prorate them, i want to show the full price on invoiceUpcoming
The user cancels the subscription, cancel_on_period_end is true and then he wants to refund, he sees how much he gets back and hits refund button.
That's not how it works though, If you disable prorations that means you want stripe to charge the customer "full" amount.
Yes so if company subscription is 6.99$, when i want to preview the invoice if i cancel it, no matter when, i want to show 6.99$
In case of standard ones with
subscription_proration_behavior = 'create_prorations';
subscription_cancel_now = true;
will calculate and show 3$ depending on how much time passed
How can i show then the amount he will get back but full amount in the case of company subscription?
In that case, do you even need to call the upcoming invoice API?
You can just look at the subscription item and use it's amount no?
Yeah, i didn't want to change my refund modal, i wanted just to add 2 params. I thought it will work for full price if it works for prorated case
What amount are you seeing if you set subscription_proration_behavior: 'invoice_now' ?
Invalid subscription_proration_behavior: must be one of create_prorations, none, or always_invoice
ah whoops, i meant always_invoice
total: -1258
i get prorated.
My subscription is 1398 with quantity 2
{
customer: 'cus_Pq1Wd0DN6aRLr9',
subscription: 'sub_1P0nmRDmVlmqORBIbTw0RGWC',
subscription_cancel_now: true,
subscription_proration_behavior: 'always_invoice'
}
Are you still here?
Yup still here, was thinking about alternatives.
Like I mentioned earlier, proration doesn't really make sense for your usecase given you just want to refund the full price you charged the customer previously
So you'd need to look at the previous invoice and show that amount as refund amount