Browse Source

debug pay

stanley-king 4 years ago
parent
commit
cdb5db081b
1 changed files with 7 additions and 0 deletions
  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->SetTrade_type("JSAPI");
         $input->SetOpenid($this->mOpenId);
         $input->SetOpenid($this->mOpenId);
         $input->SetSpbill_create_ip(util::real_ip());
         $input->SetSpbill_create_ip(util::real_ip());
+        Log::record("1",Log::DEBUG);
 
 
         $order = WxPayApi::unifiedOrder($input);
         $order = WxPayApi::unifiedOrder($input);
 
 
+        Log::record("2",Log::DEBUG);
+
         if(!array_key_exists("appid", $order)
         if(!array_key_exists("appid", $order)
             || !array_key_exists("prepay_id", $order)
             || !array_key_exists("prepay_id", $order)
             || $order['prepay_id'] == "")
             || $order['prepay_id'] == "")
         {
         {
+            Log::record("3",Log::DEBUG);
+
             throw new WxPayException("参数错误");
             throw new WxPayException("参数错误");
         }
         }
 
 
@@ -72,6 +77,8 @@ class jspay implements IPay
         $jsapi->SetPackage("prepay_id=" . $order['prepay_id']);
         $jsapi->SetPackage("prepay_id=" . $order['prepay_id']);
         $jsapi->SetSignType("MD5");
         $jsapi->SetSignType("MD5");
         $jsapi->SetPaySign($jsapi->MakeSign());
         $jsapi->SetPaySign($jsapi->MakeSign());
+        Log::record("4",Log::DEBUG);
+
 
 
         return array("data" => $jsapi->GetValues());
         return array("data" => $jsapi->GetValues());
     }
     }