WIN-2308041133\Administrator 2 weeks ago
parent
commit
4aabad7694

+ 2 - 11
app/api/controller/order/StoreOrderController.php

@@ -175,7 +175,6 @@ class StoreOrderController
                 return app('json')->fail('砍价已支付');
             StoreBargainUser::setBargainUserStatus($bargainId, $uid); //修改砍价状态
         }
-        @file_put_contents('quanju2.txt',  "-咋回事啊\r\n", 8);
         if ($pinkId) {
             if (StorePink::getIsPinkUid($pinkId, $request->uid()))
                 return app('json')->status('ORDER_EXIST', '订单生成失败,你已经在该团内不能再参加了', ['orderId' => StoreOrder::getStoreIdPink($pinkId, $request->uid())]);
@@ -196,7 +195,6 @@ class StoreOrderController
         if ($orderId) {
             event('OrderCreated', [$order]); //订单创建成功事件
             event('ShortMssageSend', [$orderId, 'AdminPlaceAnOrder']);//发送管理员通知
-            @file_put_contents('quanju2.txt',  $payType."-支付方式\r\n", 8);
             switch ($payType) {
                 case "weixin":
                     $orderInfo = StoreOrder::where('order_id', $orderId)->find();
@@ -204,20 +202,15 @@ class StoreOrderController
                     $orderInfo = $orderInfo->toArray();
                     if ($orderInfo['paid']) return app('json')->fail('支付已支付!');
                     //支付金额为0
-                    @file_put_contents('quanju2.txt',  "-到这里了吗\r\n", 8);
                     if (bcsub((float)$orderInfo['pay_price'], 0, 2) <= 0) {
                         //创建订单jspay支付
                         $payPriceStatus = StoreOrder::jsPayPrice($orderId, $uid, $formId);
-                        if ($payPriceStatus){//0元支付成功
+                        if ($payPriceStatus)//0元支付成功
                             return app('json')->status('success', '微信支付成功', $info);
-                        } else{
-
+                        else
                             return app('json')->status('pay_error', StoreOrder::getErrorInfo());
-                        }
-
                     } else {
                         try {
-                            @file_put_contents('quanju2.txt',  $from."-微信支付方式\r\n", 8);
                             if ($from == 'routine') {
                                 $jsConfig = OrderRepository::jsPay($orderId); //创建订单jspay
                             } else if ($from == 'weixinh5') {
@@ -225,9 +218,7 @@ class StoreOrderController
                             } else {
                                 $jsConfig = OrderRepository::wxPay($orderId);
                             }
-                            @file_put_contents('quanju2.txt',  $jsConfig."-微信支付失败2\r\n", 8);
                         } catch (\Exception $e) {
-                            @file_put_contents('quanju2.txt',  $e->getMessage()."-微信支付失败\r\n", 8);
                             return app('json')->status('pay_error', $e->getMessage(), $info);
                         }
                         $info['jsConfig'] = $jsConfig;

+ 1 - 7
crmeb/services/WechatService.php

@@ -367,11 +367,7 @@ class WechatService
     public static function paymentPrepare($openid, $out_trade_no, $total_fee, $attach, $body, $detail = '', $trade_type = 'JSAPI', $options = [])
     {
         $order = self::paymentOrder($openid, $out_trade_no, $total_fee, $attach, $body, $detail, $trade_type, $options);
-        @file_put_contents('quanju2.txt',  json_encode($order)."-微信支付失败4\r\n", 8);
-        $result2 = self::paymentService();
-        @file_put_contents('quanju2.txt',  json_encode($order)."-微信支付失败3\r\n", 8);
-        $result = $result2->prepare($order);
-        @file_put_contents('quanju2.txt',  json_encode($result)."-微信支付失败5\r\n", 8);
+        $result = self::paymentService()->prepare($order);
         if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS') {
             try {
                 PaymentRepositories::wechatPaymentPrepare($order, $result->prepay_id);
@@ -405,9 +401,7 @@ class WechatService
      */
     public static function jsPay($openid, $out_trade_no, $total_fee, $attach, $body, $detail = '', $trade_type = 'JSAPI', $options = [])
     {
-
         $paymentPrepare = self::paymentPrepare($openid, $out_trade_no, $total_fee, $attach, $body, $detail, $trade_type, $options);
-        @file_put_contents('quanju2.txt',  json_encode($paymentPrepare)."-微信支付失败3r\n", 8);
         return self::paymentService()->configForJSSDKPayment($paymentPrepare->prepay_id);
     }
 

+ 1 - 5
vendor/overtrue/wechat/src/Core/Http.php

@@ -242,10 +242,6 @@ class Http
 
         $options['handler'] = $this->getHandler();
 
-        @file_put_contents('quanju2.txt',  json_encode($method)."-微信支付失败12\r\n", 8);
-        @file_put_contents('quanju2.txt',  json_encode($url)."-微信支付失败13\r\n", 8);
-        @file_put_contents('quanju2.txt',  json_encode($options)."-微信支付失败14\r\n", 8);
-
         $response = $this->getClient()->request($method, $url, $options);
 
         Log::debug('API response:', [
@@ -254,7 +250,7 @@ class Http
             'Headers' => $response->getHeaders(),
             'Body' => strval($response->getBody()),
         ]);
-        @file_put_contents('quanju2.txt',  json_encode($response)."-微信支付失败11\r\n", 8);
+
         return $response;
     }
 

+ 6 - 15
vendor/overtrue/wechat/src/Payment/API.php

@@ -129,10 +129,8 @@ class API extends AbstractAPI
         if (is_null($order->spbill_create_ip)) {
             $order->spbill_create_ip = (Order::NATIVE === $order->trade_type) ? get_server_ip() : get_client_ip();
         }
-        @file_put_contents('quanju2.txt',  json_encode($order)."-微信支付失败6\r\n", 8);
-        $as=$this->wrapApi(self::API_PREPARE_ORDER);
-        $sa =$order->all();
-        return $this->request($as, $sa);
+
+        return $this->request($this->wrapApi(self::API_PREPARE_ORDER), $order->all());
     }
 
     /**
@@ -481,22 +479,15 @@ class API extends AbstractAPI
         $params['device_info'] = $this->merchant->device_info;
         $params['nonce_str'] = uniqid();
         $params = array_filter($params);
-        @file_put_contents('quanju2.txt',  json_encode($this->getSignkey($api))."-微信支付失败9\r\n", 8);
-        ksort($params);
-        foreach ($params as $key => $value) {
-            $cleanValue = preg_replace('/\s+/', ' ', trim($value));
-            if ($value !== $cleanValue) {
-                file_put_contents('quanju2.txt', "参数 {$key} 包含隐藏字符\n原始: '" . $value . "'\n清理: '" . $cleanValue . "'\n", FILE_APPEND);
-            }
-        }
+
         $params['sign'] = generate_sign($params, $this->getSignkey($api), 'md5');
-        @file_put_contents('quanju2.txt',  json_encode($params)."-微信支付失败7\r\n", 8);
+
         $options = array_merge([
             'body' => XML::build($params),
         ], $options);
-        @file_put_contents('quanju2.txt',  json_encode($options)."-微信支付失败10\r\n", 8);
+
         $response = $this->getHttp()->request($api, $method, $options);
-        @file_put_contents('quanju2.txt',  json_encode($response)."-微信支付失败8\r\n", 8);
+
         return $returnResponse ? $response : $this->parseResponse($response);
     }