Omnipay如何添加新网关 [英] Omnipay how to add new gateway
问题描述
有人知道如何向Omnipay添加新的支付网关吗?
Does anyone know how I could add a new payment gateway to Omnipay?
我阅读了博客 https://groups.google.com/forum/#!topic/omnipay/j7OeQQSB95A
我遵循以下步骤:
- 使用作曲家克隆Omnipay存储库
- 在vendor / Omnipay /目录中,按照条带示例添加新的目录布局
现在在尝试包含我的网关时,我看到以下错误:
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
推荐答案
您不需要更改 vendor /
目录中的任何内容。
You don't need to change anything inside the vendor/
directory.
J必须在常规src / lib目录中创建一个 \Omnipay\MyGateway\Gateway
类,并确保它可以由composer自动加载。然后,您可以使用 Omnipay\Omnipay :: create('MyGateway')
创建该类的实例(或直接调用 new \Omnipay \MyGateway\Gateway()
)。
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()
).
这篇关于Omnipay如何添加新网关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!