浏览代码

Merge remote-tracking branch 'origin/jun' into liuxiangxin

liuxiangxin 4 月之前
父节点
当前提交
f8fba51d76
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 1 2
      app/Http/Controllers/Admin/Orders.php
  2. 5 4
      app/Http/Controllers/Api/WechatPay.php

+ 1 - 2
app/Http/Controllers/Admin/Orders.php

@@ -238,8 +238,7 @@ class Orders extends Auth{
         $id				= request('id',0);
         $orderInfo		= $Model->query()->find($id);
         if (!$orderInfo)    return json_send(['code'=>'error','msg'=>'订单不存在']);
-        //$params['out_trade_no']   =   (string)$orderInfo['snowflake_id'];
-        $params['out_trade_no']   =   '533370780159971652';
+        $params['out_trade_no']   =   (string)$orderInfo['snowflake_id'];
         $Snowflake = new Snowflake();
         $out_refund_no = $Snowflake->next();
         $params['out_refund_no']    =   (string)$out_refund_no;

+ 5 - 4
app/Http/Controllers/Api/WechatPay.php

@@ -46,8 +46,9 @@ class WechatPay extends Api{
         $result			= Mini::jscode2session($code);
         if (!$result['openid']) return json_send(['code'=>'error','msg'=>'获取openid失败','data'=>$result['error']]);
         $openid = $result['openid'];
+        $description    =   '鹏城征订-订单编号'.$orderInfo['snowflake_id'];
         $payment = new Payment();
-        return $payment->pay(['out_trade_no' => $orderInfo['snowflake_id'],'openid' => $openid,'description' => '开邻智教课程','total_price' => $orderInfo['pay_total']]);
+        return $payment->pay(['out_trade_no' => $orderInfo['snowflake_id'],'openid' => $openid,'description' => $description,'total_price' => $orderInfo['pay_total']]);
     }
 	
 	/**
@@ -95,7 +96,7 @@ class WechatPay extends Api{
         }catch (\Exception $e){
             Log::log('notify_wechat_pay', '错误getMessage:' . $e->getMessage());
         }
-        Log::log('notify_wechat_pay', '验签:' . $verifiedStatus.'验签inWechatpayTimestamp:' . $inWechatpayTimestamp.'验签verifiedStatus:' . $inWechatpayNonce);
+        Log::log('notify_wechat_pay', '验签:' . $verifiedStatus.'验签inWechatpayTimestamp:' . $inWechatpayTimestamp.'验签verifiedStatus:' . $inWechatpayNonce.'验签timeOffsetStatus:' . $timeOffsetStatus);
         if ($timeOffsetStatus && $verifiedStatus) {
             // 转换通知的JSON文本消息为PHP Array数组
             $inBodyArray = (array)json_decode($inBody, true);
@@ -277,7 +278,7 @@ class WechatPay extends Api{
         $inWechatpayNonce = $headers['wechatpay-nonce'][0];
         $inBody = $post_data;
         Log::log('notify_refund_wechat_pay', 'wechatpay-timestamp:' . $inWechatpayTimestamp);
-        $apiv3Key = Config('notify_refund_wechat_pay.APIV3');// 在商户平台上设置的APIv3密钥
+        $apiv3Key = Config('wechatpay.APIV3');// 在商户平台上设置的APIv3密钥
         // 根据通知的平台证书序列号,查询本地平台证书文件,
         $platformCertificateFilePath = Config('wechatpay.platformCertificate');
         $platformPublicKeyInstance = Rsa::from($platformCertificateFilePath, Rsa::KEY_TYPE_PUBLIC);
@@ -294,7 +295,7 @@ class WechatPay extends Api{
         }catch (\Exception $e){
             Log::log('notify_refund_wechat_pay', '错误getMessage:' . $e->getMessage());
         }
-        Log::log('notify_refund_wechat_pay', '验签:' . $verifiedStatus.'验签inWechatpayTimestamp:' . $inWechatpayTimestamp.'验签verifiedStatus:' . $inWechatpayNonce);
+        Log::log('notify_refund_wechat_pay', '验签:' . $verifiedStatus.'验签inWechatpayTimestamp:' . $inWechatpayTimestamp.'验签verifiedStatus:' . $inWechatpayNonce.'验签timeOffsetStatus:' . $timeOffsetStatus);
         if ($timeOffsetStatus && $verifiedStatus) {
             // 转换通知的JSON文本消息为PHP Array数组
             $inBodyArray = (array)json_decode($inBody, true);