record_logs("Access Denied"); exit('Access Denied'); } } $pay_way = $apitype; if ($apitype == "swiftpass") { $apitype = "weixin"; } $pay = new \Think\Pay($pay_way, C($apitype)); if ($pay->verifyNotify($notify)) { //获取回调订单信息 $order_info = $pay->getInfo(); Log::write(serialize($order_info), Log::DEBUG); if ($order_info['status']) { $pay_where = substr($order_info['out_trade_no'], 0, 2); Log::write("PAY_SWI:".$pay_where, Log::DEBUG); $result = false; switch ($pay_where) { case 'SP': $result = $this->set_spend($order_info); break; case 'PF': $result = $this->set_deposit($order_info); break; case 'AG': $result = $this->set_agent($order_info); break; case 'TB': $result = $this->set_balance($order_info); $to_balance = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/Home/PromoteCoin/lists'; break; case 'BR': $result = $this->set_bind_recharge($order_info); break; case 'SI': $result = $this->set_order($order_info); break; case 'SS': // 超级签 $this->supersign_pay_notify(array( 'trade_id' => $order_info['trade_no'], 'order_id' => $order_info['out_trade_no'] )); break; default: exit('accident order data'); break; } if($result){ echo "success"; } if (I('get.method') == "return") { switch (I('get.model')) { case 'Home': if($to_balance) { redirect($to_balance); } else { redirect('http://' . $_SERVER['HTTP_HOST'] . '/index.php/Home/Charge/agent_pay_list'); } break; case 'Media': redirect('http://' . $_SERVER['HTTP_HOST'] . '/media.php/Member/users_index'); break; case 'Mobile': redirect('http://' . $_SERVER['HTTP_HOST'] . '/mobile.php/User/recharge'); break; default: redirect('http://' . $_SERVER['HTTP_HOST'] . '/media.php/Member/users_index'); break; } } else { $pay->notifySuccess(); } } else { $this->record_logs("支付失败!"); } } else { $this->record_logs("支付验证失败"); redirect('http://' . $_SERVER['HTTP_HOST'] . '/media.php', 3, '支付验证失败'); } } /** *微信回调 */ public function swiftpass_callback(){ $xml = file_get_contents('php://input'); $Swiftpass=new Swiftpass(C('weixin_gf.partner'),C('weixin_gf.key')); $Swiftpass->resHandler->setContent($xml); $Swiftpass->resHandler->setKey(C('weixin_gf.key')); if($Swiftpass->resHandler->isTenpaySign()){ if($Swiftpass->resHandler->getParameter('status') == 0 && $Swiftpass->resHandler->getParameter('result_code') == 0){ $pay_where = substr($Swiftpass->resHandler->getParameter('out_trade_no'),0,2); $order_info['trade_no']=$Swiftpass->resHandler->getParameter('transaction_id'); $order_info['out_trade_no']=$Swiftpass->resHandler->getParameter('out_trade_no'); $result = false; switch ($pay_where) { case 'SP': $result = $this->set_spend($order_info); break; case 'PF': $result = $this->set_deposit($order_info); break; case 'AG': $result = $this->set_agent($order_info); break; case 'TB': $result = $this->set_balance($order_info); break; case 'SI': $result = $this->set_order($order_info); break; default: exit('accident order data'); break; } echo 'success'; exit(); }else{ echo 'failure'; exit(); } }else{ echo 'failure'; } } /** *超级签微信充值回调 */ public function supersign_wxpay_notify(){ $xml = file_get_contents('php://input'); $Swiftpass=new Swiftpass(C('wei_xin.partner'), C('wei_xin.key')); $Swiftpass->resHandler->setContent($xml); $Swiftpass->resHandler->setKey( C('wei_xin.key')); if($Swiftpass->resHandler->isTenpaySign()){ if($Swiftpass->resHandler->getParameter('status') == 0 && $Swiftpass->resHandler->getParameter('result_code') == 0){ $trade_no=$Swiftpass->resHandler->getParameter('transaction_id'); $out_trade_no = $Swiftpass->resHandler->getParameter('out_trade_no'); $this->supersign_pay_notify(array( 'trade_id' => $trade_no, 'order_id' => $out_trade_no )); echo 'success'; }else{ echo 'failure'; } }else{ echo 'failure'; } } /** * 支付宝退款回调 * @return [type] [description] */ public function refund_validation() { if (empty($_POST)) { $this->record_logs("回调!"); } else { $pay = new \Think\Pay('alipay', C('alipay')); if ($pay->verifyNotify($_POST)) { //批次号 $batch_no = $_POST['batch_no']; //批量退款数据中转账成功的笔数 $success_num = $_POST['success_num']; if ($success_num > 0) { $map['batch_no'] = $batch_no; $date['tui_status'] = 1; $date['tui_time'] = time(); M('refund_record', 'tab_')->where($map)->save($date); file_put_contents(dirname(__FILE__)."/as.txt", json_encode(M('refund_record','tab_')->getlastsql())); $map_spend['pay_order_number'] = get_refund_pay_order_number($batch_no); $spen_date['sub_status']=1; $spen_date['settle_check']= 1; M('spend','tab_')->where($map_spend)->save($spen_date); } echo "success"; //请不要修改或删除 } else { //验证失败 echo "fail"; } } } /** *微信回调 */ public function wxpay_callback() { Log::write("timeout".time(), Log::DEBUG); $key = "sdk:paycallback_wx"; $ret = Redis::get($key); if ($ret) { Log::write("sdk:paycallback_wx 请求太频繁", Log::DEBUG); exit(); } Redis::set($key, 1, 3); // 3秒钟收一次请求 $values = array(); Vendor("WxPayPubHelper.WxPayPubHelper"); $weixin = A("WeiXin", "Event"); $request = file_get_contents("php://input"); $reqdata = $weixin->xmlstr_to_array($request); Log::write(serialize($reqdata), Log::DEBUG); if ($reqdata['return_code'] != 'SUCCESS') { $this->record_logs("return_code返回数据错误"); exit(); } else { $merchant = M('payment_merchant', 'tab_')->where([ 'identifier' => $reqdata['mch_id'] ])->find(); if (!$merchant) { $this->record_logs("找不到商户!".$reqdata['mch_id']); echo 'fail'; exit(); } $payConf = json_decode($merchant['config'], true); if ($_REQUEST['method'] == "notify2") {//sdk $Common_util_pub = new \Common_util_pub(C('wei_xin_app.email'), C('wei_xin_app.partner'), C('wei_xin_app.key')); } elseif ($_REQUEST['method'] == "notify3") { //app $Common_util_pub = new \Common_util_pub(C('wei_xin_apps.email'), C('wei_xin_apps.partner'), C('wei_xin_apps.key')); } elseif ($_REQUEST['method'] == "notify") {//扫码 // $Common_util_pub = new \Common_util_pub(C('wei_xin.email'), C('wei_xin.partner'), C('wei_xin.key')); $Common_util_pub = new \Common_util_pub($payConf['appid'], $payConf['partner'], $payConf['key']); } if ($Common_util_pub->getSign($reqdata) == $reqdata['sign']) { $pay_where = substr($reqdata['out_trade_no'], 0, 2); $data['trade_no'] = $reqdata['transaction_id']; $data['out_trade_no'] = $reqdata['out_trade_no']; $payService = new PayService(); if (!$payService->wechatTradeQuery($payConf, $data)) { sleep(1); // 延迟1s 在查一次 if (!$payService->wechatTradeQuery($payConf, $data)) { Log::write("WECHATQUERYFAIL->".serialize($data), Log::DEBUG); echo 'fail'; exit(); } } switch ($pay_where) { case 'SP'://充值游戏 if ($this->recharge_is_exist($reqdata['out_trade_no'])) { echo " "; exit(); } $result = $this->set_spend($data); if ($result) { echo " "; } else { echo " "; } break; case 'PF'://充值平台币 if ($this->deposit_is_exist($reqdata["out_trade_no"])) { echo " "; exit(); } $result = $this->set_deposit($data); if ($result) { echo " "; } else { echo " "; } break; case 'AG'://代充 if ($this->agent_is_exist($reqdata["out_trade_no"])) { echo " "; exit(); } $result = $this->set_agent($data); if ($result) { echo " "; } else { echo " "; } break; case 'TB'://代充 if ($this->balance_is_exist($reqdata["out_trade_no"])) { echo " "; exit(); } $result = $this->set_balance($data); if ($result) { echo " "; } else { echo " "; } break; case 'SI': if ($this->order_is_exist($reqdata["out_trade_no"])) { echo " "; exit(); } $result = $this->set_order($data); if ($result) { echo " "; } else { echo " "; } break; case 'BR'://充值绑币 if ($this->bind_recharge_is_exist($reqdata["out_trade_no"])) { echo " "; exit(); } $result = $this->set_bind_recharge($data); if ($result) { echo " "; } else { echo " "; } break; default: $this->record_logs("订单号错误!!"); break; } } else { $this->record_logs("支付验证失败"); redirect('http://' . $_SERVER['HTTP_HOST'] . '/front.php/Recharge/index.html', 3, '支付验证失败'); } } } /** * 竣付通回调 * @return [type] [description] */ public function jft_callback(){ if(!empty($_GET['model'])){ switch (I('get.model')) { case 'Home': redirect('http://' . $_SERVER['HTTP_HOST'] . '/index.php/Home/Charge/agent_pay_list'); break; case 'Media': redirect('http://' . $_SERVER['HTTP_HOST'] . '/media.php/Member/users_index'); break; case 'Mobile': redirect('http://' . $_SERVER['HTTP_HOST'] . '/mobile.php/User/recharge'); break; default: redirect('http://' . $_SERVER['HTTP_HOST'] . '/media.php/Member/users_index'); break; } exit; } @$p7_paychannelnum=$_POST['p7_paychannelnum']; if(empty($p7_paychannelnum)) { $p7_paychannelnum=""; } $signmsg=C('jft.key');//支付秘钥 @$md5info_paramet = $_REQUEST['p1_usercode']."&".$_REQUEST['p2_order']."&".$_REQUEST['p3_money']."&".$_REQUEST['p4_status']."&".$_REQUEST['p5_jtpayorder']."&".$_REQUEST['p6_paymethod']."&".$_REQUEST['p7_paychannelnum']."&".$_REQUEST['p8_charset']."&".$_REQUEST['p9_signtype']."&".$signmsg; $md5info_tem= strtoupper(md5($md5info_paramet)); $requestsign=$_REQUEST['p10_sign']; if ($md5info_tem == $_REQUEST['p10_sign']) { $order_info['trade_no'] = $_REQUEST['p5_jtpayorder']; $order_info['out_trade_no'] = $_REQUEST['p2_order']; $pay_where = substr($_REQUEST['p2_order'], 0, 2); switch ($pay_where) { case 'SP': $result = $this->set_spend($order_info); break; case 'PF': $result = $this->set_deposit($order_info); break; case 'AG': $result = $this->set_agent($order_info); break; default: exit('accident order data'); break; } //改变订单状态,及其他业务修改 echo "success"; //接收通知后必须输出”success“代表接收成功。 }else{ $this->record_logs("竣付通验证失败!!"); } } /** * 双乾回调 * @return [type] [description] */ public function sq_callback(){ $merNo = I('MerNo'); $amount = I('Amount'); $billNo = I('BillNo'); // 平台订单号 $orderNo = I('Orderno'); // 支付平台订单号 $succed = I('Succeed'); $result = I('Result'); $bankOrderNo = I('bankOrderNo'); $merRemark = I('MerRemark'); $md5Info = I('MD5info'); Log::write(serialize($_REQUEST), Log::DEBUG); $merchant = M('payment_merchant', 'tab_')->where([ 'identifier' => $merNo ])->find(); if (!$merchant) { $this->record_logs("找不到商户!".$merNo); echo 'fail'; exit(); } $payConf = json_decode($merchant['config'], true); $secret = strtoupper(md5($payConf['secret']));//支付秘钥 // 参与校验 $sign = strtoupper(md5("Amount={$amount}&BillNo={$billNo}&MerNo={$merNo}&Succeed={$succed}&{$secret}")); if ($md5Info == $sign) { $order_info['trade_no'] = $orderNo; $order_info['out_trade_no'] = $billNo; $order_info['money'] = $amount; $pay_where = substr($billNo, 0, 2); switch ($pay_where) { case 'SP': $result = $this->set_spend($order_info); break; case 'PF': $result = $this->set_deposit($order_info); break; case 'AG': $result = $this->set_agent($order_info); break; default: exit('accident order data'); break; } //改变订单状态,及其他业务修改 echo "success"; //接收通知后必须输出”success“代表接收成功。 }else{ $this->record_logs("双乾验证失败!!"); } } public function heepay_callback() { Log::write(serialize($_REQUEST), Log::DEBUG); $result = $_GET['result']; $pay_message = $_GET['pay_message']; $agent_id = $_GET['agent_id']; $jnet_bill_no = $_GET['jnet_bill_no']; $agent_bill_id = $_GET['agent_bill_id']; $pay_type = $_GET['pay_type']; $pay_amt = $_GET['pay_amt']; $remark = $_GET['remark']; $return_sign = $_GET['sign']; $merchant = M('payment_merchant', 'tab_')->where([ 'identifier' => $agent_id ])->find(); if (!$merchant) { $this->record_logs("找不到商户!".$agent_id); echo 'fail'; exit(); } $remark = iconv("GB2312", "UTF-8//IGNORE", urldecode($remark));//签名验证中的中文采用UTF-8编码; $signStr = ''; $signStr = $signStr . 'result=' . $result; $signStr = $signStr . '&agent_id=' . $agent_id; $signStr = $signStr . '&jnet_bill_no=' . $jnet_bill_no; $signStr = $signStr . '&agent_bill_id=' . $agent_bill_id; $signStr = $signStr . '&pay_type=' . $pay_type; $signStr = $signStr . '&pay_amt=' . $pay_amt; $signStr = $signStr . '&remark=' . $remark; $payConf = json_decode($merchant['config'], true); $signStr = $signStr . '&key=' . $payConf['secret']; //商户签名密钥 $sign = strtolower(md5($signStr)); if ($sign == $return_sign) { //比较签名密钥结果是否一致,一致则保证了数据的一致性 //商户自行处理自己的业务逻辑 $pay_where = substr($agent_bill_id, 0, 2); $data['trade_no'] = $_GET['jnet_bill_no']; $data['out_trade_no'] = $_GET['agent_bill_id']; switch ($pay_where) { case 'SP': $result = $this->set_spend($data); break; case 'PF': $result = $this->set_deposit($data); break; case 'AG': $result = $this->set_agent($data); break; default: exit('accident order data'); break; } echo 'ok'; } else { echo 'error'; //商户自行处理,可通过查询接口更新订单状态,也可以通过商户后台自行补发通知,或者反馈运营人工补发 } } /** * 金猪支付 * @return [type] [description] * @author cb <[email address]> */ public function goldpig_callback(){ //接口ID $UserID='357p';//此项固定为357p //接口密钥 $Key=C('goldpig.key');//此项需要您设置,和金猪平台一致 $ProID=$_POST['ProID'];//产品ID $OrderID=$_POST['OrderID'];//订单号 $Num=$_POST['Num'];//充值数量 $UserName=$_POST['UserName'];//充值账号或角色名 $Money=$_POST['Money'];//充值金额 $yuanbao=$_POST['yuanbao'];//货币数量 $Sign=$_POST['Sign'];//与金猪服务器通讯加密字符串 $fencheng=$_POST['fencheng'];//商户分成金额,适用于纯接口模式 $jinzhua=$_POST['jinzhua'];//预留回调1 $jinzhub=$_POST['jinzhub'];//预留回调2 $jinzhuc=$_POST['jinzhuc'];//预留回调3 $Str='UserID='.$UserID.'&ProID='.$ProID.'&OrderID='.$OrderID.'&Num='.$Num.'&yuanbao='.$yuanbao.'&UserName='.$UserName.'&Money='.$Money.'&Key='.$Key; $MySign=md5($Str); //验证是否合法 if($Sign==$MySign){ $pay_where = substr($jinzhua,0,2); $order_info['trade_no']=$OrderID; $order_info['out_trade_no']=$jinzhua; $result = false; switch ($pay_where) { case 'SP': $d=M('spend','tab_')->field('pay_amount')->where(['pay_order_number'=>$order_info['out_trade_no']])->find(); if($d['pay_amount'] != $Money){ $this->record_logs("金额验证错误"); echo '357papiSQLFALSE357papi';//失败 return false; } $result = $this->set_spend($order_info); break; case 'PF': $d=M('deposit','tab_')->field('pay_amount')->where(['pay_order_number'=>$order_info['out_trade_no']])->find(); if($d['pay_amount'] != $Money){ $this->record_logs("金额验证错误"); echo '357papiSQLFALSE357papi';//失败 return false; } $result = $this->set_deposit($order_info); break; case 'AG': $d=M('agent','tab_')->field('real_amount')->where(['pay_order_number'=>$order_info['out_trade_no']])->find(); if($d['real_amount'] != $Money){ $this->record_logs("金额验证错误"); echo '357papiSQLFALSE357papi';//失败 return false; } $result = $this->set_agent($order_info); break; case 'BR': $d=M('bind_recharge','tab_')->field('real_amount')->where(['pay_order_number'=>$order_info['out_trade_no']])->find(); if($d['real_amount'] != $Money){ $this->record_logs("金额验证错误"); echo '357papiSQLFALSE357papi';//失败 return false; } $result = $this->set_bind_recharge($order_info); break; case 'TB': $d=M('balance','tab_')->field('money')->where(['pay_order_number'=>$order_info['out_trade_no']])->find(); if($d['money'] != $Money){ $this->record_logs("金额验证错误"); echo '357papiSQLFALSE357papi';//失败 return false; } $result = $this->set_balance($order_info); break; case 'SI': $d=M('order','tab_')->field('order_price')->where(['order_number'=>$order_info['out_trade_no']])->find(); if($d['order_price'] != $Money){ $this->record_logs("金额验证错误"); echo '357papiSQLFALSE357papi';//失败 return false; } $result = $this->set_order($order_info); break; default: exit('accident order data'); break; } if($result){ echo '357papiSuccess357papi';//成功 return; } else{ echo '357papiSQLFALSE357papi';//失败 return; } }else{ echo '357papiAPIFALSE357papi';//失败 return; } } /** *判断平台币充值是否存在 */ protected function deposit_is_exist($out_trade_no) { $deposit = M('deposit', 'tab_'); $map['pay_status'] = 1; $map['pay_order_number'] = $out_trade_no; $res = $deposit->where($map)->find(); if (empty($res)) { return false; } else { return true; } } //判断订单是否存在 public function order_is_exist($out_trade_no) { $order = M('Order', 'tab_'); $map['pay_status'] = 1; $map['order_number'] = $out_trade_no; $res = $order->where($map)->find(); if (empty($res)) { return false; } else { return true; } } //判断充值是否存在 public function recharge_is_exist($out_trade_no) { $recharge = M('spend', 'tab_'); $map['pay_status'] = 1; $map['pay_order_number'] = $out_trade_no; $res = $recharge->where($map)->find(); if (empty($res)) { return false; } else { return true; } } //判断代充是否存在 public function agent_is_exist($out_trade_no) { $recharge = M('agent', 'tab_'); $map['pay_status'] = 1; $map['pay_order_number'] = $out_trade_no; $res = $recharge->where($map)->find(); if (empty($res)) { return false; } else { return true; } } /** *WAP支付成功后 通知SDK */ public function notifySdk($stauts='200',$info=''){ return ""; } //判断余额币是否存在 public function balance_is_exist($out_trade_no){ $balance = M('balance', 'tab_'); $map['pay_status'] = 1; $map['pay_order_number'] = $out_trade_no; $res = $balance->where($map)->find(); if (empty($res)) { return false; } else { return true; } } //判断充值是否存在 public function bind_recharge_is_exist($out_trade_no) { $bind_recharge = M('bind_recharge', 'tab_'); $map['pay_status'] = 1; $map['pay_order_number'] = $out_trade_no; $res = $bind_recharge->where($map)->find(); if (empty($res)) { return false; } else { return true; } } // 易宝支付通知 public function yeepay_callback() { require_once("ThinkPHP/Library/Org/YeepaySDK/lib/Util/YopSignUtils.php"); Log::write(serialize($_REQUEST), Log::DEBUG); // $yop_public_key = C('yeepay.yop_public_key'); // $private_key = C('yeepay.private_key'); $source = $_REQUEST['response']; $identifier = $_REQUEST['customerIdentification']; if (substr($identifier, 0, 4) == "OPR:") { $identifier = substr($identifier, 4); } $merchant = M('payment_merchant', 'tab_')->where([ 'identifier' => $identifier ])->find(); if (!$merchant) { $this->record_logs("找不到商户!".$identifier); echo 'fail'; exit(); } $payConf = json_decode($merchant['config'], true); $private_key = $payConf['private_key']; $yop_public_key = $payConf['public_key']; $sourceData = \YopSignUtils::decrypt($source, $private_key, $yop_public_key); $sourceData = json_decode($sourceData, true); if ($sourceData['status'] != 'SUCCESS') { $this->record_logs("sourceData返回数据错误"); exit(); } else { $pay_where = substr($sourceData['orderId'], 0, 2); $data['trade_no'] = $sourceData['uniqueOrderNo']; // 易宝流水号 $data['out_trade_no'] = $sourceData['orderId']; // 平台生成的订单号SP $data['money'] = $sourceData['payAmount']; $payService = new PayService(); if (!$payService->yeeTradeQuery($payConf, $data)) { sleep(1); // 延迟1s 在查一次 if (!$payService->yeeTradeQuery($payConf, $data)) { Log::write("YEEQUERYFAIL->".serialize($data), Log::DEBUG); echo 'fail'; exit(); } } switch ($pay_where) { case 'SP'://充值游戏 if ($this->recharge_is_exist($sourceData['out_trade_no'])) { echo "SUCCESS"; exit(); } $result = $this->set_spend($data); echo "SUCCESS"; break; case 'PF'://充值平台币 if ($this->deposit_is_exist($sourceData["out_trade_no"])) { echo "SUCCESS"; exit(); } $result = $this->set_deposit($data); echo "SUCCESS"; break; default: $this->record_logs("易宝订单号{$sourceData['orderId']}错误!!"); break; } } echo "SUCCESS"; } /** * 酷点回调 */ public function kd_callback() { $params = file_get_contents('php://input'); KDLog::write('NOTIFY_INPUT:' . file_get_contents('php://input')); $response = new KDResponse($params); if (!$response->verify()) { echo 'SIGN_VERIFY_FAIL'; return; } if ($response->getResult('status') != 100) { echo 'SUCCESS'; return; } $orderInfo['trade_no'] = $response->getResult('transaction_id'); $orderInfo['out_trade_no'] = $response->getResult('out_trade_no'); $orderInfo['money'] = round($response->getResult('fee') / 100, 2); $payWhere = substr($orderInfo['out_trade_no'], 0, 2); switch ($payWhere) { case 'SP': $result = $this->set_spend($orderInfo); break; case 'PF': $result = $this->set_deposit($orderInfo); break; case 'AG': $result = $this->set_agent($orderInfo); break; default: exit('accident order data'); break; } echo 'SUCCESS'; } public function outer_callback() { $params = file_get_contents('php://input'); $clientIp = get_client_ip(); ToolLog::write('clientIp' . $clientIp, Log::INFO, 'outer_callback'); ToolLog::write('params:' . $params, Log::INFO, 'outer_callback'); if ($clientIp != '124.222.24.55') { echo 'deny'; return; } $data = json_decode($params, true); if ($data['trade_status'] != 'SUCCESS') { echo "status error"; return; } $orderInfo['trade_no'] = $data['trade_no']; $orderInfo['out_trade_no'] = $data['out_trade_no']; $orderInfo['money'] = round($data['total_amount'] / 100, 2); $payWhere = substr($orderInfo['out_trade_no'], 0, 2); switch ($payWhere) { case 'SP': $result = $this->set_spend($orderInfo); break; case 'PF': $result = $this->set_deposit($orderInfo); break; case 'AG': $result = $this->set_agent($orderInfo); break; default: exit('accident order data'); break; } echo 'success'; } public function test_send() { $str = '{"order_no":"SP_2024121323095","user_id":186,"user_account":"","game_id":20,"game_name":"\u53e4\u57dfOnline","server_id":"1","server_name":"\u3044\u541b\u4e34-\u5929\u4e0b\u3065","subject":"\u8282\u65e5\u7279\u60e01\u5143","role_id":"1000048","role_name":"\u7231\u9756\u96c1","pay_amount":100,"notify_url":"http:\/\/api.hexidongkeji.top\/callback.php\/Notify\/outer_callback","return_url":"https%3A%2F%2Fapi.hexidongkeji.top%2Fsdk.php%2FSpend%2Fpaycallback%2Forderno%2FSP_20241213230953wPOf%2Fgame_id%2F20%2Fpaytype%2Fweixinpay","promote_id":0,"promote_account":"","client_ip":"223.104.54.38","pay_type":"wxpay-h5"}'; $params = json_decode($str, true); $params['order_no'] = $params['order_no'] . '_' . rand(1000, 9999); $result = OuterApi::request($params); var_dump($result); } }