PHP Alipay interface program source code (full version with examples) Nowadays, Alipay is the popular website support platform. Now we will tell you how to use Alipay API for third-party payment and put Alipay on your own website.
php tutorial Alipay interface program source code (full version with examples)
Nowadays, Alipay is the leader of popular website support platforms. Now we will tell you how to use Alipay api for third-party payment. Put Alipay on Go to your own website.
*/
//alipay_config.php configuration program
$interfaceurl = "ps tutorial://www.alipay.com/payto">https://www.alipay.com/payto:";
$sitename = "Website name";
$weburl = "http://website address";
$o_fee = "0.00"; //Flat postage
$e_fee = "0.00"; //Express fee
$selleremail = "";//Alipay account
$payalikey = "";//Security verification code
$imgurl = "pay.gif"; //Button image source
$imgtitle = "Purchase using Alipay"; //Button picture description
?>
/*********************************************************************
filename: alipay.php
author: dboyzhang
version: ver 2.0.0 beta1
contact_me: wangwang:dboyzhang
*********************************************************************/
//alipay. php code
require_once("alipay_config.php");
class alipay
{
function geturl($s1,$s2,$s3,$s4,$s5,$s6,$s7, $s8,$s9,$s10,$s11,$s12,$s13,$s14,$s15,$s16,$s17,$s18,$s19,$s20,$s21,$s22,$s23)
{
$parameter = array(
'cmd' => $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 page
error_reporting(0);
$aliname=$_post["aliname"];
$alizipcode=$ _post["alizipcode"];
$aliphone=$_post["aliphone"];
$aliaddress=$_post["aliaddress"];
$aliorder=$_post["aliorder"];
$alimailtype=$_post["alimailtype"];
$alimoney=$_post["alimoney"];
$alimob=$_post["alimob"];
$alibody=$_post[ "alibody"];
?>
require_once("alipay_config.php");
require_once("alipay.php");
$cmd = '0001';
$subject = "订单号:".$aliorder;
$body = '商品介绍';
$order_no = $aliorder;
$price = $alimoney;
$url = 'www.bkjia.com';//你的网址
$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
);
?>
源码下载地址
http://down.php100.com/down/code/php/qitayuanma/2010/1009/21108.html