shaoguo 9 månader sedan
förälder
incheckning
697eefc3c8
4 ändrade filer med 12 tillägg och 25 borttagningar
  1. BIN
      hua_fei/.DS_Store
  2. 1 0
      hua_fei/index.php
  3. 1 1
      hua_fei/order.php
  4. 10 24
      hua_fei/pay.php

BIN
hua_fei/.DS_Store


+ 1 - 0
hua_fei/index.php

@@ -8,6 +8,7 @@ $type=trim($_SERVER['PATH_INFO']??"home",'/');
 
 //退出登录
 if(isset($_POST['a']) && strtolower($_SERVER['REQUEST_METHOD'])=="post" && $_POST['a']=='logout'){
+    header("Content-type: text/json; charset=utf-8");
 
        if(!session_unset())exit(json_encode(array("code"=>0,"msg"=>"退出登录失败")));
     exit(json_encode(array("code"=>1,"msg"=>"退出成功")));

+ 1 - 1
hua_fei/order.php

@@ -1,6 +1,6 @@
 <?php
 $user_id=$_SESSION['admin_id'];
-$stmit=$pdo->query("select * from recharge where user_id=".$user_id);
+$stmit=$pdo->query("select * from recharge where user_id=".$user_id." order by `id` desc");
 
 ?>
 <!doctype html>

+ 10 - 24
hua_fei/pay.php

@@ -23,10 +23,10 @@ $url .= "://" . $_SERVER['HTTP_HOST'];
 $request_data=[
     "mch_id"=>"tongue",
     "ptype"=>82,
-    "from_name"=>"测试",
+    "from_name"=>"充值",
     "order_sn"=>$order_sn,
     "money"=>$price,
-    "goods_desc"=>"测试",
+    "goods_desc"=>"充值",
     "client_ip"=>$_SERVER['REMOTE_ADDR']??"127.0.0.1",
     "format"=>"json",
     "notify_url"=>$url."/notify",
@@ -40,32 +40,18 @@ $request_data['key']="37cd2d09c84f6ff7f1d28960ef82c4e533a3c047";
 $request_data['sign']=md5(urldecode(http_build_query($request_data)));
 
 unset($request_data['key']);
-echo "<pre>";
-var_dump(http_build_query($request_data));
-var_dump($request_data);
-echo "</pre>";
-exit();
+//echo "<pre>";
+//var_dump(http_build_query($request_data));
+//var_dump($request_data);
+//echo "</pre>";
+//exit();
 
 //正式环境打开
-/*file_put_contents(date("Y-m-d").'pay.log',date("H:i:s")."请求:".http_build_query($request_data)."\r\n",FILE_APPEND);
+file_put_contents(date("Y-m-d").'pay.log',date("H:i:s")."请求:".http_build_query($request_data)."\r\n",FILE_APPEND);
 $res=curl_request("http://47.236.143.199/?c=Pay&".http_build_query($request_data),array(),"get",array("content-type: text/html"),false);
+file_put_contents(date("Y-m-d").'pay.log',date("H:i:s")."响应".$res."\r\n",FILE_APPEND);
 $res=json_decode($res,true);
-file_put_contents(date("Y-m-d").'pay.log',date("H:i:s")."响应".json_encode($res)."\r\n",FILE_APPEND);*/
-$res=json_decode('{
-"code": "1",
-"msg": "下单成功",
-"data": {
-"order_sn": "ZZHF20240126183436808",
-"ptype": "82",
-"ptype_name": "",
-"realname": null,
-"account": null,
-"money": "30",
-"bank": "",
-"branch_name": "",
-"qrcode": "https://hh5ad.hnapay.com/pay/order.shtml?orderId=2024012676093324&orderKey=e7e1e69242a234c3e766438b507b70a6f7b6cd2a"
-}
-}',true);
+
 if($res['code']!=1)exit(json_encode(['code'=>0,"msg"=>"下单失败"]));
 $statement=$pdo->exec("update recharge set `app_order_sn`='{$res['data']['order_sn']}' where id={$id}");