Commit ea51e331 authored by wanjilong's avatar wanjilong

add: 增加微信通知

parent c1eaccf0
<?php
namespace Helpers;
use Helpers\Sdk;
/**
* Notice 相关操作
*/
class Notice {
public static function weChat($params) {
//interaction.index.wechat
$url = config('interface', 'interaction.index.wechat');
if (!$url) {
return true;
}
return Sdk::call($url, $params);
}
}
\ No newline at end of file
...@@ -17,6 +17,7 @@ use App\Services\pingxx\PingxxService; ...@@ -17,6 +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 Yaf\Application; use Yaf\Application;
use App\Exception\custom\PayException; use App\Exception\custom\PayException;
...@@ -226,6 +227,24 @@ class PayService ...@@ -226,6 +227,24 @@ class PayService
// 生成支付清分单 // 生成支付清分单
$this->make_order_clearing($ret['result']); $this->make_order_clearing($ret['result']);
//收集第一商品名称
if($this->order_items) {
$title = $this->order_items[0]['goods_name'] ?? '商品名称';
} else {
$title = '';
}
//通知消息
$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),
];
Notice::weChat($notice);
return ['pay_order_id' => $pay_order_id]; return ['pay_order_id' => $pay_order_id];
} }
......
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