Ich bin neu bei Paypal und ich versuche IPN zu verwenden, um zu wissen, wann eine Transaktion abgeschlossen ist. Ich habe die Paypal documentation for IPN gelesen, die einige IPN listener code samples bereitstellt. Ich habe die PHP-Beispielversion (ohne irgendwelche Änderungen) auf meinen Server hochgeladen und den IPN-Simulator verwendet, um eine gefälschte IPN-Nachricht an den IPN-Listener zu generieren. Ich erwartete, dass der IPN-Listener die IPN-Nachricht erfolgreich verarbeiten würde und der IPN-Simulator tatsächlich die folgende Nachricht zurückgab: "IPN wurde gesendet und der Handshake wurde verifiziert".PHP Paypal "offizielle" IPN-Listener funktioniert nicht richtig
Die Protokolldatei, die vom IPN-Listener generiert wird, zeigt jedoch an, dass der Listener die IPN-Nachricht nicht ordnungsgemäß verarbeiten konnte. Hier ist, was die Protokolldatei sagt:
[2016-03-29 17:48 UTC] HTTP request of validation request:POST /cgi-
bin/webscr HTTP/1.1
Host: www.sandbox.paypal.com
Accept: */*
Connection: Close
Content-Length: 941
Content-Type: application/x-www-form-urlencoded
for IPN payload: cmd=_notify-validate&payment_type=instant&payment_date=Tue+Mar+29+2016+18%3A16%3A38+GMT%2B0100+%28Hora+de+Ver%C3%83%C2%A3o+de+GMT%29&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&payer_email=buyer%40paypalsandbox.com&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&business=seller%40paypalsandbox.com&receiver_email=seller%40paypalsandbox.com&receiver_id=seller%40paypalsandbox.com&residence_country=US&item_name1=something&item_number1=AK-1234&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=12.34&mc_gross_1=12.34&mc_handling=2.06&mc_handling1=1.67&mc_shipping=3.02&mc_shipping1=1.02&txn_type=cart&txn_id=302758056¬ify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AHYNfmsVFESKyDLknmS3M5A8PkNI
[2016-03-29 17:48 UTC] HTTP response of validation request: HTTP/1.1 200 OK
Date: Tue, 29 Mar 2016 17:48:00 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=2I3qnyCkBB3XdWjX_k6qUfsHuBc1GAbvT7Mvx82vTNttPkSuPqzY2-m8MQq8SaoGHm7SWL4gG3vnyU48YFmYwci1hBFCrewHMEzxJHb6vwOdE3JHuDBlWlPpPKljHvs0XDhyhrpxKRdBKHJbfB8S2r6dpS12MhsnjD20c3TuoB50fahlPAwe-DB_fzV4doj7pFdqyGkujspMt-GVcu4Oag-DHwSpiyUPPDwUFlDP0Mel2BZtpkS9RMOp67FTwauchCGQ43Q1eGBCB5mCsokggySU-xhqk1BVQVT_0_vzmiZuGtQD17fQpVRE396JsQynQO3OKfAsq5hhcKHmRMYbmgY-XLZcGqqRKFsYPFCPMb4oTm79-BbDtOzhMw0VrG70wmInHRwhUEaGWTHoE3Cr1bHJGHuH3T6fJPXme6ygPzugAlmMZIFNsiKNYjy; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Fri, 27-Mar-2026 17:48:00 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navlns=0.0; expires=Thu, 29-Mar-2018 17:48:00 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.72.108.11.1459273680419868; path=/; expires=Thu, 22-Mar-46 17:48:00 GMT
Vary: Accept-Encoding,User-Agent
Connection: close
HTTP_X_PP_AZ_LOCATOR: sandbox.slc
Paypal-Debug-Id: 513d36fd62f6b
Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D1880%26app%3Dappdispatcher%26TIME%3D3502242390; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
Strict-Transport-Security: max-age=14400
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
INVALID
[2016-03-29 17:48 UTC] Invalid IPN: cmd=_notify-validate&payment_type=instant&payment_date=Tue+Mar+29+2016+18%3A16%3A38+GMT%2B0100+%28Hora+de+Ver%C3%83%C2%A3o+de+GMT%29&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&payer_email=buyer%40paypalsandbox.com&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&business=seller%40paypalsandbox.com&receiver_email=seller%40paypalsandbox.com&receiver_id=seller%40paypalsandbox.com&residence_country=US&item_name1=something&item_number1=AK-1234&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=12.34&mc_gross_1=12.34&mc_handling=2.06&mc_handling1=1.67&mc_shipping=3.02&mc_shipping1=1.02&txn_type=cart&txn_id=302758056¬ify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AHYNfmsVFESKyDLknmS3M5A8PkNI
Warum funktioniert der IPN-Listener nicht richtig? Für Informationen, da ich noch im Entwicklungsmodus bin, habe ich noch kein SSL-Zertifikat auf meiner Website, aber apparently SSL certificates are not needed to test the IPN listener.
Sie sprechen über die "überprüft" string, nicht wahr? In der POST-Antwort habe ich nur ein "verifiziert" auf dem Feld "payer_status". Aber dieses Feld ist eine [Zahlungsinformationsvariable] (https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/), die den Wert "verifiziert" und "ungeprüft" annehmen kann. Dies scheint sich von dem [einzelnen Wort "VERIFIED" oder "INVALID"] (https: //developer.paypal) zu unterscheiden.com/docs/classic/ipn/integration-guide/IPNImplementation /), die ich von Paypal erhalten soll, nachdem ich die POST-Daten zurückgeschickt habe. – Daniel