php充值代码,腾讯充值⽰例代码
akb48第六届总选举require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$qq = '2020858850';//QQ号
清音浊世录$num = 1;//充值数量
$outorderno = '66522311111';//外部订单号
犹太教
$typeid = 1;
$appsecret = 'ssssssssssss';
$sign = makeSign(array('qq'=>$qq, 'typeid'=>$typeid, 'num'=>$num, 'outorderno'=>$outorderno), $appsecret);//签名 qq typeid num outorderno为签名字段,参考下⾯的签名函数
$url = "api.jisuapi/tencentrecharge/recharge?
appkey=$appkey&typeid=$typeid&qq=$qq&num=$num&outorderno=$outorderno&sign=$sign";
$result = curlOpen($url, ['ssl'=>true]);
熊抱的温柔
$jsonarr = json_decode($result, true);温州休闲
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
echo $result['qq'].' '.$result['typeid'].' '.$result['num'].' '.$result['outorderno'].'
';
梦见生孩子
echo $result['orderno'].' '.$result['totalfee'].' '.$result['rechargestatus'].'
';
/**
* ⽣成签名
*
*/
function makeSign($queryarr, $appsecret)
{
ksort($queryarr, SORT_STRING);
$str = implode($queryarr);
$str .= $appsecret;
/
/exit($str);
$str = md5($str); return $str;
}