I'm using PayPal Websites Payment Standard and the IPN communication doesn't seem to be working. It's giving the error "An IPN transaction failed verification for this order." in the order Admin Comments section. Any advice?

Comments

melban’s picture

I'm having the same issue. My watchdog table show these two errors when I hit the return the merchant link from paypal (Sandbox). I'm using the "PayPal - pay without sharing your financial information." option when checking out. I'm also having a problem where the invoice is being sent out with a $0.00 total if they are linked. URL is more info. http://www.ubercart.org/forum/support/1004/order_confirmation_email.

type: uc_paypal
message: Receiving IPN at URL for order !order_id.
variables: a:1:{s:9:"!order_id";s:1:"6";}

type: uc_paypal
message: IPN transaction failed verification.
variables: a:0:{}

Cactii1’s picture

I get this as well and can not nail down as to what it would be.

I get the error both in the Sandbox and with the Live transaction.

Cactii1’s picture

We seem to be failing this test to result in a failed transaction...

 if (strcmp ($res, 'VERIFIED') == 0) {

It's line 611 of the uc.payment.module

Failing this test would send us to here...

elseif (strcmp($res, 'INVALID') == 0) {
      watchdog('uc_paypal', 'IPN transaction failed verification.', array(), WATCHDOG_ERROR);
      uc_order_comment_save($order_id, 0, t('An IPN transaction failed verification for this order.'), 'admin');
    }

Starting at line 677 of the uc.payment.module

Cactii1’s picture

ok... found the fix for this

change this

  foreach ($_POST as $key => $value) {
    $value = drupal_urlencode(stripslashes($value));
    $req .= '&'. $key .'='. $value;
  }

to this

  foreach ($_POST as $key => $value) {
    $value = urlencode(stripslashes($value));
    $req .= '&'. $key .'='. $value;
  }

and it works.

rszrama’s picture

Status: Active » Fixed

Committed.

Cactii1’s picture

Oh man! My first commit... on a project like Ubercart too! What an honor. :D

rszrama’s picture

: D

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.