Forum

Thread tagged as: Problem, PayPal

Paypal Shop IPN Problem

Hi,

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;

1   

mc_gross=0.02&protection_eligibility=Eligible&address_status=confirmed&item_number1=T001&payer_id=8XZ4NWQHWGXCL&tax=0.00&address_street=30+Ivy+Crescent&payment_date=08%3A04%3A20+Jan+08%2C+2016+PST&payment_status=Completed&charset=windows-1252&address_zip=PE218BP&mc_shipping=0.00&mc_handling=0.00&first_name=Matthew&mc_fee=0.02&address_country_code=GB&address_name=Matthew+Lymer&notify_version=3.8&custom=&payer_status=verified&business=matthew%40tinfish-creative.co.uk&address_country=United+Kingdom&num_cart_items=1&mc_handling1=0.00&address_city=Boston&verify_sign=AjcxitjvHVlcxpkOtRt0yAIR4UaxAJ1FDNcz8v7ZF5YVBWYb1VnqnypT&payer_email=beelzzzebub%40hotmail.com&mc_shipping1=0.00&tax1=0.00&txn_id=22A686584Y901694D&payment_type=instant&last_name=Lymer&address_state=Lincolnshire&item_name1=Ticket+A&receiver_email=matthew%40tinfish-creative.co.uk&payment_fee=&quantity1=2&receiver_id=VGYEEGGBR8Q6W&txn_type=cart&mc_gross_1=0.02&mc_currency=GBP&residence_country=GB&transaction_subject=&payment_gross=&ipn_track_id=4f5a103615a39

2016-01-08 04:03:48

22A686584Y901694D

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);

start:
------------------------------------------------------------------------
POST:
Array
(
    [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");
        curl_close($ch);
        exit;
    }

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!

Thanks!

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.