jrodella/payment-ws-api
Composer 安装命令:
composer require jrodella/payment-ws-api
包简介
SOAP WS API to call Lyra payment services in PHP based websites.
README 文档
README
Lyra payment WS API is an open source PHP API that allows making SOAP WS calls to secured payment services developped by Lyra Network inside e-commerce websites.
Requirements
PHP 5.3.0 and later.
Installation
Composer
You can install the API via Composer. Run the following command:
composer require lyranetwork/payment-ws-api
To use the API, use Composer's autoload:
require_once('vendor/autoload.php');
Manual Installation
If you do not wish to use Composer, you can download the latest release. Then, to use the API, include the init.php file.
require_once('/path/to/payment-ws-api/init.php');
Usage
try { $ctxMode = 'TEST'; $keyTest = '1111111111111111'; $keyProd = '2222222222222222'; $shopId = '12345678'; // proxy options if any $options = array( 'proxy_host' => 'host', 'proxy_port' => '3128', 'proxy_login' => 'login', 'proxy_password' => 'password' ); $wsApi = new \Lyranetwork\WsApi($options, $url); $wsApi->init($shopId, $ctxMode, $keyTest, $keyProd); // example of getPaymentDetails call $queryRequest = new \Lyranetwork\QueryRequest(); $queryRequest->setUuid($uuid); // a known transaction UUID $getPaymentDetails = new \Lyranetwork\GetPaymentDetails($queryRequest); $getPaymentDetails->setQueryRequest($queryRequest); $requestId = $wsApi->setHeaders(); $getPaymentDetailsResponse = $wsApi->getPaymentDetails($getPaymentDetails); $wsApi->checkAuthenticity(); $wsApi->checkResult( $getPaymentDetailsResponse->getGetPaymentDetailsResult()->getCommonResponse(), array( 'INITIAL', 'WAITING_AUTHORISATION', 'WAITING_AUTHORISATION_TO_VALIDATE', 'UNDER_VERIFICATION', 'AUTHORISED', 'AUTHORISED_TO_VALIDATE', 'CAPTURED', 'CAPTURE_FAILED' ) // pending or accepted payment ); } catch(\SoapFault $f) { log("[$requestId] SoapFault with code {$f->faultcode}: {$f->faultstring}.", Zend_Log::WARN); // friendly message here } catch(\UnexpectedValueException $e) { log("[$requestId] getPaymentDetails error with code {$e->getCode()}: {$e->getMessage()}.", Zend_Log::ERR); if ($e->getCode() === -1) { // manage authentication error here } elseif ($e->getCode() === 1) { // merchant does not subscribe to WS option } else { // manage other unexpected response here } } catch (Exception $e) { log("[$requestId] Exception with code {$e->getCode()}: {$e->getMessage()}", Zend_Log::ERR); // friendly message here }
License
Each Lyra payment WS API source file included in this distribution is licensed under GNU GENERAL PUBLIC LICENSE (GPL 3.0).
Please see LICENSE.txt for the full text of the GPL 3.0 license. It is also available through the world-wide-web at this URL: http://www.gnu.org/licenses/.
jrodella/payment-ws-api 适用场景与选型建议
jrodella/payment-ws-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「soap」 「payment」 「sdk」 「e-commerce」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jrodella/payment-ws-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jrodella/payment-ws-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jrodella/payment-ws-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
cURL and cURL based Soap-Client for PHP
A PHP client for the Salesforce SOAP API
A PSR-7 compatible library for making CRUD API endpoints
A Yii2 component for working with TurboSMS.ua SOAP service
Zend Framework 1 Soap package
NuSOAP PHP library re-packaged for Packagist/Composer
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2018-03-06