定制 ligrila/redsys 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ligrila/redsys

Composer 安装命令:

composer require ligrila/redsys

包简介

BBVA Redsys Payment API implementation with new SHA2 HMAC-256 algorithm

README 文档

README

BBVA Redsys Payment API implementation with new SHA2 HMAC-256 algorithm

Install

composer require ligrila/redsys

Checkout Example

use Ligrila\Payment\Redsys;
use Ligrila\Payment\RedsysConfig;
use Ligrila\Payment\RedsysOrder;

$checkoutUrl = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$responseUrl = dirname($checkoutUrl).'/response.php';
$successUrl = dirname($checkoutUrl).'/success.php';
$errorUrl = dirname($checkoutUrl).'/error.php';

$config = new RedsysConfig(
    array(
        'debug' => true,
        'autoRedirect' => false,
        'checkoutLoading' => 'Click on checkout button',
        'checkoutText' => 'Checkout',
        'Ds_Merchant_MerchantCode' => '111111111',
        'Ds_Merchant_Terminal' => '2',
        'Ds_Merchant_Password' => 'password',
        'Ds_Merchant_MerchantURL' => $responseUrl,
        'Ds_Merchant_UrlOK' => $successUrl,
        'Ds_Merchant_UrlKO' => $errorUrl,

    )
);

$order = new RedsysOrder();
    $order->setAmount(100)
    ->setCurrency('GBP')  // ISO 4217 Code
    ->setProductDescription('product1');

$redsys = new Redsys($config);

$html = $redsys->checkout($order);

echo $html;

Parse Response Example

use Ligrila\Payment\Redsys;
use Ligrila\Payment\RedsysConfig;


$config = new RedsysConfig(
    array(
        'debug' => true,
        'autoRedirect' => false,
        'checkoutLoading' => 'Click on checkout button',
        'checkoutText' => 'Checkout',
        'Ds_Merchant_MerchantCode' => '111111',
        'Ds_Merchant_Terminal' => '2',
        'Ds_Merchant_Password' => 'password'

    )
);

$redsys = new Redsys($config);

$result = $redsys->parseResponse();


if ($result['accepted']) {
    //payment accepted
} else {
    //payment refused
}

统计信息

  • 总下载量: 30
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固