deniztezcan / omnipay-ingenico-epayments
Ingenico ePayments 驱动程序,用于 Omnipay PHP 支付处理库
1.1.2
2021-11-08 10:57 UTC
Requires
- league/omnipay: ^3
- nesbot/carbon: 2.*
- spatie/array-to-xml: 2.8.*|3.*.*
Requires (Dev)
- omnipay/tests: ^3
This package is auto-updated.
Last update: 2024-09-08 17:30:32 UTC
README
Ingenico ePayments 驱动程序(电子商务)用于 Omnipay PHP 支付处理库
Omnipay 3.x 是一个与框架无关、多网关的 PHP 5.6+ 支付处理库
目录
安装
Omnipay 通过 Composer 安装。
composer require deniztezcan/omnipay-ingenico-epayments:^1
进行支付
use Omnipay\Omnipay; $gateway = Omnipay::create('IngenicoePayments'); $gateway->setMode('test'); $gateway->setPSPID('PSID'); $gateway->setLanguage('nl_NL'); $gateway->setShaIn('SHAIN'); $gateway->setShaOut('SHAOUT'); $gateway->setHashing('SHA-1'); $request = $gateway->purchase([ 'amount' => 9999, 'currency' => 'EUR', 'returnUrl' => 'https://example.com/tmp/done', 'cancelUrl' => 'https://example.com/tmp/cancel', 'transactionId' => '1111111', 'description' => 'DESCRIPTION', 'paymentMethod' => 'PAYMENTMETHOD', 'card' => [ 'firstName' => 'firstName', 'lastName' => 'lastName', 'billingAddress1' => 'billingAddress1', 'postcode' => 'postcode', 'city' => 'city', 'phone' => 'phone', 'email' => 'email' ], 'customfields' => [ 'XX' => 'XX', ] ]); $response = $request->send(); $response->redirect();
您将被转移到 Ingenico 的电子商务页面。
完成支付
use Omnipay\Omnipay; $gateway = Omnipay::create('IngenicoePayments'); $gateway->setMode('test'); $gateway->setPSPID('PSID'); $gateway->setLanguage('nl_NL'); $gateway->setShaIn('SHAIN'); $gateway->setShaOut('SHAOUT'); $request = $gateway->completePurchase(['transaction' => $_GET]); $response = $request->send(); if ($response->isSuccessful()) { echo $response->getTransactionId(); }else{ echo $response->getError(); }
支持
如果您遇到 Omnipay 的一般问题,我们建议在 Stack Overflow 上发表帖子。请务必添加 omnipay 标签,以便易于查找。
如果您认为发现了错误,请使用 GitHub 问题跟踪器 报告,或者更好的做法是分支库并提交拉取请求。