文件名称:PHP支付处理库Omnipay.zip
文件大小:14KB
文件格式:ZIP
更新时间:2022-08-05 02:45:25
开源项目
Omnipay 是一个PHP支付处理库。统一的API支持数十个网关。 示例代码: use Omnipay\Omnipay; $gateway = Omnipay::create('Stripe'); $gateway->setApiKey('abc123'); $formData = ['number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2016', 'cvv' => '123']; $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(); } 标签:Omnipay
【文件预览】:
omnipay-master
----.gitignore(56B)
----README.md(41KB)
----LICENSE(1KB)
----composer.json(838B)
----CONTRIBUTING.md(618B)
----.travis.yml(335B)