资源简介
C# PayPal国际支付接口实现源码,支持单商品、购物车结算,代码里面详细说明,带自己写的文档,配置好参数即可运行,不是网上现在共享的那一套,公司自用,现分享 — 2017年5月4日
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PayPal.PayPalAPIInterfaceService;
using PayPal.PayPalAPIInterfaceService.Model;
using log4net;
namespace ExpressCheckout
{
public partial class DoExpressCheckoutPayment : System.Web.UI.Page
{
public readonly static string BNCode;
static DoExpressCheckoutPayment()
{
log4net.Config.xmlConfigurator.Configure();
//获取配置文件
var config = GetConfig();
BNCode = config[“SBN_CODE“];//跟踪代码
}
private static ILog logger = LogManager.GetLogger(typeof(DoExpressCheckoutPayment));
public static Dictionary GetConfig()
{
return PayPal.Manager.ConfigManager.Instance.GetProperties();
}
protected void Page_Load(object sender EventArgs e)
{
HttpContext CurrContext = HttpContext.Current;
//获取支付的订单信息
DoExpressCheckoutPaymentResponseType responseDoExpressCheckoutPaymentResponseType = new DoExpressCheckoutPaymentResponseType();
try
{
DoExpressCheckoutPaymentReq doExpressCheckoutPayment = new DoExpressCheckoutPaymentReq();
DoExpressCheckoutPaymentRequestDetailsType doExpressCheckoutPaymentRequestDetails = new DoExpressCheckoutPaymentRequestDetailsType();
doExpressCheckoutPaymentRequestDetails.Token = (string)(Session[“EcToken“]);
doExpressCheckoutPaymentRequestDetails.PayerID = (string)(Session[“PayerId“]);
//付款信息
List paymentDetailsList = new List();
PaymentDetailsType paymentDetails = new PaymentDetailsType();
CurrencyCodeType currency_code_type = (CurrencyCodeType)(Session[“currency_code_type“]);
PaymentActionCodeType payment_action_type = (PaymentActionCodeType)(Session[“payment_action_type“]);
string total_amount = (string)(Session[“Total_Amount“]);
BasicAmountType orderTotal = new BasicAmountType(currency_code_type total_amount);
paymentDetails.OrderTotal = orderTotal;
paymentDetails.PaymentAction = payment_action_type;
//跟踪所有事务的代码
paymentDetails.ButtonSource = BNCode;
SellerDetailsType sellerDetails = new SellerDetailsType();
sellerDetails.PayPalAccountID = (string)(Session[“SellerEmail“]);
paymentDetails.SellerDetails = sellerDetails;
paymentDetailsList.Add(paymentDetails);
doExpressCheckoutPaymentRequestDetails.PaymentDetails = paymentDetailsList;
DoExpressCheckoutPaymentRequestType doExpressCheckoutPaymentRequest = new DoExpressCheckoutPaymentRequestType(doExpressChec
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-05-04 17:29 Paypal\
文件 126514 2017-05-04 17:28 Paypal\Paypal支付文档说明.docx
目录 0 2017-05-03 09:06 Paypal\src\
目录 0 2017-05-03 09:05 Paypal\src\.vs\
目录 0 2017-05-03 09:05 Paypal\src\.vs\config\
文件 85920 2017-05-03 09:05 Paypal\src\.vs\config\applicationhost.config
目录 0 2017-05-03 09:05 Paypal\src\.vs\ExpressCheckout\
目录 0 2017-05-03 09:05 Paypal\src\.vs\ExpressCheckout\v14\
文件 88064 2017-05-04 13:42 Paypal\src\.vs\ExpressCheckout\v14\.suo
目录 0 2017-05-04 12:00 Paypal\src\ExpressCheckout\
文件 935 2016-06-14 11:27 Paypal\src\ExpressCheckout.sln
文件 7680 2017-05-03 09:05 Paypal\src\ExpressCheckout.suo
目录 0 2017-05-04 09:33 Paypal\src\ExpressCheckout\bin\
文件 24064 2017-05-04 11:05 Paypal\src\ExpressCheckout\bin\ExpressCheckout.dll
文件 4207 2017-05-04 10:45 Paypal\src\ExpressCheckout\bin\ExpressCheckout.dll.config
文件 46592 2017-05-04 11:05 Paypal\src\ExpressCheckout\bin\ExpressCheckout.pdb
文件 304640 2015-12-10 16:55 Paypal\src\ExpressCheckout\bin\log4net.dll
文件 1533153 2015-12-10 16:55 Paypal\src\ExpressCheckout\bin\log4net.xm
文件 522752 2016-03-14 21:30 Paypal\src\ExpressCheckout\bin\Newtonsoft.Json.dll
文件 516075 2016-03-14 21:30 Paypal\src\ExpressCheckout\bin\Newtonsoft.Json.xm
文件 97280 2016-02-26 13:43 Paypal\src\ExpressCheckout\bin\PayPalCoreSDK.dll
文件 537088 2015-12-14 21:39 Paypal\src\ExpressCheckout\bin\PayPalMerchantSDK.dll
文件 510453 2015-12-14 21:39 Paypal\src\ExpressCheckout\bin\PayPalMerchantSDK.xm
目录 0 2016-06-14 11:27 Paypal\src\ExpressCheckout\css\
文件 16849 2016-06-14 11:27 Paypal\src\ExpressCheckout\css\bootstrap-responsive.min.css
文件 106015 2016-06-14 11:27 Paypal\src\ExpressCheckout\css\bootstrap.min.css
文件 4241 2017-05-03 10:20 Paypal\src\ExpressCheckout\DoExpressCheckoutPayment.aspx
文件 6533 2017-05-03 11:57 Paypal\src\ExpressCheckout\DoExpressCheckoutPayment.aspx.cs
文件 478 2017-05-03 10:05 Paypal\src\ExpressCheckout\DoExpressCheckoutPayment.aspx.designer.cs
文件 8759 2017-05-04 08:30 Paypal\src\ExpressCheckout\ExpressCheckout.csproj
文件 1243 2017-05-04 08:30 Paypal\src\ExpressCheckout\ExpressCheckout.csproj.user
............此处省略149个文件信息
- 上一篇:简单的c#停车场管理系统
- 下一篇:ASP.NET典型系统源码
评论
共有 条评论