diff --git a/mobile/plugins/payment/wxpay.php b/mobile/plugins/payment/wxpay.php index de32332..30cc138 100755 --- a/mobile/plugins/payment/wxpay.php +++ b/mobile/plugins/payment/wxpay.php @@ -181,6 +181,9 @@ class wxpay $new_plugin = new dalianpay(); $response_data = $new_plugin->pay($this->encrypt($_SESSION['openid']), $order['order_sn'], $order_amount); // echo $response_data; + $response_data = json_decode($response_data); + $prepay_id = $response_data['payinfo']['prepay_id']; + echo "prepay_id: " . $prepay_id; // echo "1234"; // 处理dalianpay统一支付接口传回的参数 @@ -196,7 +199,7 @@ class wxpay $this->setParameter("notify_url", __URL__ . 'wxpay.php'); // 通知地址 $this->setParameter("trade_type", "JSAPI"); // 交易类型 - $prepay_id = $this->getPrepayId(); // 要通过大连支付接口获取到 + // $prepay_id = $this->getPrepayId(); // 要通过大连支付接口获取到 $jsApiParameters = $this->getParameters($prepay_id); // wxjsbridge $js = ' diff --git a/mobile/source/helpers/dalianpay/demo/dalianpay.php b/mobile/source/helpers/dalianpay/demo/dalianpay.php index 271d343..0842c55 100644 --- a/mobile/source/helpers/dalianpay/demo/dalianpay.php +++ b/mobile/source/helpers/dalianpay/demo/dalianpay.php @@ -94,6 +94,7 @@ class dalianpay{ 'version' => '11', 'trxamt' => '600', // total_fee 'reqsn' => uniqid($reqsn_prefix), // 交易订单号 + // 'reqsn' => $reqsn, // 交易订单号 'producp' => 'JX0002', 'transtype' => 'JSP501', // 微信支付 'paytype' => 'W02', // 微信js支付 @@ -107,7 +108,7 @@ class dalianpay{ // 生成签名 $sign = $Base->Crypt->makeSign($trade_data); - echo $sign . "\r\n"; + // echo $sign . "\r\n"; if($sign === false) { // echo $Base->Crypt->err_msg; @@ -123,7 +124,7 @@ class dalianpay{ // 加密交易报文 $crypted_trade_data = $Base->Crypt->encryptTradeData($trade_data); - echo $crypted_trade_data . "\r\n"; + // echo $crypted_trade_data . "\r\n"; if($crypted_trade_data === false) { // echo $Base->Crypt->err_msg; @@ -141,7 +142,7 @@ class dalianpay{ // echo "\r\n"; // var_dump($api_url); $response = $Base->Request->send($api_url, $crypted_trade_data, $sign); - echo $response . "\r\n"; // sc_test + // echo $response . "\r\n"; // sc_test if($response === false) { // echo $Base->Request->err_msg; @@ -166,7 +167,7 @@ class dalianpay{ // 解密响应密文 $response_data = $Base->Crypt->decryptTradeData($response_data_crypted); - echo $response_data . "\r\n"; + // echo $response_data . "\r\n"; if($response_data === false) { // echo $Base->Crypt->err_msg;