Commit 8c52d1b8 authored by wanjilong's avatar wanjilong

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

parent f6f4dab6
...@@ -49,7 +49,7 @@ class Sdk { ...@@ -49,7 +49,7 @@ class Sdk {
} }
if(!empty($data['response']['code'])) { 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']; return $data['response'];
......
...@@ -17,7 +17,7 @@ use App\Services\pingxx\PingxxService; ...@@ -17,7 +17,7 @@ use App\Services\pingxx\PingxxService;
use App\Services\wallet\WalletService; use App\Services\wallet\WalletService;
use Helpers\Strategy; use Helpers\Strategy;
use Helpers\Sdk; use Helpers\Sdk;
use Helpers\Notice; use Api\PhpServices\Wechat\Msg;
use Yaf\Application; use Yaf\Application;
use App\Exception\custom\PayException; use App\Exception\custom\PayException;
...@@ -256,15 +256,26 @@ class PayService ...@@ -256,15 +256,26 @@ class PayService
$title = ''; $title = '';
} }
try{
//通知消息 //通知消息
$notice = [ $app_id = 'wx65e9ba99c333444f';
'title'=>$title, $template_id = 'EzOH2ZpfW-eUdFf9gzjZTAv-Z9PFmKHNsQ0VOGvvN7c';
'user_id'=>$pay_order['user_id'], $page_url = 'https://testwx.appgc.cn/%23/bpmp/ticket/my';
'time'=>date('Y-m-d'), $type = 1;
'order_id'=>$pay_order['order_id'], $param = [
'amount'=>round($pay_order['pay_amount'] / 100, 2), $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]; return ['pay_order_id' => $pay_order_id];
......
...@@ -35,11 +35,11 @@ ...@@ -35,11 +35,11 @@
"repositories": { "repositories": {
"api/php_utils":{ "api/php_utils":{
"type":"vcs", "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":{ "api/php_services":{
"type":"vcs", "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