descom/omnipay-redsys
最新稳定版本:v1.5.0
Composer 安装命令:
composer require descom/omnipay-redsys
包简介
Redsys driver for Omnipay
README 文档
README
Redsys driver for Omnipay
Instalation
composer require descom/omnipay-redsys
Basic Usage
Create purchase request
use Omnipay\Omnipay; $gateway = Omnipay::create('Redsys'); $gateway->initialize([ 'merchantCode' => '999008881', 'merchantTerminal' => '1', 'merchantSignatureKey' => 'sq7HjrUOBfKmC576ILgskD5srU870gJ7', 'testMode' => true, ]); $request = $gateway->purchase([ 'amount' => 12.50, 'description' => 'Test purchase', 'transactionId' => 1, 'notifyUrl' => 'http://localhost:8080/gateway/notify', ])->send(); $response->redirect();
Create purchase request with Bizum
use Omnipay\Omnipay; $gateway = Omnipay::create('Bizum'); $gateway->initialize([ 'merchantCode' => '999008881', 'merchantTerminal' => '1', 'merchantSignatureKey' => 'sq7HjrUOBfKmC576ILgskD5srU870gJ7', 'testMode' => true, 'merchantPaymethods' => 'z', ]); $request = $gateway->purchase([ 'amount' => 12.50, 'description' => 'Test purchase', 'transactionId' => 1, 'notifyUrl' => 'http://localhost:8080/gateway/notify', ])->send(); $response->redirect();
Complete purchase request
use Omnipay\Omnipay; $gateway = Omnipay::create('Redsys'); $gateway->initialize([ 'merchantCode' => '999008881', 'merchantTerminal' => '1', 'merchantSignatureKey' => 'sq7HjrUOBfKmC576ILgskD5srU870gJ7', 'testMode' => true, ]); $request = $this->gateway->completePurchase(); /* Redsys notification payment $_POST = [ 'Ds_SignatureVersion' => 'HMAC_SHA256_V1', 'Ds_MerchantParameters' => '...', 'Ds_Signature' => '...', ]; */ $redsysNotificationData = $_POST; $response = $request->sendData($redsysNotificationData); if ($response->isSuccessful()) { // $dsOrder = $response->transactionId(); // $dsAuthorizationCode = $response->transactionReference(); } else { // $dsResponse = $response->getCode(); }
统计信息
- 总下载量: 4.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-09