#sargis-cancel-subscription-dotnet

1 messages · Page 1 of 1 (latest)

jade sonnet
#

@midnight cosmos you can wrap your code between three ` (before after) and it makes it prettier/easier to read

#

If you want to refund, we recommend enabling proration instead and invoice now (the opposite of what you did really)

#

that will automatically calculate how much you owe them in credit and put it in their account balance

#

there's no easy way to refund that money to them. You will have to find their most recent payment and refund that one for up to the amount. If it was for less, you'd continue on the next one until you're done

#

it's a bit complex. But my advice, up to you though, is to not refund your customer

#

the majority of businesses say "keep access until the end of the period". They don't refund you

#

if you pay Netflix and cancel mid month, they just stop charging you, but they don't refund, they just remove your access at the end of the month

#

Does that make sense?

midnight cosmos
#

you can wrap your code between three ` (before after) and it makes it prettier/easier to read
If you want to refund, we recommend enabling proration instead and invoice now (the opposite of what you did really)
that will automatically calculate how much you owe them in credit and put it in their account balance

Is not this easy ? If i just need to set that params to true ?Will this solve the refund problem ? Or after this i have to do call refund api ?

#

i agree with you, though this is not my decision , it is business requirement from another person))

jade sonnet
#

I explained that it won't solve the issue

#

there's no easy way to refund that money to them. You will have to find their most recent payment and refund that one for up to the amount. If it was for less, you'd continue on the next one until you're done

#

so it does the math for you. But you still need to do the refund part

#

I would still push back on the requirements from that person.

#

use the Netflix argument or the Amazon prime one, it's really common

midnight cosmos
#

can i do it via payment intent id ?

#

like in docs ?

jade sonnet
#

You have to use a payment intent id. Like it's not optional. So you have to find their most recent payment intent, use that id and refund, and go to the next one if there's more to refund

midnight cosmos
#

Payment intent is gonna be created automatically when i create payment session with subscription mode ? sorry for dumb questions

jade sonnet
#

not dumb at all, there are a lot of separate API objects so it can be confusing

#

Basically a Subscription (sub_123) will renew say every month. Each month it creates an Invoice (in_123). That Invoice is associated with a PaymentIntent (pi_123) that represents the "state machine" of a payment (since it can fail the first time because of insufficient funds and succeed on the next attempt)

#

So yes when you use Checkout or PaymentLink, it will create all of that for you and then each month you get a new invoice

#

so if someone just paid $100 in their recent invoice say in_123 and the PaymentIntent is pi_ABC, then mid month they cancel, you owe them say $50. So you find their most recent PaymentIntent and refund it for $50

midnight cosmos
#

In short when i try to get subscription i did not find it in sub object , in session object that field was set to null. How'd you recommend to get the latest payment intent for that subscription ?

#

should i include some line items in the get request of subscription or payment session ?

jade sonnet