bahiazul/redsys-virtual-pos
Composer 安装命令:
composer require bahiazul/redsys-virtual-pos
包简介
Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.
关键字:
README 文档
README
Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.
NOTE: This library its still under development and its functionality is subject to change.
Prerequisites
- PHP >=5.4.0 <8.0
Installation
Installation is recommended through Composer.
$ composer require bahiazul/redsys-virtual-pos
Sample
Go to the sample folder an run the following command in a terminal to start PHP's built-in web server:
# install dependencies
$ composer install
# start the server
$ php -S 0.0.0.0:8000
Then open your browser and go to here.
If you want to test the online (async) response, replace localhost with your public IP or hostname, making sure that your machine is accesible through the port 8000 (you can use another port if you want).
Usage
Basic usage:
use Bahiazul\RedsysVirtualPos\Message\WebRequest; use Bahiazul\RedsysVirtualPos\Field\Currency; use Bahiazul\RedsysVirtualPos\Field\TransactionType; $secret = 'Mk9m98IfEblmPfrpsawt7BmxObt98Jev'; $merchantCode = '999008881'; $terminal = '871'; // The Environment object holds connection details $env = new Bahiazul\RedsysVirtualPos\Environment\DevelopmentEnvironment(); $env->setSecret($secret); // Setup the Parameters for the Request $params['Amount'] = '145'; // €1,45 $params['Order'] = strval(time()); $params['MerchantCode'] = $merchantCode; $params['Currency'] = Currency::EUR; $params['TransactionType'] = TransactionType::STANDARD; $params['Terminal'] = $terminal; $params['MerchantName'] = 'Test Store'; // optional $params['ProductDescription'] = 'Product Description'; // optional $params['UrlOk'] = 'http://localhost:8000/success.php'; // optional $params['UrlKo'] = 'http://localhost:8000/failure.php'; // optional // Generate the Request $webRequest = new WebRequest($env); $webRequest->setParams($params); // Generate the form $submitBtn = "<p><input type='submit' value='Submit'></p>"; $wrForm = $webRequest->getForm([], $submitBtn); // Render the HTML form w/ Submit button echo $wrForm;
See sample/index.php and sample/response.php for more detailed examples.
Test
Run the following command in a terminal:
# install dependencies
$ composer install
# run the tests
$ phpunit
Changelog
See CHANGELOG.md
Authors
License
MIT
bahiazul/redsys-virtual-pos 适用场景与选型建议
bahiazul/redsys-virtual-pos 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 315 次下载、GitHub Stars 达 4, 最近一次更新时间为 2021 年 04 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「xml」 「payment」 「web」 「html」 「virtual」 「sermepa」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bahiazul/redsys-virtual-pos 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bahiazul/redsys-virtual-pos 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bahiazul/redsys-virtual-pos 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Model of a web-based resource
Load DOM document safety
Retrieve a WebResourceInterface instance over HTTP
Added a method to Laravel response for handling xml response and also converting Eloquent return to XML.
Selectize Theme for Bootstrap 4
Provides command to manage a web library directory
统计信息
- 总下载量: 315
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-05