浏览代码

debug pay

stanley-king 4 年之前
父节点
当前提交
cdb5db081b
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      helper/pay/jspay.php

+ 7 - 0
helper/pay/jspay.php

@@ -54,13 +54,18 @@ class jspay implements IPay
         $input->SetTrade_type("JSAPI");
         $input->SetOpenid($this->mOpenId);
         $input->SetSpbill_create_ip(util::real_ip());
+        Log::record("1",Log::DEBUG);
 
         $order = WxPayApi::unifiedOrder($input);
 
+        Log::record("2",Log::DEBUG);
+
         if(!array_key_exists("appid", $order)
             || !array_key_exists("prepay_id", $order)
             || $order['prepay_id'] == "")
         {
+            Log::record("3",Log::DEBUG);
+
             throw new WxPayException("参数错误");
         }
 
@@ -72,6 +77,8 @@ class jspay implements IPay
         $jsapi->SetPackage("prepay_id=" . $order['prepay_id']);
         $jsapi->SetSignType("MD5");
         $jsapi->SetPaySign($jsapi->MakeSign());
+        Log::record("4",Log::DEBUG);
+
 
         return array("data" => $jsapi->GetValues());
     }