【问题标题】:IPN response is blank when verifying the IPN验证 IPN 时 IPN 响应为空白
【发布时间】:2013-05-18 14:04:37
【问题描述】:

根据paypal document,当我们使用 IPN 将消息发送回 Paypal 后,我们会返回:-

PayPal will then send one single-word message, VERIFIED, if the message is valid; otherwise, it will send another single-word message, INVALID.

但是我时不时注意到即使付款成功,响应也可能是空白的。有没有其他人注意到这一点?

我要验证的代码是:-

var req = (HttpWebRequest)WebRequest.Create(Settings.PayPalPaymentUrl);

//Set values for the request back
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
byte[] param = Request.BinaryRead(Request.ContentLength);
strRequest = Encoding.ASCII.GetString(param);
strRequest += "&cmd=_notify-validate";
req.ContentLength = strRequest.Length;

//Send the request to PayPal and get the response
var streamOut = new StreamWriter(req.GetRequestStream(), Encoding.ASCII);
streamOut.Write(strRequest);
streamOut.Close();
var streamIn = new StreamReader(req.GetResponse().GetResponseStream());
strResponse = streamIn.ReadToEnd();
streamIn.Close();

99% 的案例我收到了VERIFIED,但我们时不时地看到一条空消息。

【问题讨论】:

    标签: c# paypal paypal-ipn


    【解决方案1】:

    如果有人直接访问该页面,而不是被 PayPal 击中,您会得到一个空白响应,这是怎么回事?

    【讨论】:

      猜你喜欢
      • 2017-02-14
      • 2012-11-14
      • 1970-01-01
      • 2015-02-11
      • 1970-01-01
      • 2016-08-03
      • 2017-12-15
      • 2012-11-19
      • 2012-10-18
      相关资源
      最近更新 更多