"An IPN transaction failed verificationed for this order" error with WPP

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

Hi Folks,

I just changed the PayPal WPP settings to live, and changed the API credentials to my client's account. I tested out payment by credit card, and it worked great. However, when I test the PayPal payment, I get the above error. I enabled IPN in the profile section of PayPal after the first failure, and it still fails. The error message "An IPN transaction failed verificationed for this order" displays in the "view order" section under "Admin Comments".

Any help for this would be much appreciated!

Thanks!
Chris

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

Just to add some additional information, I took a look at the watchdog log, and for each transaction there are two entries. The first is something like "Receiving IPN at URL for order 34.", and has an array of the transaction information (including the txn_id, as these payments are going through, just the IPN is throwing up an error).

The second entry says: "IPN transaction failed verification.". This error happens whether it's a credit card or PayPal payment. However, the credit card payment gets recorded, whereas the PayPal payment does not.

I hope that helps narrow down the problem.

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

snelson posted an issue for this today, too:

http://www.ubercart.org/issue/1530/ipn_transaction_failed_verificationed...

I just posted some debug instructions there.

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Yeah, after posting the link up there I added some debug tips to see if we can narrow down the problem.

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

Thanks, Ryan, I just posted the watchdog responses on a test transaction.

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

Hello,

Any word on this particular issue? I'd like to figure out what's really going on here, rather than disabling the validation routine, if at all possible. We're postponing launch until we can figure this out.

Are other folks using WPP without problems at this time?

Thanks!
Chris

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I didn't have a problem w/ this in test mode... was it working for you like that and not production mode, or is it not working in either?

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

Hi Ryan,

The sandbox is working (or was last week), but after going 'live' the ExpressCheckout payments do not validate with IPN. I'm looking into the code right now to see if this watchdog error is a lead to solving the problem:

Receiving IPN at URL for order 0.

This implies that the order ID isn't getting sent, so I'm going to see if hard-coding an Order ID will fix it. If so, then that means that somewhere the $order->order_id being handed off to the 'uc_paypal/ipn/' URL is blank.

I don't know if the Order ID is needed for verificaiton, but just in case, I'm testing it out.

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Perhaps... I noticed some funny business w/ the notify_url setting. Can you confirm that your IPN URL textfield in your live account's settings is totally empty?

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

You mean my live PayPal account, right? I verified that these were emptied earlier today. The IPN URL is empty, and it IPN is not enabled.

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Hmm.. weird that it would still be sending IPN if IPN is not enabled. Or did you just disable it to stop having the problem for now?

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

I mean that I have not enabled IPN in my PayPal profile on the PayPal site. I experimented with setting this value and running transactions, and then I cleared it. IPNs are still being sent to my site.

I went ahead and tried hard-coding an order number by replacing:

'uc_paypal/ipn/'. $order->order_id

with

'uc_paypal/ipn/57', where 57 was the next order number. This didn't seem to have an effect.

I'll keep digging...

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

I think I've found the cause of the problem. I'm not sure if this is a bug, or if maybe I don't understand the code exactly:

In the uc_paypal_ipn() function, where it does the IPN validation, the host is uses is the value of the 'uc_paypal_wps_server' variable. In the WPP administrative area, when you set the site to 'live' rather than 'sandbox', it changes the value of 'uc_paypal_wpp_server', but not 'uc_paypal_wps_server'.

So even though I'm set to live with WPP, when it does the validation it's actually posting to 'https://www.sandbox.paypal.com/cgi-bin/webscr', which is probably why it was coming back as invalid. The IPN comes in fine, and then gets posted to the sandbox which doesn't have a record of the transaction, and comes back invalid.

My question is if this is a bug and the code should check to see if WPP is enabled, and use that server instead of the WPS, or I've just misunderstood how the payment gateways workd and you have to have WPS installed even if you're just using WPP.

Feels good to find something after digging so long!

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

I have posted a fix (albeit probably a bit hack-y) in http://www.ubercart.org/issue/1530/ipn_transaction_failed_verificationed....

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

You rock! I don't remember exactly how I had those configuration forms working, but I knew it was a little spaghetti-ish and was going to review it on my Alpha 8 test site I'm building. Thanks so much for figuring this out... definitely deserving the badge for that. Eye-wink

I'll let you know once it's in on the issue thread.

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

Thanks, Ryan, I'm glad to offer something (however small) back!