這篇文章主要介紹了php支付寶接口用法,以實例形式較為詳細的分析了php支付寶接口的使用技巧,具有一定參考借鑒價值,需要的朋友可以參考下
本文實例講述了php支付寶接口用法。分享給大家供大家參考。具體分析如下:
現在流行的網站支持平台,支付寶當仁不讓的老大了,現在我們就來告訴你如何使用支付寶api來做第三方支付,把支付寶放到自己網站來,代碼如下:
alipay_config.php配置程序如下:
代碼如下: <?php
require_once("alipay_config.php");
require_once("alipay.php");
$cmd = '0001';
$subject = "訂單號:".$aliorder;
$body = '商品介紹';
$order_no = $aliorder;
$price = $alimoney;
$url = 'www.jb51.net';//你的網址
$type = '1';
$number = '1';
$transport = $alimailtype;
$ordinary_fee = '0.00';
$express_fee = '0.00';
$readonly = 'true';
$buyer_msg = $alibody;
$seller = $selleremail;
$buyer = '';
$buyer_name = $aliname;
$buyer_address = $aliaddress;
$buyer_zipcode = $alizipcode;
$buyer_tel = $aliphone;
$buyer_mobile = $alimob;
$partner = '2088002008096997';
$geturl = new alipay;
$link = $geturl->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>
<head>
<title>簡易支付寶付款php版</title>
<link href="admin_style.css教程" rel=stylesheet>
<meta http-equiv=content-type content="text/html; charset=gb2312">
</head>
<body>
<table class=border id=table1 style="font-size: 9pt" height=185 cellspacing=0
cellpadding=0 width=492 align=center border=0>
<tbody>
<tr>
<td class=topbg height=30>
<div align=center><strong>簡易支付寶付款php版</strong></div></td></tr>
<tr>
<td style="border-left: #e4e4e4 1px solid; border-bottom: #e4e4e4 1px solid" colspan=3 height=150>
<table style="font-size: 9pt" height=137 width="100%" align=center bgcolor=#ffffff>
<tbody>
<tr class=tdbg>
<td width="14%">訂單號碼:</td>
<td width="86%"><? echo $aliorder; ?></td></tr>
<tr class=tdbg>
<td width="14%">收 貨 人:</td>
<td width="86%"><? echo $aliname; ?></td></tr>
<tr class=tdbg>
<td width="14%">付款金額:</td>
<td width="86%"><b><? echo $alimoney; ?></b></td></tr>
<tr class=tdbg>
<td width="14%">收貨地址:</td>
<td width="86%"><? echo $aliaddress; ?></td></tr>
<tr class=tdbg>
<td>物流方式:</td>
<td><? echo $alimailtype; ?> (1.平郵 2.快遞 3.虛擬物品)</td></tr>
<tr class=tdbg>
<td>聯系電話:</td>
<td><? echo $aliphone; ?></td></tr>
<tr class=tdbg>
<td>郵政編碼:</td>
<td><? echo $alizipcode; ?></td></tr>
<tr class=tdbg>
<td>手機號碼:</td>
<td><? echo $alimob; ?></td></tr>
<tr class=tdbg>
<td>客戶留言:</td>
<td><? echo $alibody; ?></td></tr>
<tr class=tdbg>
<td></td>
<td><input type="button" name="submit21" onclick="網頁特效:history.go(-1)" value="返回修改訂單"> <a href="<?php echo $link?>" target="_blank"><img src="<?php echo $imgurl?>" alt="<?php echo $imgtitle?>" border="0" align='absmiddle' border='0'/></a> </td></tr></tbody></table></td></tr></tbody></table>
</body></html>
希望本文所述對大家的php程序設計有所幫助。