国通支付查询1级mcc

This commit is contained in:
xucong 2024-11-16 15:59:24 +08:00
parent 6da436fa09
commit 0a207e1d63

@ -74,7 +74,7 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwRUsPpbQPhBWrxFhG00k9VBgnHc7dCZyTQYI
$b = json_encode($data,true);
var_dump($b);
$url = "http://jghwucyshtgjcbrnxgwe.gtxygroup.com/testterpay/yyfsevr/addCust/getTopMcc";
$result = $this->curl_post($url,$b);
$result = $this->curl_get($url."?".$b);
var_dump($result);
}
// 异步支付回调
@ -127,4 +127,36 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwRUsPpbQPhBWrxFhG00k9VBgnHc7dCZyTQYI
$tmpInfo=json_decode($tmpInfo,true);
return $tmpInfo;
}
private function curl_get($url) {
//初使化curl
$curl = curl_init();
//请求的url,由形参传入
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检测
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Expect:'
)); // 解决数据包大不能提交
//将得到的数据返回
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
//不处理头信息
curl_setopt($curl, CURLOPT_HEADER, 0);
//连接超过10秒超时
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer
curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回
//执行curl
$output = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Errno' . curl_error($curl);
}
//关闭资源
curl_close($curl);
//返回内容
$tmpInfo=json_decode($output,true);
return $tmpInfo;
}
}