#mangle-subscription-previewchanges
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- mangle-subscription-refund, 1 day ago, 92 messages
- mangle8582, 2 days ago, 77 messages
- mangle8582, 4 days ago, 36 messages
mangle-subscription-previewchanges
@full sonnet if you put a Subscription on a trial period you basically lose all possibilities to simulate a proration during that period
So i need to get back to upgrading to yearly with prorations, so i could have the possibility to refund
But then i need to refund based on the prorated amount that was used besides the Monthly paid, hope it will work
I don't really understand what all of that could mean I'm sorry. Can you try and provide one clear end to end example with fake dates so that I understand? Please make sure to write all of this as one clear message (like your original question)
Sure
- I want to refund based on how much the user used the subscription in the last 14 days
- At the moment when I'm upgrading from Monthly to Yearly, I'm adding one year on top of the Monthly Subscription End Time (So if Monthly Start time is 16 Nov 2023, and End time is 16 Dec 2023, then when upgrading to Yearly it will be 16 Dec 2024, so 1 Year and 1 Month). Because otherwise user will have 1 year depending on when he upgraded, and he will loose the remaining Monthly time that he paid for and he will be angry.
- I cannot refund yearly now because it's trial
- If i'm doing prorated upgrade to Yearly, let's say User is on the last week of Monthly Subscription, and the Monthly Subscription is 5.99$ and Yearly is 59.99$, he will pay 57-58$. But after i upgrade it, i need to refund him for 14 days, but i need to refund him based on 57-58$ that he paid prorated, not 59.99$. Because he might be in the first week, and upgrade and then it's 54$ and i will need to refund him based on 54$.
Sorry this breaks my brain a bit all those numbers ๐
Ultimately once the Subscription is on a trial it is impossible to get proration calculation to work. You can not do this.
At the moment when I'm upgrading from Monthly to Yearly, I'm adding one year on top of the Monthly Subscription End Time
so you do this withtrial_endI assume right? If so then you lose all possibities of proration after that
Yea
Then i will remove it, but now why is upgrading to Yearly not taking into consideration the remaining time of Monthly by default? Users are loosing their Monthly paid time if they upgrade
By default we prorate which means we discount the yearly price by how much they are owed for the remaining monthly time.
Say you have a $10/month Price and a $100/year one
Jan 1st, they pay $10
Feb 1st: they pay $10 again
Feb 14: they want to switch to yearly
What we do is calculate how much you owe them (half a month for Feb 14-28) so $5 in credit. And they owe you $100 for the full year Feb 14 2023 - Feb 14 2024
So they owe you $95 total and that's all done
That's cool, so they will pay 95$. If they are on 28 Feb, they will pay 99$ or something.
But let's say after they pay 95$.
They upgraded to Yearly. And then they want a refund
When i'm using invoiceUpcoming, it will calculate with prortation on 95$ or full price?
So i can show the user how much can i refund them based on how much they used the subscription
By not upgrading to Yearly, and buying Yearly directly it's easy, you just prorate them from 100$ based on how much they used the subscription
if you do what I said (no trial) then yes it works totally fine
I'm sorry but that has no details to help you unfortunately. I don't really understand what you changed, what you tried, what you see, etc.
So i've upgraded to Yearly with prorations
Monthly 5.99$
Yearly: 54.00$
This is how it looks.
After that i want to refund but from 54.00$ not 59.99$ dollars and doing a stripe.invoiceUpcoming with:
customer: 'cus_OxOxYtIoFmDutZ',
subscription: 'sub_1OCsGfDmVlmqORBI99Xpn9hB',
subscription_proration_behavior: 'create_prorations',
subscription_cancel_now: true
I'm really sorry I'm so lost with the framing
Why would you want to refund anything after the upgrade?
They paid you the price difference, they are good for the rest of the year
Well, for anything they pay, by the law they have 14 days that they can refund
No matter if it's Monthly, Yearly or an Upgrade
Could not delete subscription with refund: sub_1OCsGfDmVlmqORBI99Xpn9hB with message Refund amount ($59.99) is greater than charge amount ($54.00)
I receive message on refund
Okay so this has ~nothing to do with the upgrade at that point then right?
I'm so confused, what does "delete subscription with refund" have to do with it. Is this your own error log?
YEah okay it must be so it's all working fine, you just misunderstood something
Yea, but sub_1OCsGfDmVlmqORBI99Xpn9hB with message Refund amount ($59.99) is greater than charge amount ($54.00) is from Stripe
If you want to refund $59.99 in this case you have to refund both payments separately.
No, i want to refund only 54.00, because that's what user paid
Look at your picture they paid $5.99 and then paid an extra $54. You can't just refund a random amount because of the way our product works. So you have to basically refund $54 fully first and then remember you still owe them $5.99 and refund the previous charge
I mean no they paid both in that case 3 seconds apart
Yea but what if 14 days pass on Monthly, they can't refund Monthly anymore, and they upgrade to Yearly, and they pay 57$
After they pay 57$ i need to prorate them 14 days on Upgraded Yearly
I think you're looking at this wrong really
The yearly price is $59.99, that's what you are making them pay, so the refund is based on that amount.
Yea but if 14 days pass on Monthly, they lost the ability to refund 5.99$, by law.
And if they upgrade afterwards they will pay 57-58$
I need to refund them based on 57-58$ because that's what they paid, the monthly time they already consumed it, i cannot refund them because they used my servers for half a month
no
I'm sorry but you look at this wrong
The yearly Price is what they paid. It's irrelevant that they paid less because they had paid before
Right now it's the same as if they paid the full $59.99 and you refunded them the monthly separately.
So they paid $59.99 on February 12 and they have until February 26 for a full refund (with proration between Feb 12 and Feb 26)
Yea but after 14 days, i don't want to refund them the Monthly anymore, because they used my servers.
They lost 2-3 dollars by using it 14 days.
If they upgrade from that point, i need to refund them in another 14 days for what they paid. Not full price again, because if they used the servers for 14 days they lost the ability to refund, so if they upgrade and pay 57-58$, i will refund them 59.99$ if they click on the button imediately and i will loose money. It's a breach
I'm really sorry but I'm confident you're looking at this completely wrong right now
What they did on the monthly is irrelevant. They aren't asking for a special on the monthly. The only reason they get credit is because that's how we do proration that's all. There's no way around it. You have to treat the yearly refund as if nothing happened before, because nothing did. They paid you a month, used part of it, you refunded them the part they didn't use becuase they switched to yearly. At that point it's all fully a new order/payment and the past doesn't come into account
So i need to refund them first the remaining time and charge them for 59.99$?
With prorations by default it's no refunding, it's another payment of 54.00
I mean they owe you $59.99 and you owe them $5.99 (monthly price they never used) and the sum of both is $54
Which is exactly the same as charging them $59.99 now and then refunding them $5.99
You're not using any TestClock or advancing time so you're misunderstanding most of it because you don't notice the proration I assume
Yea that's cool, but treat Monthly and Yearly as 2 products, because every product has a 14 day refund period in which they use the product.
You pay 5.99$, in 14th day before the button for refund dissapears you will get 2-3 dollars
You pay 5.99$ and wait 20 days. When you Upgrade to Yearly you will need to pay 57 dollars aprox.
But you cannot refund monthly because 14 days passed.
When you successfully upgrade to Yearly by paying 57 dollars, the stripe.invoiceUpcoming says 59.99$. And if the user is clicking imediately, he will get 59.99$, but he paid 57$, and he lost th ability to refund monthly because he passed 14 days
I'm sorry but I still believe that's what I am saying. What happened on the monthly is irrelevant at this point. It's just normal business to refund monthly when you switch to yearly, everyone does that
ultimately what you are trying to do is going to be impossible unless you do all the math yourself. So don't, trust our proration and it will all make this better financially by having more people switching to yearly
Okay, thank you!
I do get what you want but I don't think there's any world where it could work mathematically since it seems to special to you needs. So I recommend treating the upgrade overall as a win for your business already and if a few people play the game of monthly -> wait 20 days, realize you can't get a partial refund, upgrade to yearly to then get that partial refund higher, then that's fine, it's the cost of doing business and no different from people disputing those payments with their banks and the time you invest in fighting that.
I understand
But now with partial refund after default prorated after upgrading to yearly with 54.00$
const deletedSubscriptionFromStripe = await stripe.subscriptions.cancel(
subscriptionId,
{
invoice_now: true,
prorate: true
}
);
const nextInvoice = await stripe.invoices.finalizeInvoice(
deletedSubscriptionFromStripe?.latest_invoice
);
I get 59.99$ on the invoice, and when i try to refund i get the error that it's higher than 54.00$
that's wht I already explained in details earlier
Look at your picture they paid $5.99 and then paid an extra $54. You can't just refund a random amount because of the way our product works. So you have to basically refund $54 fully first and then remember you still owe them $5.99 and refund the previous charge
Yea, but don't forget about the partial refund, if they use the Yearly for 13 days, i need to refund them less
And i need to show them how much i refund them less with invoiceUpcoming
Based on how much they used the subscription
๐
You alreayd know how much you will refund them, you have that math done after the finalization
the error you get is not when you calculate it's when you try to really refund
I understand, so i have to make prorated yearly minus 5.99$
๐
I never said that so I'm really confused
You have everything you need already, we already tell you what to refund, all you need to do now is refund right?
What you are telling me to refund is not correct, after you pay 54.00$ by upgrading, the invoiceUpcoming is 59.99$ and starting to drop by the time you use it
const nextInvoice = await stripe.invoices.finalizeInvoice(
deletedSubscriptionFromStripe?.latest_invoice
);
This finalize invoice is showing 59.99$ after you pay 54.00$
I'm really sorry @full sonnet but we're really running in circles at this point
You did not pay $54. You paid $59.99 across two separate Invoices seconds apart
00:00 UTC I pay $5.99
00:01 UTC I realize I should have subscribed to the yearly Price, I upgrade and pay $54
01:00 UTC Irealize my partner paid already so I change my mind and cancel
I should get the full amount back it's been barely an hour
this is literally what we're doing with our math and it is definitely correct
Yea, but that means i have to remember the monthly payment intent and refund them both based on payment_intent
But then if i refund them partially, if they use the app, i need invoices.upcoming to see how much they used the subscription, so i can refund them less, because they used the servers
I have no idea what this means I;m sorry
Even if you use one hour
00:00 UTC I pay $5.99
00:01 UTC I realize I should have subscribed to the yearly Price, I upgrade and pay $54
01:00 UTC Irealize my partner paid already so I change my mind and cancel
You used Yearly for 59 minutes
Can you confirm that you agree that my math above is correct and as a customer. I should get a *full refund in that case
I mean sure 59 minutes out of a year
Let's say they want refund, you calculate and refund them 2 cents or something less
Cool perfect so you owe me back $59.97
So the math is already all fully working which is what I was explaining earlier a few times
Yea, cool, then why is Stripe showing me the error that i cannot refund them 59.97$ because i charged them for 54.00$
sadly it's because you aren't really reading what I am saying
you are convinced it's wrong and just quickly jump over.
Re-posting my earlier exact explanation
Look at your picture they paid $5.99 and then paid an extra $54. You can't just refund a random amount because of the way our product works. So you have to basically refund $54 fully first and then remember you still owe them $5.99 and refund the previous charge
I never said it'd be easy to implement such a complex refund flow. But it is definitely doable
That's why i was saying like:
- See what finalize invoice throws me, it's 59.99$ - the time he used
- Let's say it's 59.97 , you cannot refund 59.97 because it throws error. You refund them 53.97$.
Again just reading too quickly
- Refund $54
- Do $59.97 - $54 => $4.97 left
- Find the previous Invoice and refund
It's unfortunately crucial that you take the time to understand the overall products, the objects involved at each step, etc. Here you had 2 separate Invoices, each with their own PaymentIntent and successful Charge separately and you have to handle that in your Refund logic
It can get even more complex if discounts or multiple sequential upgrade/downgrade are involved
Yea, but i can just say to user that if he upgrades to Yearly he won't be able to refund the Monthly.
It's some cases after 14 days passed on Monthly that i don't want and i by law i don't have to refund him Monthly anymore
I mean sure, but then we're back to "this is impossible, calculate the proration yourself with your own math" in that case
I do think you're doing a mistake unfortunately. We've been going over this for a while and it's not the first thread bout this topic and I would recommend following my recommendation instead
I'm starting to become confused already because of this Yearly.
Partial refund is a must. User has 14 days to refund, you give him prorated refund back.
On Yearly it's starting to confuse me already. Because i need to prorate him based on how much he used Yearly, but he cannot get money back for Monthly.
I will think about this more.
It's really bad for bussiness to not prorate him if he uses the product/servers. And on Yearly Refund he can get money even if the Refund button on Monthly was hidden by that time, only by Upgrading to yearly, which is a "feature", to bypass the refund on Monthly.
It's a complicated thread. Thank you for your time and understanding.
I will think about it more. And review what we talked here
yeah I'm sorry but I am certain I am correct here. Our math is right, we prorate, it will all work perfectly fine and you are confused overall right now because of all the questions and how quickly you're testing without using Test Clocks to simulate the time going over
Yea, i will give it more testing. Thank you!