#aw-shreyas_unexpected
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/1291737678009598052
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
Hi ๐
before creating a new subscription, you could check if that user already had a subscription before that they cancelled, or if their payment method was already used in a Subscription before. and if so, prevent them from creating a subscription with a free trial.
Actually in my application there is a upgrade/downgrade feature so when go from free to paid (it is upgrade) but when go from paid to free its downgrade and we allow this downgrading functionality
got it, but it's completely up to you to prevent users from downgrading or upgrading. you have to do some checks on your end.
so to refund the amount Do I need to call any api explicitly ?
or if the subscription is deleted (cancelled) the stripe automatically refunds the charged amount ?
when a Subscription is cancelled, Stripe doesn't send any refund no. So you would need to create a new Refund: https://docs.stripe.com/api/refunds/create?lang=node
so basically refund the amount back to user should be done explicitly by calling API ?
if you want to refund the user, yes.
Actually this is first time in my app that user has downgraded to the free tier. So, now if I refund the amount manually, stripe wont do double refund rite
so meaning if paid subscription amount is $50, and if I refund the amount to user manually, there wont be refund processed like $100. Is my understanding correct ?
I'm sorry I don't really understand. what is your end goal here and what are you trying to do? a specific example would help, like:
- User subscribed to a monthly subscription for $5 per month
- Then user downgraded to a free trial on the 15th of the month
- Now I'd like to refund the user for the unused time, so $5/2 = $2.5
- Etc.
- User subscribed to a monthly subscription for $50 per month
- Then user downgraded to a free trial on the same day.
- Now I'd like to refund the user full amount.
- Since you said the stripe doesnot refund the amount, if I refund the user manually, only $50 will be refunded back rite ? not $100 ?
in this case in the Subscription you'll find an Invoice. In the Invoice you'll find a PayemntIntent. And then you create a refund for that PaymentIntent, and the user will be refunded $50.
I recommend testing this in test mode to make sure it works as expected.
So you are suggesting to not to do via manually ?
what do you mean by "manually"?
Not doing via API and going on the Stripe Dashboard, to that payment and clicking on Refund Amount Attached is the image
Since I need to test the API and it should work at that moment when user is downgrading.
Hi taking over here
You can do this via the api or dashboard doesn't matter
Up to you
Okay do we have any functionality related to pro rata ?
Sure thanks.
coming back to this question, so If I refund via dashboard only the $50 will be sent back to user rite ? which was charged not the double
just confirming with you since you know better than me ๐
ohh ok ok, Can i do a custom refund as well, meaning I dont want to use the pro rated refund but refund like $35, I need to jst create the refund on that payment Method ?
You control the amount you refund
At most it can be the payment amount
You can always do a partial refund
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yeah i need to do customized refund. Not the pro rated refund ๐
Yeah, so you'd just pass the payment intent id and the amount you want refunded