Thread tagged as: Problem, PayPal

Paypal Shop IPN Problem


I've installed the Paypal Shop addon, and it seems to work well in most regards - but, the website is not registering orders.

The IPN url is set up correctly with paypal, and into perch2_shop_log, I have this line for an example payment I've done;



2016-01-08 04:03:48


Can you see anything wrong? As I've followed the installation fully, and the payment was successful via paypal.

Matthew Lymer

Matthew Lymer 1 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you get any errors?

Nope, debug seems clean and paypal is happy through the whole process.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is this a new build, or was it working previously?

Brand new today - I can see the logVerify field in the log table is null for the row - should this have a value?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have curl installed, and are the certificates up to date?

Did notice something slightly odd - Debug on the order page shows this:

Attempting app installation: perch_shop_paypal
SHOW TABLES LIKE "perch2_shop_orders"

Surely it shouldn't be attempting installation when the app is already installed?

Curl is installed - not sure what certificates your referring to or how to see if they're up to date though.

I don't have an SSL Cert, although I assume you're talking about something specific to curl?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's going to keep checking for the presence of the database table while the query returns no results. Once you have an order, it'll stop doing that.

I think it's failing the verification step, but I'm not sure why. There's a bunch of manual file logging you can enable in the callback/ipn_callback.php script. Set $log = true; at the top of the file and it'll log everything that happens during the IPN callback to a text file.

Ok - where will it log it?

No worries I found it, it looks like this (I've of course hidden my personal data and put an ellipses in its place);

    [mc_gross] => 0.01

have POST:

Hmm, where it cuts off seems to imply that the curl_exec has not returned "VERIFIED", I'll see if I can debug the segment manually.

Possibly the root authority thing - I am annoyingly having to work on a windows server - does that have any known issues in this area?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Cutting off there, I'd suspect this part:

if( !($res = curl_exec($ch)) ) {
        error_log("Got " . curl_error($ch) . " when processing IPN data");

Not sure why that's logging to the error log and not the log file... sorry, I didn't write this and it's very old.

Why thank you sir - that lead me to the certificate problem - I downloaded cacert.pem, put it in the right place, and now it works!


Although I'm now trying to figure out how to get paypal to return to my site on success - any advice?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is it getting the right return URL?

No worries - I didn't realise that Paypal defaults to NOT follow return urls.