Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/herman-hang/qqpay
一个用PHP实现的QQ钱包支付SDK
https://github.com/herman-hang/qqpay
pay php qqpay
Last synced: about 1 month ago
JSON representation
一个用PHP实现的QQ钱包支付SDK
- Host: GitHub
- URL: https://github.com/herman-hang/qqpay
- Owner: herman-hang
- Created: 2021-06-03T06:44:49.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-19T09:08:48.000Z (over 3 years ago)
- Last Synced: 2024-04-28T04:50:15.433Z (7 months ago)
- Topics: pay, php, qqpay
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 安装
```php
composer require xiaohang/qqpay
```
## 代码演示```php
$qqArr = [
"mch_id" => $qqPayInfo['qqpay_mchid'],//商户号
"notify_url" => $request->domain().url("Palymat/test"),//异步通知回调地址
"key" => $qqPayInfo['qqpay_key'],//商户key
];
$param = [
"out_trade_no" => trade_no(),// 订单号
"trade_type" => "NATIVE",// 固定值
"total_fee" => $info['moneys'],// 单位为分
"body" => $info['title'],//订单标题
];
//实例化
$qq = new \qqpay\QQPay($qqArr);
//下单操作
$unified = $qq->unifiedOrder($param);
if($unified["return_code"] == "SUCCESS" && $unified["result_code"] == "SUCCESS")
{
//订单逻辑实现
}
```