阿里云实时外汇查询接口
二次开发 admin 发布时间:2023-11-17 09:01:15 浏览: 次
阿里云推出了实时外汇查询接口,也很便宜,通辽易联通达给客户对接如下
public function currency_exchange($fromCode, $toCode, $money=0) {
if( $fromCode == "" || $toCode == "" ) {
exit('Please Input exchange_rate param: fromCode, toCode');
}
$host = "https://tysjhlcx.market.alicloudapi.com";
$path = "/exchange_rate/convert";
$method = "GET";
$appcode = "8a18d0903f734832a49bb3992a8d85bd";
$headers = array();
array_push($headers, "Authorization:APPCODE " . $appcode);
$querys = "fromCode=".$fromCode."&toCode=".$toCode."&money=".$money;
$bodys = "";
$url = $host . $path . "?" . $querys;
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
if (1 == strpos("$".$host, "https://"))
{
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
//var_dump(curl_exec($curl));
$response = curl_exec($curl);
有需要的朋友可以联系我们
相关推荐
- 阿里云的轻量应用服务器和云服务器有什么区别?
- ecshop等电商网站对接阿里云短信验证码功能(PHP版本)
- 如果利用京东联盟API把京东的商品展示在自己的网站(PH
- 工商银行在线支付接口,B2C签名infosec插件
- 网站接入手机验证码,网站接入短信验证码功能,短信验证码
- 瀚银ecshop,thinkphp,shopnc在线支付接口,支付插件(pay
- 现代金控ecshop,thinkphp,shopnc在线支付接口,支付插件
- 首信易ecshop,thinkphp,shopnc在线支付接口,支付插件(p
- 环迅ecshop,thinkphp,shopnc在线支付接口,支付插件(pay
- 爱农ecshop,thinkphp,shopnc在线支付接口,支付插件(pay