Omnipay how to add new gateway

余生长醉 提交于 2020-01-03 13:35:49

问题


Does anyone know how I could add a new payment gateway to Omnipay?

I read the blog https://groups.google.com/forum/#!topic/omnipay/j7OeQQSB95A

I followed the following steps:

  1. Cloned the Omnipay repository using composer
  2. Inside the vendor/Omnipay/ directory, added the new directory layout as per the stripe example

Now when am now trying to include my gateway, I see the following error:

SCREAM: Error suppression ignored for
( ! ) Fatal error: Class '\Omnipay\Mygateway\Gateway' not found in 
C:\wamp\www\root\omnipay\vendor\omnipay\common\src\Omnipay\Common\GatewayFactory.php on line 79

回答1:


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()).



来源:https://stackoverflow.com/questions/22216904/omnipay-how-to-add-new-gateway

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!