我正在使用codeigniter,并想实现omnipay。我的开发环境是windows,我使用的是wamp server。经过一番努力,我安装了它,下载了composer,然后是curl,然后在httpd.conf中更改了访问控制。
现在我在使用omnipay的功能时遇到了问题。我已经用下面的代码创建了一个网关
echo 'testing the omnipay';
require 'Vendor/autoload.php';
use Omnipay\Common\GatewayFactory;
$gateway = GatewayFactory::create('PayPal_Express');
$gateway->setUsername('some_username');
$gateway->setPassword('some_password');
$gateway->setSignature('some_signature');
$gateway->setTestMode(true);我不确定如何继续下去
我想知道是否有正确使用omnipay的教程或在线文档
问候,Nandakumar
发布于 2013-09-13 05:45:46
设置创建网关后,您可以使用它进行购买。文档在Omnipay附带的自述文件中。
这里有一个例子:https://github.com/omnipay/omnipay#tldr
这里:https://github.com/omnipay/omnipay#gateway-methods
$response = $gateway->purchase(['amount' => '10.00', 'currency' => 'USD', 'card' => $formData])->send();
if ($response->isSuccessful()) {
// payment was successful: update database
print_r($response);
} elseif ($response->isRedirect()) {
// redirect to offsite payment gateway
$response->redirect();
} else {
// payment failed: display message to customer
echo $response->getMessage();
}https://stackoverflow.com/questions/18764780
复制相似问题