#anoush_72862
1 messages · Page 1 of 1 (latest)
No, it won't be refunded, it will be added to you customer's credit balance. https://stripe.com/docs/billing/customer/balance
what will happen when the customer is deleted?
No you can't delete a customer if its credit balance is not 0
how handle cases when user has positive credit balance but want to cancel subscription?
What do you want to achieve? do you want to refund the customer?
You need to implement the following
- Retrieve the Customer's Credit Balance and/or sum pending invoice items
- Using the List Invoices API, pass the Subscription ID in the subscription parameter to view Invoices for that Subscription ID only
- You'll then need to expand the associated charge
- Then, for each invoice:
- Locate the associated charge
- Create a refund for up to the amount of the Customer's Credit Balance
- If the charge amount is smaller than the credit, refund the full credit amount and minus the charge amount
- Move to the next invoice in the list until the full credit has been refunded
- Update the customer’s account balance back to $0.00 via the API, by deleting the pending invoice items, or by modifying the balance directly through the Dashboard