#bioworkflows
1 messages · Page 1 of 1 (latest)
How did you set up the customer balance, do you have an example you can share?
You should be able to modify the customer balance as explained here to reduce the amount due on invoices:
https://stripe.com/docs/billing/customer/balance#examples
Note this only applies to invoices, not one time payments
I call stripe.Customer.create_balance_transaction to directly credit the customer or when they redeem a giftcard.
I can see their balance from Customer.balance , and I can also adjust balance directly, but it appears better to keep a record of Charge and Refund for their purchases to avoid having two sets of records in the system (pay with card checkout session and direct balance adjustment).
There wouldn't be any actual charge/payment though, right?
Yes.
Since my system keeps tracks of Charge (obtained from Checkout Session and Payment Intent after successful checkout) and Refund, all I need is a valid Charge object that charges directly from customers' credit balance.
That's not how that works for customer credits -- the invoice and balance is adjusted, there's no charge/payment
OK. I am fine with creating an Invoice, but I would like Invoice.pay to happen silently when users have enough credit balance.
You'd see these as customer balance transactions debitting against that credit you set up
Right now the system requires customers to have a working payment method.
No. I removed all test data yesterday and changed the code since Invoice.pay did not work. I can try it again this weekend though.
Basically, I created (through API) InvoiceItem and Invoice. I then called Invoice.finalize and hoped that the credit balance would be applied (and it did not). I then called Invoice.pay but the system asks for a vlid payment method for the Customer. So essentially users have to register a credit card before they can use their credit balance, which I would like to avoid.
I then called Invoice.finalize and hoped that the credit balance would be applied (and it did not).
This should happen, and did during my testing just now
I was also able to call /pay for the draft invoice and it similar required no payment method
So I think it would be best to retry carefully and share a specific example invoice/request if it doesn't do what you expect
Thanks. Maybe I did something wrong. I will test again this weekend. Assuming Invoice.finalize will trigger a balance transaction, I can keep a record of Invoices as a source of Refund, which will reverse the balance adjustment, right?
The API says Refund -> charge: ID of the charge that was refunded. So to create a refund from the Invoice, the Invoice must have a Charge to start with. Hopefully Invoice.finalize will create a Charge.
If there is no actual payment required it will not create a payment intent/ charge, no. It will create customer balance transaction only.
There's no payment, so there is no "refund" possible
(assuming the credit covers the invoice entirely)
If you want to credit them back for the debited credit amount, you can issue a credit note against that paid invoice: https://stripe.com/docs/invoicing/dashboard/credit-notes