本文实例讲述了php支付宝接口用法。分享给大家供大家参考。具体分析如下:
现在流行的网站支持平台,现在我们就来告诉你如何使用支付宝api来做第三方支付,把支付宝放到自己网站来,
alipay_config.php配置程序如下:
alipay.php代码如下:
$s1,
'subject' => $s2,
'body' => $s3,
'order_no' => $s4,
'price' => $s5,
'url' => $s6,
'type' => $s7,
'number' => $s8,
'transport' => $s9,
'ordinary_fee' => $s10,
'express_fee' => $s11,
'readonly' => $s12,
'buyer_msg' => $s13,
'seller' => $s14,
'buyer' => $s15,
'buyer_name' => $s16,
'buyer_address' => $s17,
'buyer_zipcode' => $s18,
'buyer_tel' => $s19,
'buyer_mobile' => $s20,
'partner' => $s21,
);
$url = $s22.$s14."?";
foreach($parameter as $key => $value){
if($value){
$url .= $key."=".urlencode($value)."&";
$acsouce .=$key.$value;
}
}
$url .= 'ac='.md5($acsouce.$s23);
return $url;
}
}
?>
pay.php 页面如下:
geturl
(
$cmd,$subject,$body,$order_no,$price,$url,$type,$number,$transport,
$ordinary_fee,$express_fee,$readonly,$buyer_msg,$seller,$buyer,
$buyer_name,$buyer_address,$buyer_zipcode,$buyer_tel,$buyer_mobile,$partner,
$interfaceurl,$payalikey
);
?>
html页面模板如下:
简易支付宝付款php版
以上就是支付宝接口的用法。
本文来自投稿,不代表重蔚自留地立场,如若转载,请注明出处https://www.cwhello.com/4537.html
如有侵犯您的合法权益请发邮件951076433@qq.com联系删除