【类 型】:fix
【主 题】:根据回调里面 的description字段 设置发布“订单更新”主题 【描 述】: [原因]:此字段记录的商铺id 所以 飞机操作地面端 会根据自己账号所在商铺 订阅到自己商铺的提示更新主题 [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
c60e68348f
commit
a736bc7b92
@ -61,7 +61,7 @@ class PayController extends PublicController
|
||||
//设置获取签名的订单参数
|
||||
$orderParameter = [
|
||||
'out_trade_no' => $order['order_sn'],
|
||||
'description' => $order['shop_id'], //商品名称
|
||||
'description' => $order['shop_id'], //这个字段用 商铺id 方便分类查询腾讯的支付订单,还有在回调时候发送“订单更新主题”的子主题区分
|
||||
'amount' => [
|
||||
'total' => $order['total_price'] * 100, //单位:分
|
||||
'currency' => 'CNY',
|
||||
@ -85,7 +85,7 @@ class PayController extends PublicController
|
||||
{
|
||||
// 实例化 Yansongda Pay
|
||||
$result = Pay::wechat($this->config)->callback();
|
||||
// 地面终端 和 小程序端的提示刷新信息
|
||||
|
||||
$this->publish('refreshQuestList/2dc23dcfecc05fb1', 1);
|
||||
try {
|
||||
// 验证成功,处理业务逻辑
|
||||
@ -97,6 +97,9 @@ class PayController extends PublicController
|
||||
// 更新订单
|
||||
$orderDb->where($where)->data($data)->save();
|
||||
}
|
||||
// 构建发布主题 并向地面终端提示刷新信息
|
||||
$topic = 'refreshQuestList/' . $result['resource']['ciphertext']['description'];
|
||||
$this->publish($topic, 1);
|
||||
} catch (\Exception $e) {
|
||||
// 捕获并记录可能的异常
|
||||
error_log('支付回调处理错误:' . $e->getMessage());
|
||||
|
Loading…
Reference in New Issue
Block a user