Using Django-PayPal - PayPal IPN getting 401 - paypal-ipn

I'm trying to setup Django-Paypal and have got as far as the return from PayPal. To cut a long story short, in my Apache access logs, I get the following whenever I process a payment through PayPal (and PayPal POSTs the result back to my server):
173.0.82.126 - - [27/Oct/2012:16:42:52 +0200] "POST /my/super/secret/notify/url/ HTTP/1.0" 401 787 "-" "-"
The notify view does have #csrf_exempt for the purpose of troubleshooting this error and still it doesn't work.
If anyone can tell me how to solve this issue (which is clearly a permissions/authorization issue), I'd be very grateful!
P.S.: I've tried adding WSGIPassAuthorization on to my apache config file, which also didn't help.

Turns out, I was being very dim.... We had Basic Authentication on the server to keep out prying eyes until launch, so of course PayPal was being rejected with a 401.....
So the answer of course is to remove the Basic Authentication while testing the IPN - all clear!
Amazing how stepping back from something for a bit reveals the most glaring (and simple) of mistakes.

I've Just hit the same issue but kept the basic authentication by adding a few 'Allow from' rules in the virtual host:
Allow from 173.0.82.77
Allow from 173.0.82.126
Allow from 173.0.82.78
Satisfy Any
PayPal Sandbox ip addresses

Related

Payment Timeouts - Showing 504 Gateway Timeout

We have a cpouple of sites using website payments standard and are submitting the forms as a post to the https://www.paypal.com/cgi-bin/webscr address
some customers (not all) are experiencing a timeout when trying to get to the paypal payment page after the post.
The site sits and status bar says 'waiting for www.paypal.com'
The web Inspector on chrome shows a 504 Gateway Timeout error after 1 minute and then the user gets sent to a paypal page with a paypal debug-id down at the bottom
This is intermittent, sometimes there are no problems at all then sometimes a user cant get through, so we try at the same time and have no problem
has anyone else seen anything like this?
any ideas?
paypal support are 'looking into it' and said it couldb e a 'problem with our endpoint api' ... all we do is post to them and and then they send back a pdt/ipn when complete. and it works from different locations at the same time one person is down, someone accross thr country is fine, its like when there is a problem, the www.paypal.com address cannot be found by the browser trying to connect
You are not alone. The old PayPal webform integration seems to have this problem every now and then. I believe there is nothing you can do other than hope that your customers are not affected (much).
The only alternative is to use a different PayPal API to integrate it in your shop.

IPN Delivery Failed:I/O error

been trying to wrap my head around an issue I have with the IPN tester, not 100% sure if its my hosting company's problem or Paypal Developer 'beta' to be honest but my IPN's have worked fine on a few sites I have for atleast a year and now it doesn't on any of them. I've not changed anything and now im getting
IPN Delivery Failed:I/O error: www.mywebsitesname.co.uk; nested exception is java.net.UnknownHostException: www.mywebsitesname.co.uk
and none of my NotifyUrl.ashx handlers are working.
any ideas what this actually means in english? any more info. from me required to help you diagnose my issue?
#
AS AN UPDATE (27-08-2013), I thought I would try out the original C# SDK sample code from Paypal that I used to set up my IPN's with about a year or three ago (ie. it worked great with the IPN simulator). I have put it onto two different hosting companies servers to check its not an issue with a particular hosting server and my results using the IPN Simulator show "error 500: internal server error" for one and "IPN Delivery Failed:I/O error: www.ang##########.co.uk; nested exception is java.net.UnknownHostException: www.ang############.co.uk".
In short, I have the same identical sample file from Paypal (that used to work) in the root of each hosting companies servers and im using the same IPN simulator settings, with the exception of the IPN handler URL has the webaddress of the server followed by '/Handler.ashx' (which is the handler file) but i'm getting different errors.
Also to make this a bit more interesting, today I correctly received an IPN from Paypal to one of the same hosting server webaddress, with a 'transaction_subject : PayPal money request from xxxxxxxx' which was received and processed by my existing IPN handler (not the sample one from Paypal) and returned the correct info. to receive 'IPN Response: VERIFIED DateTime: 27-08-2013 19:05' so this got through and worked fine.
So in conclusion, I wonder if Paypal have either changed something and not informed the community or have an issue with their IPN simulator / CART IPN. If anyone can help or if a Paypal support engineer would like to work with me to try out some code, etc, please get back to me as I will keep trying to solve this but to be honest I see not what else I can do from my end as I've seen working IPN and a non working IPN simulator.
As extra info. here is an IPN Message as from my sandbox seller test account, that can't get through to my IPN handler on one of the same hosting servers (returns error 500) yet this used to get through and nothing has changed.
'mc_gross=2.75&protection_eligibility=Ineligible&address_status=confirmed&item_number1=BabyGrow2&payer_id=KHJGBQZNAFB7L&tax=0.00&address_street=1 Main St&payment_date=14:34:07 Aug 27, 2013 PDT&payment_status=Pending&charset=windows-1252&address_zip=95131&mc_shipping=0.00&mc_handling=0.00&first_name=Test&mc_fee=0.28&address_country_code=US&address_name=Test Buyer&notify_version=3.7&custom=1csi4t45gy4gkz45r5r4t0ey&payer_status=verified&business=wow####gmail.com&address_country=United States&num_cart_items=1&mc_handling1=0.00&address_city=San Jose&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31A1fBAmiE5lcDRsQKQNaqoyQI7ucQ&payer_email=wow#######gmail.com&mc_shipping1=0.00&tax1=0.00&txn_id=8SG98957G0030294Y&payment_type=instant&last_name=Buyer&address_state=CA&item_name1=Baby Grow Age 0 - 1&receiver_email=wow#########gmail.com&payment_fee=&quantity1=1&receiver_id=8QRMB3QFHCL56&pending_reason=paymentreview&txn_type=cart&mc_gross_1=2.75&mc_currency=GBP&residence_country=US&test_ipn=1&transaction_subject=1csi4t45gy4gkz45r5r4t0ey&payment_gross=&ipn_track_id=7b4507c8c4313'
Still hoping we can resolve this soon.
Many Thanks.
Trev.
Asp.net / C# / HTML / CSS3

