webtoucher / omnipay-interkassa
Omnipay支付处理库的InterKassa驱动程序
v1.0
2017-07-11 08:11 UTC
Requires
- php: >=5.4.0
- omnipay/common: ~2.0
Requires (Dev)
- omnipay/tests: ~2.0
This package is auto-updated.
Last update: 2024-09-23 20:11:20 UTC
README
InterKassa 是Omnipay PHP支付处理库的支付处理驱动程序。
安装
安装此库的首选方式是通过 composer。
运行以下命令:
$ php composer.phar require webtoucher/omnipay-interkassa "*"
或者将以下内容添加到您的 composer.json
文件的 require
部分:
"webtoucher/omnipay-interkassa": "*"
使用方法
此包提供了以下网关:
- InterKassa
$gateway = \Omnipay\Omnipay::create('InterKassa'); $gateway->setCheckoutId('[CHECKOUT_ID]'); $gateway->setSignKey('[SIGN_KEY]');
第一步是准备数据和重定向到InterKassa。以下是通过Privat 24进行支付的示例。
$request = $gateway->purchase([ 'amount' => $amount, 'currency' => 'UAH', 'transactionId' => $orderId, 'description' => "Some description (order $orderId)", 'interface' => 'web', 'action' => 'payway', 'payway' => 'privat24_liqpay_merchant3_uah', 'returnUrl' => "https://mydomain.com/payment/interkassa/success?order=$orderId", 'returnMethod' => 'GET', 'cancelUrl' => 'https://mydomain.com/payment/interkassa/cancel', 'cancelMethod' => 'GET', 'notifyUrl' => 'https://mydomain.com/payment/interkassa/notify', 'notifyMethod' => 'POST', ]); $response = $request->send(); if ($response->isRedirect()) { $response->redirect(); }
这是通知请求处理器。
$request = $gateway->completePurchase($_POST); $response = $request->send(); $orderId = $response->getTransactionId(); // You can check this order and mark it as paid. if ($response->isSuccessful()) { // Your handler } else { // Your handler }
有关一般使用说明,请参阅主要的 Omnipay 存储库。
支持
如果您在使用Omnipay时遇到一般性问题,我们建议在 Stack Overflow 上发表。请务必添加 omnipay 标签,以便更容易找到。
如果您想了解最新发布公告、讨论项目想法或提出更详细的问题,还可以订阅 邮件列表。
如果您认为发现了错误,请使用 GitHub 问题跟踪器 报告。