瀏覽代碼

修复支付问题

chenxiqiang 6 年之前
父節點
當前提交
b69daf744e
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. 3
    1
      manage-server/app/Http/Controllers/PaymentController.php

+ 3
- 1
manage-server/app/Http/Controllers/PaymentController.php 查看文件

81
         $app = app('wechat.payment');
81
         $app = app('wechat.payment');
82
         $response = $app->handlePaidNotify(function($message, $fail){
82
         $response = $app->handlePaidNotify(function($message, $fail){
83
             // 使用通知里的 "微信支付订单号" 或者 "商户订单号" 去自己的数据库找到订单
83
             // 使用通知里的 "微信支付订单号" 或者 "商户订单号" 去自己的数据库找到订单
84
-            list($order_type, $order_id) = spilt("_", $message['out_trade_no']);
84
+            $arrays = preg_split("/_/", $message['out_trade_no']);
85
+            $order_type = $arrays[0];
86
+            $order_id = $arrays[1];
85
             $order = CommonController::getRecord($order_type, $order_id);
87
             $order = CommonController::getRecord($order_type, $order_id);
86
 
88
 
87
             if (!$order || $order->paid_at) { // 如果订单不存在 或者 订单已经支付过了
89
             if (!$order || $order->paid_at) { // 如果订单不存在 或者 订单已经支付过了

Loading…
取消
儲存