Paypal Error Please try to contact merchant?

I am facing the same problem as seen in this http://forge.prestashop.com/browse/PNM-1165
It says this following message after I click on 'pay with paypal'
Error occurred:
Please try to contact the merchant:
PayPal response:
->
I don't know what to do T^T
Im using prestashop 1.5.4 and paypal module 3.5
There is one reply suggestion from Francois Gaillard added a comment - 29/Mar/13 9:29 AM
He said that
This issue occurs when your server IP has been blocked by the PayPal's API. If you are running share hosting environment the server can be banned blacklisted by PayPal.
Please, try to contact PayPal support they should be able to help you.
Let us know when you have more details please.
Thank you,
Kind regards.
That answer is incorrect in as much that we do not block IP addresses to our API endpoints without making the merchant aware.
It is correct, from our experience, that the above error occurs in PrestaShop when your server is unable to establish a successful HTTPS connection with our API endpoint.
I suggest you take a look at General troubleshooting - API timeout and run the tests provided in it.
Pay special attention to the AT&T block we mention in there, as we've seen a large number of API callers getting blocked at that level.
Unfortunately that block is beyond our control - but we've heard good reports of merchants getting in touch with AT&T and getting that block lifted (if confirmed to be blocked there).

Paypal Sandbox IPN error

After paypal updated their interface (sandbox.paypal.com for example is not working, now you have to go to developer.paypal.com) many of the things are not working: 2 of them are particularly frustrating and I was hoping someone here knew how to get around them:
Am I the only one whose sandbox customer test accounts are not able to make purchases? The transaction page says they are not available.
IPN validation is not letting me send a https request. When I do it says there is something wrong with the server name. Yesterday however before the update I could get verified status. If I dont put https, now my handler gives me an invalid responde status, code: 400. What does it mean?
To fix the HTTP 400 error, follow the instructions in https://www.x.com/content/bulletin-ipn-and-pdt-scripts-and-http-1-1 and update your code to pass "Host" information. Ideally, things should work with just the recommended changes from the above link. Apparently, thats not the case. Here is a fix from one of the PayPal MTS person - PalPAL sandbox IPN processor rejecting all messages?
Remove the "cmd=notify-validate" option from the validation URL. I tried this and it worked. Though it doesn't return the right string, atleast it doesnt break with the 400 error.
While we wait for a fix from Paypal, I wonder how a company like PayPal can cause such a huge blunder and not post anything on their status page - https://www.x.com/developers/paypal/documentation-tools/site-status/pp-cri. It just makes you think that even smaller companies can do a better job than companies like PayPal.
For the code:400 issue, you have to update the post to version 1.1. That information is located here.
https://www.x.com/content/bulletin-ipn-and-pdt-scripts-and-http-1-1 in this bulletin.
However, as I posted before the asp.net example uses a call, that does not exist, so I was only able to get mine partly working. After fixing this, the servers appear to be rejecting calls to https, or the cert they have installed is invalid.
Action Required before February 1, 2013
Merchants need to update their IPN and/or PDT scripts to use HTTP 1.1, and include the “Host” header in the IPN postback script. In addition to this bulletin, these merchants will be notified via a direct email.
Alright, seems to be fixed!
If you are having trouble logging in, like suggested above, clear cache and cookies and try again.
Regarding the error 400, seems to have been solved by paypal!

Unable to get a valid IPN postback with django-paypal

After spending several hours trying to get django-paypal (originally dcramer's fork) to get a 200 OK response from PayPal IPN, I pinpointed the error to PayPal adding an empty, spurious &cmd= argument when using the IPN Simulator. If I leave the &cmd= in, I get a 400 Bad Request response when I try to postback; if I take it out I get a 200 OK but, of course, the postback is invalid because it's not what PayPal sent my server.
Of course, I'd be absolutely happy to do away with the IPN Simulator entirely and simply use Sandbox accounts, but those are broken too: the ones I create through the developer interface can't login (login failed errors); the ones I created through the "regular" interface on the sandbox site don't send any IPN whatsoever no matter what.
So, actually there's two questions here:
is there a way to work around the IPN Simulator &cmd= bug?
is there a way to make the sandbox accounts work?
A reply to either one would make me very very happy.
Many of the issues you've experienced are now cleared up. The IPN issue and some developer/sandbox log in issues have been cleared up as of Monday evening. If you are still experiencing any issues please let me know and I'll be more than willing to look into this further.