我一直在使用这段代码一段时间,但仍然无法弄清楚它有什么问题。
也许某些代码有问题,但 Omnipay 没有显示任何错误消息。
谁能帮我找出我的错误?
$gateway = Omnipay::create('Eway_RapidDirect');
write_log($gateway->getDefaultParameters());
$gateway->initialize([
'apiKey' => 'API KEY',
'password' => 'PASSWORD',
'testMode' => true
]);
$card = new CreditCard([
'number' => '4444333322221111',
'expiryMonth' => '6',
'expiryYear' => '2030',
'cvn' => '123'
]
);
$transaction = $gateway->purchase([
'amount' => '10.00',
'currency' => 'AUD',
'transactionId' => 'RAM0001',
'card' => $card,
]
);
$response = $transaction->send();
if ($response->isSuccessful()) {
write_log('success');
} else {
write_log('failed');
write_log($response->getMessage());
}
代码总是打印
[07-Aug-2018 09:07:01 UTC] failed
[07-Aug-2018 09:07:01 UTC]
插件github:Omnipay Eway