Hey, I've found out that currently there is no way to just tell that some previously registered payment is a mistake (so, no payment was actually taken, it's just it was registered prematurely) using API. However, I've checked that this option is available using dashboard.
Having payments first confirmed and then failed is a pretty often case working with Direct Debit payments gateways using ChargeBee offline payments.
My suggestion would be:
1. (more proper one) Add a method to remove payments from invoices using API.
2. (a bit hacky) Add a "reverted" paymentMethod option for record refund to invoice API method.
Thank you for the feedback. I've raised it as a feature request for our Engineering team to consider when they take up API revamp in future. While we don't have an ETA at the moment, we're keeping a track of this internally to let you know when it's released.
Having said that, could you let us know the reason behind processing Direct Debit payments as Offline payments? We now support GoCardless in the EU region so that customers can use Direct Debit as a payment method. Any reason why this wouldn't work for you?