本文為您提供了PHP語言版本的充值接口接口對接DEMO示例
<?php
header("Content-type:text/html; charset=UTF-8");
//請檢查環(huán)境是否 開啟 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', //產(chǎn)品ID
'buynum' => '1', //購買數(shù)量-固定數(shù)量1
'timestamp' => '20240321150546', //時間戳格式如:yyyyMMddHHmmss 允許 10分鐘統(tǒng)一以東 8 時間
'sign' => '81ed625f338277f1bd7f27b9339e302c', //簽名
);
$res = Post($post_data, $target);
print_r($res);
國內(nèi)專業(yè)互聯(lián)網(wǎng)團隊
21年行業(yè)經(jīng)驗
7x24小時售后支持
豐富的行業(yè)經(jīng)驗
Copyright ? 2004-2025 上海思銳信息技術(shù)有限公司 All rights reserved. 滬ICP備07035915號-15 電信增值業(yè)務許可證:B2-20160082
服務熱線:
4008 808 898
服務熱線(工作時間):
4008 808 898
業(yè)務咨詢(非工作時間):
售后咨詢(非工作時間):