聚速通-话费、流量、加油卡、视频直充 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.
MIT