Paypal SetExpressCheckout(快速结账) 10731错误,请有经验的人帮忙

tbc168 2011-05-06 01:09:50
环境:C#.NET + Paypal SOAP API 版本:72.0

由于Paypal卖家保护策略要求商家必须提供一个发货地址 以下为我的代码:

var expResponse = client.SetExpressCheckout(ref csh, new SetExpressCheckoutReq()
{
SetExpressCheckoutRequest = new SetExpressCheckoutRequestType()
{
SetExpressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType()
{
ReturnURL = returnurl,
CancelURL = cancelurl,
BuyerEmail = CustomerHandle.GetIdentityName(),
PaymentDetails = new PaymentDetailsType[]
{
new PaymentDetailsType()
{
OrderTotal=OrderToal,
PaymentDetailsItem=new PaymentDetailsItemType[]
{
new PaymentDetailsItemType
{
Amount = OrderToal,
Number = "",
Quantity = "1",
Name =string.Format("#{0}#",orderNum)
}
},
PaymentAction=PaymentActionCodeType.Sale,
ShipToAddress=new AddressType
{
Name=string.Format("{0} {1}",shippingaddr.FirstName,shippingaddr.LastName),
Street1=shippingaddr.ADD1,
Street2=shippingaddr.ADD2,
CityName=shippingaddr.City,
StateOrProvince=shippingaddr.State,
PostalCode=shippingaddr.Postcode,
//Country=countrycode,
/*paypal文档中说Country是必要的*/
Country=CountryCodeType.NL,
CountryName="Netherlands",

Phone=shippingaddr.Postcode
}
}
},
AllowNote = "0",
cppheaderimage = ConfigurationManager.AppSettings["LOGOURL"],
BrandName = ConfigurationManager.AppSettings["BrandName"],
NoShipping = "0",
/*此外设置为1总是返回错误,设置为0无错误*/
AddressOverride = "1",
ReqConfirmShipping = "0"
},
Version = API_VERSION
}
});



当AddressOverride(Paypal说明是调用传递的地址将覆盖客户paypal账户中的地址) 设置为1(覆盖)时,

Country(一个枚举类型)和CountryName(string类型) 无论传递什么

结果都会包含一个异常:

10731 Shipping Address Country Empty The field Shipping Address Country is required

但是AddressOverride设置为0时就不会出现这个错误,请问哪位大哥有碰到过的?
帮下忙
...全文
84 1 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
tbc168 2011-05-23
Country=CountryCodeType.NL,

CountryCodeType这是个枚举,我都这样设置了,它还说我参数不完整,已经证实是paypal API的问题了

谢了
回复
qpang 2011-05-16
AddressOverride设置为0的意思是,,使用买家在paypal系统内的地址国家,设置为1,则使用你传递的地址和国家来覆盖掉paypal系统内的地址和国家。国家的参数名字能否检查是不是SHIPTOCOUNTRY, SHIPTOSTATE,SHIPTOCITY等等
回复
相关推荐
发帖
Web Services
创建于2007-09-28

1.2w+

社区成员

.NET技术 Web Services
申请成为版主
帖子事件
创建了帖子
2011-05-06 01:09
社区公告
暂无公告