我通过使用以下方法将其回传到PayPal来验证在ASP WebPage中收到的PayPal请求:
public bool ValidateRequest(HttpRequest request)
{
var sb = new StringBuilder();
sb.Append("cmd=_notify-validate");
foreach (string paramName in request.Form)
{
var paramValue = UrlEncode(request.Form[paramName]);
sb.AppendFormat("&{0}={1}", paramName, paramValue);
}
var parameters = sb.ToString();
var data = Encoding.UTF8.GetBytes(parameters);
var webClient = new WebClient();
webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
var uploadData = webClient.UploadData(validatingUrl, "POST", data);
var message = Encoding.UTF8.GetString(uploadData);
return message == "VERIFIED";
}
在我收到名为RamónMartín的用户的付款之前,此代码在过去两年中运行良好。这是他的名字从IPN记录的方式:
姓氏=马丁&安培;如first_name = RAMN
上述方法适用于中文,日文和俄文名称。任何想法如何解决当前案件?