Home >php教程 >PHP源码 >简单的利用www.vsfxt.com支付宝订单查询系统实现订单查询

简单的利用www.vsfxt.com支付宝订单查询系统实现订单查询

PHP中文网
PHP中文网Original
2016-05-25 16:59:581508browse

php代码

<?php
function curl_get_contents($url) { 
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($ch, CURLOPT_TIMEOUT, 5);
$buf = curl_exec($ch);
curl_close($ch);
return $buf;
}
$gateway = &#39;http://23.239.194.245:7000/&#39;;//网关
$tradeNo = &#39;2013111200001000920071958757&#39;;//交易号
$info = curl_get_contents($gateway.$tradeNo);
$arr  = json_decode($info);
if(is_object($arr)===false) {
echo &#39;Error&#39;;
}else {
foreach($arr as $key=>$value) {
  echo "交易号:",$key,"<br />","成交金额:",$value->fee,"<br />","成交时间:",$value->time;
}
}
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn