我是Paypal的新手,我尝试使用IPN知道交易何时完成。我已阅读Paypal documentation for IPN,其中提供了一些IPN listener code samples。我将PHP示例版本(没有任何更改)上传到我的服务器,并使用IPN模拟器为IPN侦听器生成伪造的IPN消息。我期待IPN监听器成功处理IPN消息,IPN模拟器确实返回了以下消息:" IPN已发送并且握手已经过验证"。
但是,IPN侦听器生成的日志文件表明侦听器无法正确处理IPN消息。以下是日志文件的内容:
[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
为什么IPN侦听器无法正常工作?有关信息,由于我还处于开发模式,我的网站上仍然没有SSL证书,但apparently SSL certificates are not needed to test the IPN listener。
答案 0 :(得分:1)
您发送给PayPal进行验证的以下字符串似乎是一些虚拟数据。您能否进行真正的沙盒支付测试并将真实的IPN数据发回PayPal以再次检查验证结果?
CMD = _notify-验证&安培; payment_type =即时&安培; PAYMENT_DATE =星期二+月+ 29 + 2016 + 18%3A16%3A38 + GMT%2B0100 +%28Hora +的+版%C3%83%C2%A 3 O +的+ GMT %29&安培; PAYMENT_STATUS =完成和放大器; address_status =确认和放大器; payer_status =验证和放大器; FIRST_NAME =约翰&放大器;姓氏=史密斯和放大器; PAYER_EMAIL =买家%40paypalsandbox.com和放大器; payer_id = TESTBUYERID01和放大器; ADDRESS_NAME =约翰+史密斯和放大器; ADDRESS_COUNTRY =美+美国和放大器; address_country_code = US&放; address_zip = 95131&放大器; ADDRESS_STATE = CA&放大器; ADDRESS_CITY =圣+何塞&放大器; address_street = 123 +任何+街道和放大器;商业=卖家%40paypalsandbox.com和放大器; RECEIVER_EMAIL =卖家%40paypalsandbox.com和放大器; receiver_id =卖家%40paypalsandbox.com和放大器; residence_country = US&放; item_name1 =东西和放大器; item_number1 = AK-1234功放;税务= 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 =购物&安培; txn_id = 302758056&安培; notify_version = 2.1&安培;定制= XYZ123&安培;发票= ABC1234&安培;的test_ipn = 1&安培; verify_sign = AFcWxV21C7fd0v3bYYYRCpSSRl31AHYNfmsVFESKyDLknmS3M5A8PkNI
答案 1 :(得分:0)
IPN代码https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php包含:
Form1.UpdateCube();
并且您收到的网址是小写的。也许这就是问题所在。