An IPN transaction failed verificationed for this order.

Project: 
Ubercart
Category: 
bug report
Priority: 
normal
Status: 
fixed

Using Paypal WPP only ...

On every transaction, I get this message in the order history. I poked through the paypal code a little, and nothing really jumped out as to the cause of this. I haven't really tried running any test transactions though and checkout out the IPN return. Is IPN even needed for WPP? Anybody have this problem?

Thanks,
Scott

Oh, and the typo 'verificationed'.

Re: An IPN transaction failed verificationed for this order.

Fixed the typo... I'm not sure why it would be failing verification of the IPN transaction. It may be trying to POST to the wrong URL...

Add in these debug lines.

After line 552:

<?php
  $host
= explode('/', substr($host, 8)); // Line 552.
 
watchdog('uc_paypal', 'Host: '. $host);
 
watchdog('uc_paypal', 'Request: '. $req);
?>

After the new line 571:

<?php
  $res
= fgets($fp, 1024); // New line 571.
 
watchdog('uc_paypal', 'Response: '. $res);
?>

Tell me if I've got that code wrong. Eye-wink

Post up the results and I'll see what I can figure out.

Re: Re: An IPN transaction failed verificationed for this order.

Here's the result for one:

fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/.toucht/santaletters/santaclauschristmasletter.com/sites/all/modules/ubercart/payment/uc_paypal/uc_paypal.module on line 555.

And another:

IPN failed with HTTP error.

Sorry, I added the entire code, instead of the code following the leader code. Eye-wink

Here are my new responses:

Response: INVALID
Response:
Response: Content-Type: text/html; charset=UTF-8
Response: Connection: close
Response: Set-Cookie: Apache=208.113.189.10.260831193427501791; path=/; expires=Sun, 18-Oct-37 19:38:21 GMT
Response: Set-Cookie: navcmd=_notify-validate; path=/; domain=.paypal.com
Response: Set-Cookie: cookie_check=yes; expires=Mon, 23-Oct-2017 19:38:22 GMT; path=/; domain=.paypal.com
Response: Server: Apache/1.3.27 (Unix) mod_ssl/2.8.12 OpenSSL/0.9.7a mod_fastcgi/2.4.2 PHP/4.3.2
Response: Date: Fri, 26 Oct 2007 19:38:21 GMT
Response: HTTP/1.1 200 OK
Host: Array

Receiving IPN at URL for order 0.

Array
(
[mc_gross] => 0.01
[invoice] => 37-1193427496
[address_status] => confirmed
[payer_id] => E2TZYYJTTTTTT
[tax] => 0.00
[address_street] => 312 E. 2nd st.
[payment_date] => 12:38:17 Oct 26, 2007 PDT
[payment_status] => Completed
[charset] => windows-1252
[address_zip] => 83617
[first_name] => Chris
[mc_fee] => 0.01
[address_country_code] => US
[address_name] => Implied By Design LLC.
[notify_version] => 2.4
[custom] =>
[payer_status] => verified
[address_country] => United States
[address_city] => Emmett
[quantity] => 1
[verify_sign] => AQ2O9tQDfEzapUNYZtY51Z.d0-SFAjfJcnD0-pO4RcjILb0a5YH5g4GV
[payer_email] => sender@something.com
[txn_id] => 5U478972S49615709
[payment_type] => instant
[payer_business_name] => Name
[last_name] => Shattuck
[address_state] => ID
[receiver_email] => reciever@something.com
[payment_fee] => 0.01
[receiver_id] => MYQKN5CCUEM66
[txn_type] => express_checkout
[item_name] => 1x Letter
[mc_currency] => USD
[item_number] =>
[residence_country] => US
[payment_gross] => 0.01
[shipping] => 0.00
)

Re: Re: Re: An IPN transaction failed verificationed for this or

Ok, so at least we're getting a response... I'm not sure why it's not validating, unfortunately. Basically, PayPal checks the values you post to it against the values it sent you and should validate based on that.

It may be that the IPN code I modified simply has the POST construction wrong. Lyle pointed out drupal_http_request(), so I imagine this code should be rewritten to use that.

EDIT: You could try changing fputs ($fp, $header . $req); to fputs ($fp, $header . $req . "\r\n"); to see if that does anything..

EDIT: You could try


EDIT: You could try changing fputs ($fp, $header . $req); to fputs ($fp, $header . $req . "\r\n"); to see if that does anything..

I gave this a shot, but no dice.

So, can you tell me what Ubercart is sending out to get verified? I mean, is there some other credentials that are being checked besides the WPP API settings? Those are obviously working, so it must be some other credential, right?

Sandbox works

I switched back to my sandbox account, just to check, and it worked. So, is there a difference between how Ubercart or PayPal handles a sandbox vs live transaction?

Re: EDIT: You could try

Nah, it's just exactly what the IPN sends you. Basically, it prevents spoofing. They send you a notification and you send it to PayPal and they'll say, "Yeah, we sent that." If you need a quick fix until we can get validating working, you can just comment out the sections pertaining to validation (but that's not really the best). What's curious is why this would stop working between sandbox and production servers. If this doesn't work for anyone, we can always try adding in support for the shared secret validation they offer.

Re: Re: EDIT: You could try

I'm updating the site to the latest version of Ubercart to see if that fixes anything, since it looks like there are a few lines that are different between my current version and the latest. I'll post after the update.

Re: Re: Re: EDIT: You could try

I have updated the site to the latest release, and am still having the same problem.

Re: Re: Re: Re: EDIT: You could try

If your problem is the same as mine, it is a result of having WPP installed without WPS. When you set your admin settings for WPP to live, it does not update the WPS server to live, which is what UC uses to validate the IPN. It comes back invalid because the validation is still being sent to the sandbox.

There are a number of ways to fix this, but the code below will check to see if the WPP gateway is set to live, and if so, use the live PayPal server to check the IPN.

You need to change the uc_paypal_ipn() function in payment/uc_paypal/uc_paypal.module.

Just above the following line (note that I added a space after the '8' because it would be converted to a smiley otherwise):

  $host = explode('/', substr($host, 8 ));

Replace this code:

  $host = variable_get('uc_paypal_wps_server', 'https://www.sandbox.paypal.com/cgi-bin/webscr');

With this code:


  if (variable_get('uc_paypal_wpp_server','') == 'https://api-3t.paypal.com/nvp') {
    $host = 'https://www.paypal.com/cgi-bin/webscr';
  } else {
    $host = variable_get('uc_paypal_wps_server', 'https://www.paypal.com/cgi-bin/webscr');
  }

Re: Re: Re: Re: Re: EDIT: You could try

Alrighty, implemented the fix w/ a minor change to default the wps_server variable to the sandbox if it hasn't been set yet. Other than that, this seems like it should solve things. And I should point out somewhere that folks shouldn't be using both Website Payments Standard and Website Payments Pro.