On a related note, you can look at hyperswitch [1], which is an open-source payment orchestrator that supports multiple payment processors. You can self-host it or they have a hosted version as well.
1. https://github.com/juspay/hyperswitch
(not affiliated with this project in any way)