在快速结账查看页面中显示订单项

时间:2014-05-12 15:57:21

标签: c# .net paypal payflowpro

我正在使用.net payflow sdk(Payfolow_dotNET.dll)。我的代码允许客户使用EC,但PayPal评论页面没有显示项目详细信息。它只是说"您可以在支付之前查看您的订单详细信息"

UserInfo creds = new UserInfo(user, vendor, partner, pwd);
string url = "";
if (paypalObj.Testing) {
    url = ConfigurationManager.AppSettings.Get("PayflowTest");
} else {
    url = ConfigurationManager.AppSettings.Get("PayflowLive");
}
PayflowConnectionData connection = new PayflowConnectionData(url);
Invoice inv = new Invoice();
inv.Amt = new Currency(1.01, "USD");
inv.OrderDesc = "test item";
inv.Comment1 = "test item";
// so far this next bit is not helping
LineItem item = new LineItem();
item.Amt = new Currency(1.01, "USD");
item.Desc = "test item";
item.Qty = 1;
item.Type = "DIGITAL";
item.Name = "test item";
item.ItemNumber = "1";
inv.AddLineItem(item);
ECSetRequest setRequest = new ECSetRequest(websiteBase + "Donate/PayPalConfirmPayment", websiteBase + "Donate/Donate");
setRequest.PaymentType = "instantonly";
setRequest.NoShipping = "1";
//setRequest.AddrOverride = "1";
PayPalTender tender = new PayPalTender(setRequest);
SaleTransaction trans = new SaleTransaction(creds, connection, inv, tender, PayflowUtility.RequestId);
Response resp = trans.SubmitTransaction();
TransactionResponse transResp = resp.TransactionResponse;

有关如何在评论页面上获取商品详情的任何想法? THX

2 个答案:

答案 0 :(得分:1)

根据Express Checkout for Payflow guide

你可以通过:

L_NAMEn L_DESCn L_COSTn L_TAXAMTn L_QTYn

有关如何实施这些内容的信息,请参阅指南第57页。

这些变量将允许您在PayPal结帐页面上显示订单项详细信息。

答案 1 :(得分:1)

原来我错过了一个属性 - 物品成本。

item.Cost = new Currency(1.01, "USD");

有点奇怪,Paypal API中的其他任何地方的金额都是AMOUNTAMT,但对于订单项,它是COST