我使用 composer 来加载 Ominpay-nmi 所需的所有内容。我没有收到作曲家错误,但是当我运行时
use Omnipay\Omnipay;
$gatewayObj = Omnipay::create("NMI");
我收到消息 Fatal error: Uncaught exception 'Omnipay\Common\Exception\RuntimeException' with message 'Class '\Omnipay\NMI\Gateway' not found' in /home/ken/NetBeansProjects/tournament/vendor/omnipay/common/src /Omnipay/Common/GatewayFactory.php 第 105 行
我尝试按照建议创建一个空类
代码如下:
<?php
namespace Omnipay\myNMIGateway;
class Gateway {
//put your code here
}
作曲家代码
{
"name":"x/x",
"description":"autoload for tournament software",
"license":"",
"require": {
"php": ">=5.3.0",
"ext-curl": "*",
"ext-json": "*",
"paypal/rest-api-sdk-php" : "dev-master",
"mfauveau/omnipay-nmi": "~2.0",
"twilio/sdk": "dev-master",
"mailgun/mailgun-php": "dev-master",
"components/jqueryui":">=1.11.4",
"bacon/bacon-qr-code": "dev-master"
},
"autoload":{
"files":["tournamentConfig.php"],
"psr-4":{"mts\\classes\\":"classes",
"mts\\classes\\tables\\":"classes/tables/src",
"mts\\":"classes\\factories",
"mts\\":"classes\\data",
"mts\\":"classes\\view",
"mts\\":"classes\\keys",
"mts\\view\\":"view",
"mts\\model\\":"model"
}
}
}
任何特定于 NMI 和 Paypal 的示例(这将是我的下一个网关实现)将不胜感激。
谢谢
肯