index.qr_pay 二维码支付接口
1请求网址
http://paigx.52yiyuangou.com/api.php?api=index.qr_pay
2请求方式
POST
3请求参数
4返回结果
5调用示例
$apikey=require('./apikey.php');
$url="http://paigx.52yiyuangou.com/api.php?api=index.qr_pay";
$return='xml';
$array=array(
	'code'=>'6666_59118231',
	'money'=>102,
	'reason'=>'测试',
);
$re=monxin_api($apikey,$return,$url,$array);

if($re['err_code']!=0){
	//调用有误
	echo $re['err_msg'];
	exit;
}
if($re['api_state']=='fail'){
	//API业务请求失败
	echo $re['api_msg'];
	exit;
}
if($re['api_state']=='success'){
	//API业务请求成功,可在此处理业务逻辑
		
}

function monxin_api($apikey,$return,$url,$array){
	$ch = curl_init();
	$array['apikey']=$apikey;
	curl_setopt ($ch, CURLOPT_URL, $url.'&return='.$return);
	//curl_setopt ($ch, CURLOPT_URL, 'http://sms.yunpian.com/v2/sms/single_send.json');
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array));
	curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
	$r = curl_exec($ch);
	echo $r;
	if($return=='xml'){
		$r = simplexml_load_string($r, 'SimpleXMLElement', LIBXML_NOCDATA);
		$r = json_encode($r);
	}
	$r = json_decode($r,true);
	return $r;
}
本页由《梦行文档》生成