diff --git a/mobile/dalianpay/demo/pay.php b/mobile/dalianpay/demo/pay.php index 01c307f..1a8dd44 100644 --- a/mobile/dalianpay/demo/pay.php +++ b/mobile/dalianpay/demo/pay.php @@ -2,7 +2,8 @@ session_start(); $openid = $_SESSION['openid']; $redirect_url = $_SESSION['prev_url']; - unset($_SESSION['prev_url']); + var_dump($redirect_url); + // unset($_SESSION['prev_url']); // 加载基础类 require_once('../library/Base.php'); @@ -111,12 +112,12 @@ // echo "\r\n"; // echo "[response data(clear text)]: {$response_data}"; // die(); - // echo $response_data; + echo $response_data; $_SESSION['response_data_json'] = $response_data; // 调回之前的地址 - header("Location: $redirect_url"); - exit; + // header("Location: $redirect_url"); + // exit; ?> diff --git a/mobile/get_openid.php b/mobile/get_openid.php index 9c97b57..d601981 100644 --- a/mobile/get_openid.php +++ b/mobile/get_openid.php @@ -51,12 +51,6 @@ if (isset($_GET['code'])) { $response = json_decode($response); var_dump($response->openid); - - // $client = new \GuzzleHttp\Client(); - // $response = $client->request('GET', $token_url); - // $result = json_decode($response->getBody(), true); - // $openid = $result['openid']; - // // 在这里处理获取到的openid // echo $openid; } else { diff --git a/mobile/plugins/payment/wxpay.php b/mobile/plugins/payment/wxpay.php index cd9c597..ab6d63d 100755 --- a/mobile/plugins/payment/wxpay.php +++ b/mobile/plugins/payment/wxpay.php @@ -206,10 +206,12 @@ class wxpay // header('Location: https://www.baidu.com'); exit; // 终止当前脚本的执行,确保页面跳转生效 + + // 设置必填参数 // 根目录url $order_amount = $order['order_amount'] * 100; - $this->setParameter("openid", "$_SESSION[openid]"); // 商品描述 + $this->setParameter("openid", "$_SESSION[openid]"); // 用户openid $this->setParameter("body", $order['order_sn']); // 商品描述 $this->setParameter("out_trade_no", $order['order_sn'] . $order_amount . 'O' . $order['log_id']); // 商户订单号 $this->setParameter("total_fee", $order_amount); // 总金额