Merge branch 'master' of http://111.229.174.37:3000/Food/food_server
This commit is contained in:
commit
0494b3651a
@ -86,23 +86,23 @@ class PayController extends PublicController
|
|||||||
{
|
{
|
||||||
// 实例化 Yansongda Pay
|
// 实例化 Yansongda Pay
|
||||||
$pay = Pay::wechat($this->config);
|
$pay = Pay::wechat($this->config);
|
||||||
try {
|
$callBackData = $pay->callback();
|
||||||
// 获取并验证回调数据
|
$this->publish('demo', json_encode($callBackData));
|
||||||
$callBackData = $pay->callback();
|
// try {
|
||||||
// 验证成功,处理业务逻辑
|
// // 获取并验证回调数据
|
||||||
if ($callBackData['trade_state'] == 'SUCCESS') {
|
// $callBackData = $pay->callback();
|
||||||
$where['order_sn'] = $callBackData['out_trade_no']; // 获取订单号
|
// // 验证成功,处理业务逻辑
|
||||||
$orderDb = D('order'); // 实例化订单模型
|
// if ($callBackData['trade_state'] == 'SUCCESS') {
|
||||||
$data['status'] = 'pending'; //付款状态
|
// $where['order_sn'] = $callBackData['out_trade_no']; // 获取订单号
|
||||||
//$data['pay_sn'] = $callBackData['transaction_id'];
|
// $orderDb = D('order'); // 实例化订单模型
|
||||||
//注意先简单测试一下还需要验证openid 金额等
|
// $data['status'] = 'pending'; //付款状态
|
||||||
$orderDb->where($where)->data($data)->save(); //更改订单
|
// $orderDb->where($where)->data($data)->save(); //更改订单
|
||||||
}
|
// }
|
||||||
} catch (\Exception $e) {
|
// } catch (\Exception $e) {
|
||||||
// 捕获并处理可能的异常
|
// // 捕获并处理可能的异常
|
||||||
// 可以记录错误日志以便排查问题
|
// // 可以记录错误日志以便排查问题
|
||||||
// error_log('支付回调错误:' . $e->getMessage());
|
// // error_log('支付回调错误:' . $e->getMessage());
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 返回成功响应给腾讯服务器,告知通知已处理
|
// 返回成功响应给腾讯服务器,告知通知已处理
|
||||||
return $pay->success();
|
return $pay->success();
|
||||||
|
Loading…
Reference in New Issue
Block a user