Paypal IPN Simulator gibt immer INVALID zurück, obwohl das Postback korrekt ist

Wir sind dabei, unser IPN auf TLS zu aktualisieren, und werden bei Verwendung des IPN-Simulators immer wieder mit INVALID zurückgemeldet.

Sobald die Anfrage beim Listener eintrifft, wird sie protokolliert. Kurz bevor die Daten zu Paypal zurückkehren, werden die URL und die Daten protokolliert. Diese Info ist unten.

An den Daten scheint nichts auszusetzen. Ich habe diffmerge sogar verwendet, um festzustellen, dass es keine Unterschiede gibt, außer cmd = _notify-validate &

Ist es nur so, dass dasIPN Simulator wird nie gültig zurückgegeben?

Die URL direkt vor der Anfrage lautet:

https://www.sandbox.paypal.com/cgi-bin/webscr

Die geposteten Daten sind

cmd=_notify-validate&payment_type=instant&payment_date=Mon May 23 2016 17:41:16 GMT 1000 (E. Australia Standard Time)&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&[email protected]&payer_id=TESTBUYERID01&address_name=John Smith&address_country=United States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San Jose&address_street=123 any street&[email protected]&[email protected]&[email protected]&residence_country=US&item_name=something&item_number=CHIMPREWRITER-LIFE&quantity=1&shipping=3.04&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=139&mc_gross_1=139&txn_type=web_accept&txn_id=928133899&notify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AU-9VToMcj-IcSKMfmb8nz2kgIe.

Die Daten von Paypal sind

payment_type=instant&payment_date=Mon May 23 2016 17:41:16 GMT 1000 (E. Australia Standard Time)&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&[email protected]&payer_id=TESTBUYERID01&address_name=John Smith&address_country=United States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San Jose&address_street=123 any street&[email protected]&[email protected]&[email protected]&residence_country=US&item_name=something&item_number=CHIMPREWRITER-LIFE&quantity=1&shipping=3.04&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=139&mc_gross_1=139&txn_type=web_accept&txn_id=928133899&notify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AU-9VToMcj-IcSKMfmb8nz2kgIe.

Zur Referenz lautet der Code:

// This was legacy code I was trying in case there were formatting problems. The code "cmd=_notify-validate&" + _request.Form; does some URL encoding which I thought might be causing problems. Either way, we still get INVALID
string s = "cmd=_notify-validate";
foreach (string paramName in _request.Form)
{
    string paramValue = LicServiceTools.Encode(_request.Form[paramName]);
    //s = s + string.Format("&{0}={1}", paramName, paramValue);
    s = s + string.Format("&{0}={1}", paramName, _request.Form[paramName]);
}

string address = "https://www.paypal.com/cgi-bin/webscr";
if (this.useSandBox)
{
    address = "https://www.sandbox.paypal.com/cgi-bin/webscr";
}
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(address);
req.ProtocolVersion = HttpVersion.Version11;
//Set values for the request back
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";

// ALSO DOESNT WORK
//string strRequest = "cmd=_notify-validate&" + _request.Form;
//req.ContentLength = strRequest.Length;

errorLogger.Info(s);
errorLogger.Info(address);

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

// at this point, strResponse = INVALID

Antworten auf die Frage(2)

Ihre Antwort auf die Frage