【发布时间】:2013-10-28 19:22:07
【问题描述】:
我正在尝试使用Omnipay 来处理 Pin 支付交易,并拥有以下代码(与 example on the Pin website 几乎完全相同,并且包含我的秘密 API 密钥而不是“密钥”):
require_once __DIR__.'/vendor/autoload.php';
use Omnipay\Common\GatewayFactory;
$gateway = GatewayFactory::create('Pin');
$gateway->setApiKey('key');
$gateway->purchase([
'email' => 'customer@email.com',
'description' => 'Widgets',
'amount' => '49.99',
'currency' => 'USD',
'card_token' => 'card_nytGw7koRg23EEp9NTmz9w',
'ip_address' => '1.2.3.4'
])->send();
并得到以下错误:
致命错误:调用未定义的方法 Omnipay\Pin\Gateway::setApiKey()
我需要合法的“card_token”吗?这里的一个来自网站的示例 - 我只是希望它仍能在沙盒环境中处理交易。
【问题讨论】:
-
php 告诉你
Gateway类没有名称为setApiKey的方法