#saurabh-subscription
1 messages · Page 1 of 1 (latest)
hello @burnt depot!
Stripe doesn't automatically refund that amount to your customers’ card. The credit ends up on your customer’s balance instead.
You'll need to
- cancel the subscription [0] with
prorate=trueandinvoice_now=true - Look at the credit in the customer's balance [1] and/or sum pending invoice items
- Use the List Invoices API [2] and pass the subscription id in the subscription parameter to only view Invoices for that subscription. Also expand [3] the associated charge if any. 4) For each invoice:
Check if there’s an associated charge.
If so, create a refund for up to the amount of the account balance
If the charge amount is smaller than the credit, refund fully and subtract the charge amount from the credit
Move to the next invoice in the list until the full credit has been refunded - Update the customer’s balance back to 0 via the API [4] and/or delete the pending invoice items.
[0] https://stripe.com/docs/api/subscriptions/cancel
[1] https://stripe.com/docs/api/customers/object#customer_object-balance
[2] https://stripe.com/docs/api/invoices/list
[3] https://stripe.com/docs/api/expanding_objects
[4] https://stripe.com/docs/api/customer_balance_transactions/create
Thank you, I will check these links
@brisk cedar this steps only for card or for Bank ACH too
it's the same for all payment methods
ok