C# Paypal expresscheckout ErrorCode=7&;Desc=字段格式错误:10471 ReturnRUL无效
我在C# Paypal expresscheckout ErrorCode=7&;Desc=字段格式错误:10471 ReturnRUL无效,c#,paypal,C#,Paypal,我在asp.net C#中使用贝宝ExpressCheckout,出现错误: ErrorCode=7&Desc=字段格式错误:10471 ReturnRUL无效 当我调试代码时 string returnURL = "http://www.mycompany.com/paypalConfirm.aspx"; ..... string pStrrequestforNvp = encoder.Encode(); string pStresponsenvp = HttpCall(pStrrequest
asp.net C#
中使用贝宝ExpressCheckout
,出现错误:
ErrorCode=7&Desc=字段格式错误:10471 ReturnRUL无效
当我调试代码时
string returnURL = "http://www.mycompany.com/paypalConfirm.aspx";
.....
string pStrrequestforNvp = encoder.Encode();
string pStresponsenvp = HttpCall(pStrrequestforNvp, uid.ToString());
NVPCodec decoder = new NVPCodec();
decoder.Decode(pStresponsenvp);
returnURL
在pStrrequestforNvp
中显示了returnURL=http%3a%2f%2fwww.mycompany.com%2fpaypalConfirm.aspx
,我觉得这很正常
有人能帮我找出为什么我出现10471
错误吗
这是我的全部请求代码:
string host=“www.paypal.com”
HTTPACK返回错误代码。
根据一些论坛,这可能是一个问题,Express(PROFE工作如预期…)您可以考虑PRO版本,直到贝宝修复Express版本号,这不是Express签出的问题。尝试删除URL编码,看看是否有帮助。如果没有,请发布一个完整原始请求的示例,这样我就可以达到峰值。感谢回复Andrew,但是如何删除URL编码?@AndrewAngell您节省了我的时间,删除URL编码很有效。string returnURL = "https://www.mycompany.com/paypalconfirm.aspx";
string cancelURL = "https://www.mycompany.com/paypalconfirm.aspx";
NVPCodec encoder = new NVPCodec();
encoder["METHOD"] = "SetExpressCheckout";
encoder["RETURNURL"] = returnURL;
encoder["CANCELURL"] = cancelURL;
encoder["PAYMENTREQUEST_0_AMT"] = amt;
encoder["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
encoder["PAYMENTREQUEST_0_CURRENCYCODE"] = "USD";
encoder["PAYMENTREQUEST_0_SHIPTONAME"] = shipToName;
encoder["PAYMENTREQUEST_0_SHIPTOSTREET"] = shipToStreet;
encoder["PAYMENTREQUEST_0_SHIPTOSTREET2"] = shipToStreet2;
encoder["PAYMENTREQUEST_0_SHIPTOCITY"] = shipToCity;
encoder["PAYMENTREQUEST_0_SHIPTOSTATE"] = shipToState;
encoder["PAYMENTREQUEST_0_SHIPTOZIP"] = shipToZip;
encoder["PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE"]= shipToCountryCode;
string pStrrequestforNvp = encoder.Encode();
string pStresponsenvp = HttpCall(pStrrequestforNvp,"");
NVPCodec decoder = new NVPCodec();
decoder.Decode(pStresponsenvp);