achais / jstopay
聚速通-话费、流量、加油卡、视频直充 SDK for PHP
dev-master
2020-06-18 08:34 UTC
Requires
- php: >=5.5.0
- ext-json: *
- ext-openssl: *
- guzzlehttp/guzzle: ~6.2
- monolog/monolog: ^1.22 || ^2.0
- pimple/pimple: ^3.0
- symfony/http-foundation: ~3.4.0 || ^4.0 || ^5.0
- symfony/psr-http-message-bridge: ^0.3 || ^1.0 || ^2.0
This package is auto-updated.
Last update: 2024-11-18 18:54:05 UTC
README
聚速通-话费、流量、加油卡、视频直充 SDK for PHP.
让你忽略第三方的 Http 请求规则、加密方式和加密实现, 只需关注自己的业务代码
安装
$ composer require achais/jstopay:dev-master -vvv
使用
配置信息和实例化
use Achais\JSTOPay\JSTOPay; $config = [ 'debug' => true, // 开启调试 'key' => 'ea0c81*************cc65c1', // 替换成你自己的 'user_id' => '8***0', // 替换成你自己的 // 日志 'log' => [ 'level' => 'debug', 'permission' => 0777, 'file' => '/tmp/jstopay-' . date('Y-m-d') . '.log', // 日志文件, 你可以自定义 ], ]; $jstopay = new JSTOPay($config);
不管使用什么功能, 配置信息和实例化 JSTOPay 是必须的
查询余额
use Achais\JSTOPay\JSTOPay; $config = []; // 配置信息如上 $jstopay = new JSTOPay($config); $ret = $jstopay->unicomAync->queryBalance(); 结果: Collection {#294 ▼ #items: array:5 [▼ "status" => "success" "desc" => "交易成功" "code" => "00" "balance" => 48830 "success" => true ] }
返回的是一个 Collection 对象, 或者为 null
文档
更多功能介绍请看源码或 Wiki.
贡献
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT