Commit 8c52d1b8 authored by wanjilong's avatar wanjilong

add: 增加支付成功发送微信通知

parent f6f4dab6
......@@ -49,7 +49,7 @@ class Sdk {
}
if(!empty($data['response']['code'])) {
throw new BaseException(['msg'=>$data['response']['reason'], 'code'=>$data['response']['code']]);
throw new BaseException(['msg'=>$data['response']['reason']??'', 'code'=>$data['response']['code']]);
}
return $data['response'];
......
......@@ -17,7 +17,7 @@ use App\Services\pingxx\PingxxService;
use App\Services\wallet\WalletService;
use Helpers\Strategy;
use Helpers\Sdk;
use Helpers\Notice;
use Api\PhpServices\Wechat\Msg;
use Yaf\Application;
use App\Exception\custom\PayException;
......@@ -256,15 +256,26 @@ class PayService
$title = '';
}
try{
//通知消息
$notice = [
'title'=>$title,
'user_id'=>$pay_order['user_id'],
'time'=>date('Y-m-d'),
'order_id'=>$pay_order['order_id'],
'amount'=>round($pay_order['pay_amount'] / 100, 2),
$app_id = 'wx65e9ba99c333444f';
$template_id = 'EzOH2ZpfW-eUdFf9gzjZTAv-Z9PFmKHNsQ0VOGvvN7c';
$page_url = 'https://testwx.appgc.cn/%23/bpmp/ticket/my';
$type = 1;
$param = [
$title,
$pay_order['order_id'],
round($pay_order['pay_amount'] / 100, 2),
date('Y-m-d'),
];
Notice::weChat($notice);
Msg::send($pay_order['user_id'], $app_id, $template_id, $page_url, $type, $param);
}catch (\Throwable $e) {
;
}
return ['pay_order_id' => $pay_order_id];
......
......@@ -35,11 +35,11 @@
"repositories": {
"api/php_utils":{
"type":"vcs",
"url":"https://gitlab.yidian-inc.com/bp/php_utils.git"
"url":"https://git.yidian-inc.com:8021/bp/php_utils.git"
},
"api/php_services":{
"type":"vcs",
"url":"https://gitlab.yidian-inc.com/bp/php_services.git"
"url":"https://git.yidian-inc.com:8021/bp/php_services.git"
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment