WIN-2308041133\Administrator 6 mesi fa
parent
commit
79008f045b
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      application/api/controller/Wechat.php

+ 3 - 2
application/api/controller/Wechat.php

@@ -127,7 +127,8 @@ class Wechat extends Api
             $app_id = Company::where('id', $cid)->value('wechat_appid');
 //            $mch_id = '1623907696';
             $mch_id = Company::where('id', $cid)->value('pay_weixin_mchid');
-
+            $key = Company::where('id', $cid)->value('pay_weixin_key');
+            @file_put_contents("quanju.txt", $key . "-签约内容\r\n", 8);
             $contract_code = $this->generateRandomString(12);
             $notify_url = Request::instance()->domain() . "/api/wechat/notify/" . $cid; //回调接口  $cid 企业id
 //            $num = time() + mt_rand(10, 999999) . '' . substr($msec, 2, 3);//生成随机数
@@ -166,7 +167,7 @@ class Wechat extends Api
             }
             $xml = substr($xml, 0, -1);
             @file_put_contents("quanju.txt", $xml . "-签约内容\r\n", 8);
-            $sign = $this->md5_sign($xml, '192006250b4c09247ec02edce69f6a2d');
+            $sign = $this->md5_sign($xml, $key);
             @file_put_contents("quanju.txt", $sign . "-签名\r\n", 8);
             $url = 'https://api.mch.weixin.qq.com/papay/entrustweb?' . $xml . '&sign=' . $sign;
             @file_put_contents("quanju.txt", $url . "-链接\r\n", 8);