第一步:找到Z支付的SDK文件夹zpay_sdk,依次打开src文件夹,你会看到这三个文件,如图:
第二步:将ZPaySdk.php文件里面的域名https://pay.rxkku.net换成支付乐的网关域名:http://pay.ezhan.run ,如图:
换之前、
换之后、
第三步:将zpay_config.php文件里面的第4行换成你的支付乐商户id,第6行换成你的支付乐商户秘钥
第四步:将zpay_function.php文件里面的“发送http请求使用“代码换成下面的代码
//发送http请求使用
function get_cur($url,$data, $post = 0, $cookie = 0, $header = 0, $nobaody = 0)
{
$url = $url.'?'.http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$klsf[] = 'Accept:*/*';
$klsf[] = 'Accept-Language:zh-cn';
//$klsf[] = 'Content-Type:application/json';
$klsf[] = 'User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_1 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C153 MicroMessenger/6.6.1 NetType/WIFI Language/zh_CN';
$klsf[] = 'Referer:'.$url;
curl_setopt($ch, CURLOPT_HTTPHEADER, $klsf);
if ($post) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
if ($header) {
curl_setopt($ch, CURLOPT_HEADER, true);
}
if ($cookie) {
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
}
if ($nobaody) {
curl_setopt($ch, CURLOPT_NOBODY, 1);
}
curl_setopt($ch, CURLOPT_TIMEOUT,60);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
换好之后的样子:
第五步:去支付乐商户中心免公众号接口里面去授权你的域名