payu/fx-client
Composer 安装命令:
composer require payu/fx-client
包简介
FX API PHP Client
README 文档
README
PHP client for FX API
Introduction
This is a PHP implementation of a HTTP client for accessing the FX API.
Installation
You can install the client by using composer:
composer require payu/fx-client-php:^1.0
You need at least PHP 5.6, having cURL with HTTPS support enabled.
Usage
To begin, you will need to provide your account Merchant Code and Secret Key. To do this, create a \PayU\FX\Config\MerchantCredentials configuration instance:
<?php use PayU\FX\Config\MerchantCredentials; require_once 'vendor/autoload.php'; $config = new MerchantCredentials( 'MY_CODE', 'MY_SECRET_KEY' );
Next, create the API client by providing the above config instance and the platform/country you are going to use (possible values: Platform::RO(), Platform::TR(), Platform::RU()):
<?php use PayU\FX\Client; use PayU\FX\Config\MerchantCredentials; use PayU\FX\Config\Platform; require_once 'vendor/autoload.php'; $config = new MerchantCredentials( 'MY_CODE', 'MY_SECRET_KEY' ); $platform = Platform::RO(); $client = new Client($config, $platform);
Every method of the FX client is throwing the PayU\FX\Exceptions\ClientException exception is something won't work as expected. For instance:
<?php use PayU\FX\Client; use PayU\FX\Config\MerchantCredentials; use PayU\FX\Config\Platform; use PayU\FX\Exceptions\ClientException; require_once 'vendor/autoload.php'; $config = new MerchantCredentials( 'MY_CODE', 'MY_SECRET_KEY' ); $platform = Platform::RO(); $client = new Client($config, $platform); try { $client->getAllFxRates('RON'); } catch (ClientException $e) { echo $e->getMessage(); }
More example code can be found in examples dir.
License
This library is licensed under Apache-2.0 license. Please see the LICENSE file.
payu/fx-client 适用场景与选型建议
payu/fx-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 06 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 payu/fx-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 payu/fx-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2018-06-19