mall.order_detail 获取单条订单信息
1请求网址
http://www.你的域名.com/api.php?api=mall.order_detail
2请求方式
POST
3请求参数
4返回结果
5调用示例
$apikey=require('./apikey.php');
$url="http://www.monxin.com/api.php?api=mall.order_detail";
$return='xml';
$array=array(
	'id'=>'',		//id
	'out_id'=>'2017092921056',				//外部id
);
$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业务请求成功,可在此处理业务逻辑
	var_dump($re);	
}

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;
}

本页由《梦行文档》生成

 

name完成
30