Comment by vivzkestrel

3 days ago

or maybe you dont abstract it away, let each payment api behave the way their service supports, add some common functions on top that users can use and for specific functions they always look for specific classes. Ex class Gateway { abstract function send(), abtstract function receive() } class Visa extends Gateway { send()...receive()..., otherVisaSupportedFunctions() } class MasterCard extends Gateway { ....}