支付宝集成双接口.docVIP

  • 5
  • 0
  • 约5.92万字
  • 约 17页
  • 2016-08-21 发布于河南
  • 举报
支付宝集成双接口

支付宝集成双接口人和网站支付宝集成方法:第一步:开通相关功能,例如:双功能(即时/担保)收款600套餐, 状态为“等待生效”,操作里面有发票信息,也就是付过钱了。第二步:登录支付宝,获取查询合作者身份(PID) 查询安全校验码(Key) 其中,安全校验码需要使用支付密码才能查看。第三步:在技术服务栏目里,点击“我要自主集成”,然后在页面上点击 “下载技术文档”,然后下载对应的接口功能包,例如: 支付宝双功能收款接口。第四步:选择接口里面的dj_vs2005_gb文件夹,因为人和网站采用的是gb2312编码的, 语言开发的。第五步:本地测试,看接口能否顺利付款。第六步:人和网站sln项目里,新增类库AlipayClass,然后复制文件夹里的app_code里面的 alipay_config.cs,alipay_function.cs,alipay_notify.cs,alipay_service.cs四个类文件 到类库,生成dll到网站的bin目录。第七步:人和网站根目录,新建Alipay目录,然后把文件夹里的images,log和根目录所有文件, 都保存到alipay目录。第八步:修改接口文件alipayto.aspx,根据订单号来获取订单信息,然后配置好,传递给支付宝进行处理。 示例代码: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections; using AlipayClass; using Renhe.DB; public partial class alipayto : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ///////////////////////以下参数是需要设置的相关配置参数,设置后不会更改的/////////////////////////// AlipayConfig con = new AlipayConfig(); string partner = con.Partner; string key = con.Key; string seller_email = con.Seller_email; string input_charset = con.Input_charset; string notify_url = con.Notify_url; string return_url = con.Return_url; string show_url = con.Show_url; string sign_type = con.Sign_type; ///////////////////////////根据订单号,获取订单的基本信息/////////////////// string out_trade_no = Request.QueryString[orderid]; //请与贵网站订单系统中的唯一订单号匹配 string Sql = select totalmoney,OrderTrueName,OrderAddr,OrderZip,OrderTel from LVX_order where orderid = + out_trade_no + ; DataTable dt = new Db().GetDataTable(Sql); if (dt.Rows.Count == 0) { Response.Write(订单不存在!); return; }

文档评论(0)

1亿VIP精品文档

相关文档