I’m wondering if I’m misunderstanding the intended accounting model of this module.
Currently, when a Stripe charge is fully refunded (e.g. from the Stripe Dashboard), the original account.payment is modified: its amount becomes 0 and its state changes to failed.
From my point of view, a refund is a separate financial transaction rather than a change to the original payment. By modifying the payment, the fact that money was received and later refunded disappears from the payment history. With account_payment_clearing, the clearing move is also cancelled, so the invoice appears unpaid again.
Wouldn’t it be more appropriate to keep the original payment as succeeded and create an account.payment.stripe.refund (or equivalent) for refunds, including those initiated on Stripe?
Maybe I’m missing something about the intended design, so I’d appreciate some clarification before looking into a patch.