|
@@ -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}");
|
|
|
|