Paypal Bad request HTTP 400

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Hi guys,

i am looking for the reason why the paypal notification server always throws 400 Errors on
~/Plugins/PaymentPayPalStandard/IPNHandler

Has anyone fixed that before?
3 years ago
Sorry, my mistake.

There is a second entry  in
paypal > profile and settings > website Preferences Update > Auto Return > Enter URL and Save

Don't know why IPNHandler was entered here.

You may close this post.
3 years ago
Hi
still having 20 "400 bad request" through
builtin@search_engine_record.com for
.../Plugins/PaymentPayPalStandard/IPNHandler

Paypal sent in an email complaining about that.

So i added to both robots.txt (manually edited) and custom.robots.txt
Disallow: /Plugins/PaymentPayPalStandard/IPNHandler

Still having those errors in log.
3 years ago
tomsen wrote:
Paypal sent in an email complaining about that

Complaining about what ?

Did builtin@search_engine_record.com place an order ?
Do you mean Paypal is sending a notification for an order change for the customer builtin@search_engine_record.com ?
3 years ago
As I understand it, builtin@search_engine_record.com is the 'customer' account NopCommerce uses for search engines, so some search engine is ignoring the robots.txt and pinging the plugin IPN url enough to draw PayPal's attention.  

If it was a file or directory in IIS you could restrict access down to paypal's domain, but since it is a route I'm not immediately aware of any way to filter out everyone except them at the server level.  You could download the source from github and modify the IPNHandler method in the controller though.
3 years ago
af1racing, you exactly understood what happened.

Will modify the controller with a catch

if (Customer.Id == NumberOfbuiltin@search_engine_record.com) {
redirect to some dumpsite
} else {
=> standard controller
}

and see if this is working as expected.

Thanks a lot for your smart hint!
3 years ago
Sounds like you're on the right track, and just FYI the builtin@search_engine_record.com ID is typically == 2

you also have the _workContext in the controller so any of the below may be helpful.  To be safe, I would use PayPal's IPN simulator to see what a real ping from them shows up looking like before moving to production.


            var customerId = _workContext.CurrentCustomer.Id;
            var isGuest = _workContext.CurrentCustomer.IsGuest();
            var isSearchEngine = _workContext.CurrentCustomer.IsSearchEngineAccount();
            var isSystemAccount = _workContext.CurrentCustomer.IsSystemAccount;
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.