You don't need to change anything inside the vendor/
directory.
Just create a class \Omnipay\MyGateway\Gateway
in your regular src/lib directory, and make sure it can be autoloaded by composer. Then you can use Omnipay\Omnipay::create('MyGateway')
to create an instance of the class (or simply call new \Omnipay\MyGateway\Gateway()
).