PayPal-IPN Fails

Hi so im using cloudfare to conect my domain to my server, but for some reason it doesnt handle the POST requests of PayPal? What do i do? Cuz everything worked fine untill around 2 days ago.
64 Replies
Sp1nkel
Sp1nkelOP4mo ago
that all does not work :/
Darkkaiser
Darkkaiser4mo ago
check the ‘bot fight mode’ blocks, some days ago they changed the way it works and now it is blocking ‘post’ requests...
Sp1nkel
Sp1nkelOP4mo ago
Is that for a paid thing? Cuz I can’t seem to find it others I will look again in a hour or so but couldn’t find rq en xD
Darkkaiser
Darkkaiser4mo ago
try disabling it and see if you get the ‘post’ requests again. Dash > Domain > Security > Bots > Bot Fight Mode | ON/OFF
Sp1nkel
Sp1nkelOP4mo ago
Doesn’t show me it :/
No description
Darkkaiser
Darkkaiser4mo ago
in the new panel... ok. Overview > Bot Traffic > Bot fight mode
Sp1nkel
Sp1nkelOP4mo ago
Alr dissabled :/
Darkkaiser
Darkkaiser4mo ago
you should check the logs and see the time of the ‘post’ requests and see if they were blocked by cloudflare or by the origin server. in my case it was the ‘bot fight mode’.
Sp1nkel
Sp1nkelOP4mo ago
You mean the logs from cloudfare? Cuz I have been searching for those and the one I found where empty :/ And nothing got changed on my own server so it would be weird if it just started blocking it after a few days
Darkkaiser
Darkkaiser4mo ago
Security > Analytics.
Sp1nkel
Sp1nkelOP4mo ago
Ye that all says no logs
Darkkaiser
Darkkaiser4mo ago
Whenever you access your website using your domain, you should see the requests in that section.
Sp1nkel
Sp1nkelOP4mo ago
For Some reason it doesn’t log anything there Do I need to add a filter or security rule?
Darkkaiser
Darkkaiser4mo ago
No, at least not that I know. In my case I do have some rules, so...
Sp1nkel
Sp1nkelOP4mo ago
Oh hmm Idk why it just stopped working it’s all so weird 😭 Alr tried contacting Paypal but they said nothing was wrong
Darkkaiser
Darkkaiser4mo ago
in Analytics > Events, you have all blocked requests
Sp1nkel
Sp1nkelOP4mo ago
No description
Sp1nkel
Sp1nkelOP4mo ago
It also stopped getting any info here
No description
Darkkaiser
Darkkaiser4mo ago
that's weird, if when you enter your domain (example.com) it works, but you don't receive any request through cloudflare, possibly it's a problem with the DNS or NS.
Sp1nkel
Sp1nkelOP4mo ago
Oh hm
Sp1nkel
Sp1nkelOP4mo ago
No description
Darkkaiser
Darkkaiser4mo ago
did you buy the domain from cloudflare or are you using it as an extra layer?
Sp1nkel
Sp1nkelOP4mo ago
Extra later Later Layer* It’s via nameservers From namecheap
Darkkaiser
Darkkaiser4mo ago
that's the problem
Sp1nkel
Sp1nkelOP4mo ago
Oh why then? Cuz it first worked
Darkkaiser
Darkkaiser4mo ago
you need to go to your domain provider and see what happened there.
Sp1nkel
Sp1nkelOP4mo ago
I will try to contact them and come back to you alr? @Darkkaiser they told me everything gets processed first by the DNS provider and then by my server So it has to do with the server or Cloudflare but idk how I can find it :NotLikeThis:
DarkDeviL
DarkDeviL4mo ago
@Sp1nkel, ... are you the same person from the Cloudflare Community thread I mentioned above?
Sp1nkel
Sp1nkelOP4mo ago
Ye but it was easier here couldn’t find the discord but I found it And on disc it’s more interactive and stuff
DarkDeviL
DarkDeviL4mo ago
Great with that clarity, so we can avoid spreading the same topic across multiple distinct platforms. 🙂
Sp1nkel
Sp1nkelOP4mo ago
Ohhh Mb :NotLikeThis:
DarkDeviL
DarkDeviL4mo ago
With the addition of your domain name above, - Your DNS records aren't Proxied (:cloudflare:), so Cloudflare is only working as a DNS provider for you. The IPN requests (if they are being sent by PayPal) will be going directly from PayPal to your own server.
Sp1nkel
Sp1nkelOP4mo ago
Huh Hmm cuz it looks like (for me) it looks like it does send but it doesn’t recive it at the server It’s just so weird 😭 cuz Paypal ain’t giving me info and my server is also not giving any info
DarkDeviL
DarkDeviL4mo ago
The "DNS only" thing from your screenshot above means that PayPal will go directly to the IP address of you own server. E.g. the IP address from Infraly, LLC. So it will be somewhere between PayPal and Infraly, LLC, where it is going wrong. ... Are you able to share (at least, something of) what you see on the IPN History page on PayPal?
Sp1nkel
Sp1nkelOP4mo ago
Ye ofc ofc give me 15 min will be at my computer then
Sp1nkel
Sp1nkelOP4mo ago
(all testing by sending payments on other acc xD
No description
No description
DarkDeviL
DarkDeviL4mo ago
With no HTTP code ("HTTP-antwoordcode"), the most likely reason would be that PayPal wasn't able to reach your server (e.g. network error, or similar). If you change the Proxy status for the "ipn" DNS record to Proxied (:cloudflare:), and try again, - does that make a difference?
Sp1nkel
Sp1nkelOP4mo ago
nope also doesnt seem to work :/ its so weird cuz if i send the like ipn message via my own computer it works correctly
DarkDeviL
DarkDeviL4mo ago
What does IPN History say with the Proxied (:cloudflare:) test?
Sp1nkel
Sp1nkelOP4mo ago
exactly the same
Sp1nkel
Sp1nkelOP4mo ago
No description
DarkDeviL
DarkDeviL4mo ago
HTTP code ("HTTP-antwoordcode") is 500 there. So at least, there is a connection to something.
Sp1nkel
Sp1nkelOP4mo ago
when i instantly open it second time that it sends it just vanishes randomly like second time that paypal tries to send
DarkDeviL
DarkDeviL4mo ago
What kind of stuff do you run for the /paypal-ipn endpoint? Some shopping system / plugin you downloaded?
Sp1nkel
Sp1nkelOP4mo ago
so when its oorspronkelijk (first message) it says 500 and when it resend it goes to npothing
DarkDeviL
DarkDeviL4mo ago
Something you built on your own? Or what exactly?
Sp1nkel
Sp1nkelOP4mo ago
made it myself xD it verifies the payment tht it came trough and logs it so doesnt do much more then verify
DarkDeviL
DarkDeviL4mo ago
What is being logged on the 500 then?
Sp1nkel
Sp1nkelOP4mo ago
you mean server side?
DarkDeviL
DarkDeviL4mo ago
Yep.
Sp1nkel
Sp1nkelOP4mo ago
nothing dont get any error and when i do a post request exactly like paypal but on my own machine it works perfectly fine
DarkDeviL
DarkDeviL4mo ago
Have you been tail'ing the access log (not the error log, but access log), to see activity there?
Sp1nkel
Sp1nkelOP4mo ago
yep doesnt show me anything there from today
DarkDeviL
DarkDeviL4mo ago
Are you able to share the home-made code?
Sp1nkel
Sp1nkelOP4mo ago
in dms if possible?
DarkDeviL
DarkDeviL4mo ago
And perhaps stuff like your web server configuration, how it's setup, and similar? Go ahead.
Sp1nkel
Sp1nkelOP4mo ago
im using nginx to connect it to the internet this is /etc/nginx/sites-available/ipn.2b2t.market
upstream paypal_ipn_app {
server 127.0.0.1:3000;
}

server {
listen 80;
listen 443 ssl;
server_name ipn.2b2t.market;
ssl_certificate /etc/letsencrypt/live/ipn.2b2t.market/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ipn.2b2t.market/privkey.pem;

location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
upstream paypal_ipn_app {
server 127.0.0.1:3000;
}

server {
listen 80;
listen 443 ssl;
server_name ipn.2b2t.market;
ssl_certificate /etc/letsencrypt/live/ipn.2b2t.market/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ipn.2b2t.market/privkey.pem;

location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
DarkDeviL
DarkDeviL4mo ago
Have you tried adding access_log and error_log to that nginx configuration, to see what nginx is seeing on them? Or only looked in the logs from your own code (which you sent privately)?
Sp1nkel
Sp1nkelOP4mo ago
dont got any logs isnt sending me any gonna try to get in touch again with paypal tommorow
DarkDeviL
DarkDeviL4mo ago
You can try adding something like:
access_log /tmp/access_ipn.2b2t.market.log combined;
error_log /tmp/error_ipn.2b2t.market.log warn;
access_log /tmp/access_ipn.2b2t.market.log combined;
error_log /tmp/error_ipn.2b2t.market.log warn;
And then look at what you have (or are getting) in "/tmp/access_ipn.2b2t.market.log" and "/tmp/error_ipn.2b2t.market.log". I'm suspecting the most recent 500 error may eventually be something between nginx and your application.
Sp1nkel
Sp1nkelOP4mo ago
Impossible cuz when I send the exact same POST requests to the domain via a other server or my computer it works
DarkDeviL
DarkDeviL4mo ago
I'd go as far as to say nothing is really impossible, when it comes to tech/IT stuff. But anyway, initially, without Poxied (:cloudflare:), it seemed like PayPal's netwrok couldn't reach your server. Now, it seems like there's at least life (through Cloudflare), - but some unhandled error somewhere, causing a 500 to PayPal. If Cloudflare was blocking it (e.g. WAF or Bot Fight Mode), it should have been a 403 on the HTTP code ("HTTP-antwoordcode").
Sp1nkel
Sp1nkelOP4mo ago
i checked it but it also gives error 500 for a short time (first time it sends the IPN) the second time it tries to send it to my server the error just vanishes

Did you find this page helpful?