facestorept / omnipay-ifthenpay
适用于Omnipay PHP支付处理库的Ifthenpay驱动程序
1.0.0
2016-02-11 12:29 UTC
Requires
- omnipay/common: ~2.0
Requires (Dev)
- omnipay/tests: ~2.0
This package is not auto-updated.
Last update: 2024-09-21 15:58:32 UTC
README
这是Omnipay支付处理库的Ifthenpay网关
多邦科是葡萄牙的一种支付方式,允许客户通过银行参考号支付。此插件将允许您生成一个客户可以使用ATM或网上银行服务支付其订单的支付参考号。此插件使用葡萄牙可用的几个网关/服务之一,IfthenPay,并与该公司签订合同。更多信息请参阅Ifthenpay。
Composer配置
在您的composer.json
中将omnipay-ifthenpay包作为依赖项包含
"ifthenpay/omnipay-ifthen": "1.*"
安装
运行composer install
下载依赖项。
用法
创建MB参考
use Omnipay\Omnipay; //you should use our own 50 char length key $chaveAntiPhishing = "XXXXXX"; // Setup payment gateway $gateway = Omnipay::create('Ifthenpay'); $gateway->setEntidade("XXXXX"); $gateway->setSubEntidade("XXX"); $gateway->setCurrency('EUR'); $gateway->setChaveAntiPhishing($chaveAntiPhishing); $response = $gateway->purchase(['amount' => '100.99', 'transactionId' => '1'])->send(); if ($response->isSuccessful()) { // payment was successful: update database and store the transaction details $dadosMB = json_decode($response->getTransactionDetails()); echo "Entidade: ".$dadosMB->entidade; echo "<br/>Referencia: ".$dadosMB->transactionReference; echo "<br/>Valor: ".$dadosMB->valor; }
回调验证
$response = $gateway->completePurchase(array('transactionReference' => '995 000 109','amount' => '100.99','currency' => 'EUR', 'ChaveAntiPhishingCallback' => 'XXXXXX'))->send(); if ($response->isSuccessful()) { //Configured AntiPhishing key matches with the received AntiPhishing key //This means that the payment was made echo "Sucesso"; }