本文为您提供了PHP语言版本的充值接口接口对接DEMO示例
<?php
header("Content-type:text/html; charset=UTF-8");
//请检查环境是否 开启 curl init。
function Post($curlPost,$url){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curlPost);
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
$return_str = curl_exec($curl);
curl_close($curl);
return $return_str;
}
//短信接口地址
$target = "https://api.ihuyi.com/f/giftcard?action=buy";
$post_data = array(
'username' => '123456', //API ID
'mobile' => '130*******', //手机号
'orderid' => 'DD20253995959', //商家订单ID
'productid' => 'k111-1', //产品ID
'buynum' => '1', //购买数量-固定数量1
'timestamp' => '20240321150546', //时间戳格式如:yyyyMMddHHmmss 允许 10分钟统一以东 8 时间
'sign' => '81ed625f338277f1bd7f27b9339e302c', //签名
);
$res = Post($post_data, $target);
print_r($res);
国内专业互联网团队
21年行业经验
7x24小时售后支持
丰富的行业经验
Copyright © 2004-2025 上海思锐信息技术有限公司 All rights reserved. 沪ICP备07035915号-15 电信增值业务许可证:B2-20160082
服务热线:
4008 808 898
服务热线(工作时间):
4008 808 898
业务咨询(非工作时间):
售后咨询(非工作时间):