I'm just starting to use Lago (getlago.com) for this. I'm not affiliated with them, but it solves the need for me for an open-source payment-processor-agnostic billing system that can easily swap between processors while maintaining a single source of truth.