Welcome to WebmasterWorld Guest from 18.204.48.199

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Paypal and IPN

     
1:21 am on Oct 20, 2015 (gmt 0)

Junior Member

5+ Year Member

joined:June 18, 2010
posts: 170
votes: 1


Hello people,

I haven't posted anything in quite a while but, since I am struggling so bad with Paypal and IPN I thought I'd come back here to see if some good soul can help me understand.

I'm trying to set IPN and I am following Paypal's documentation from scratch, so I created my listener file with the PHP IPN listener code sample found at [github...] [dot] com/paypal/ipn-code-samples/blob/master/paypal_ipn.php

When I follow the instructions for the "Local Development Testing" and try to echo a simple string in between "if (strcmp ($res, "VERIFIED") == 0) {}" or the else part of the if clause nothing happens.

This is the ipn.log information:

[2015-10-19 20:44 America/New_York] HTTP request of validation request:POST /cgi-bin/webscr HTTP/1.1
Host: www.sandbox.paypal.com
Accept: */*
Connection: Close
Content-Length: 197
Content-Type: application/x-www-form-urlencoded

for IPN payload: cmd=_notify-validate&submit=Pay+invoice&cmd=_xclick&business=test-facilitator21%40test.com&item_name=test3&amount=1&first_name=John&last_name=Doe&email=jdoe%40test.com&invoice=3
[2015-10-19 20:44 America/New_York] HTTP response of validation request: HTTP/1.1 400 Bad Request
Date: Tue, 20 Oct 2015 00:44:06 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=rs6ti0vaT0Smt5lvVAkw2k_AVCVXR8R2gI6KtUTpn-bK1eBooekRmuV4WMdvJsToK2Thyl-qaqgkVHluD9eyCLHQ93hZ-KIIuLLZP0qkgxCQMirU97tM54UD81u2X5QXwYLZ8g5o9bqJvg18nNou-Yk5AJood5DhCAMDemwCg_4AY7JRvXV1QxJ1s4jK_FnkkHaH7YOtyOskpzcpEu9ITT7Zb0upqiAzHDMWbXzUwAGgls7drS6oQoOJ4_0; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Fri, 17-Oct-2025 00:44:06 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.72.108.11.1445301846414678; path=/; expires=Thu, 12-Oct-45 00:44:06 GMT
Vary: Accept-Encoding,User-Agent
Connection: close
Paypal-Debug-Id: 50b2566c618bc
Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D880%26app%3Dappdispatcher%26TIME%3D1452156246; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
Set-Cookie: Apache=10.72.128.11.1445301846399379; path=/; expires=Thu, 12-Oct-45 00:44:06 GMT
Strict-Transport-Security: max-age=14400
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1


Why is there a "HTTP response of validation request: HTTP/1.1 400 Bad Request" in this log file?

I have many other questions but in order to follow along with Paypal's recommended testing steps, I would like to understand why this first part is not working for me.

If anyone could help me in this regard it would be greatly appreciated since Paypal seems to not really care for one more implementation in their basket and offers no real support whatsoever.

Thanks
4:18 pm on Nov 2, 2015 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12555
votes: 3


I'm guessing your if statement is never returning a valid string comparison in the if/else logic -- and likely because of the 400 Bad Request header response. I ran a quick search and about the only area I could lead you to investigate is perhaps your payload (POST) data:
The server could not understand the request, probably due to a syntax error.
Resource: [developer.paypal.com...]


Also, it seems like some folks have had issues with the Cookie, according to other complaints out there regarding this type of response header from PayPal. If you cannot determine any issue with your POST data then perhaps that is your next area to analyze.