This is posted over on ubercarts site, but I need some sort of response quickly so I posted here as well.
http://www.ubercart.org/forum/support/14010/rejected_transaction_has_bee...

Situation:

Ubercart 2.x
Authorize.net modified to eprocessingnetwork via emulator as per this site: http://www.eprocessingnetwork.com/Utilities.html

On the ubercart site upon submission I get this error:

"We were unable to process your credit card payment. Please verify your card details and try again. If the problem persists, contact us to complete your order."

Looking at the order report, it still sitting under order status as "in Checkout" and under the admin notes it shows this:

REJECTED: his transaction has been approved
Amount: $0.00
AVS response: VS Match 5 Digit Zip and Address (Y -
CVV match: -

Going into eprocessingnetwork.com I can see that the transaction actually went through without errors.

I also get this in the logs

Array
(
    [0] => 1
    [1] => 1
    [2] => 1
    [3] => This transaction has been approved.
    [4] => AUTH/TKT  773312
    [5] => AVS Match 5 Digit Zip and Address (Y)
    [6] => xxxxxxxxxxxx-xxxxxxx-xxxx
    [7] => 13
    [8] => 1x SS13
    [9] => 0.01
    [10] => CC
    [11] => AUTH_CAPTURE
    [12] => 1
    [13] => Hank
    [14] => Palan
    [15] => 
    [16] => xxxxxx Montgomery Ave.
    [17] => xxxxx
    [18] => CA
    [19] => xxxxx
    [20] => US
    [21] => xxx.xxx.6871
    [22] => 
    [23] => xxxx@gmail.com
    [24] => Hank 
    [25] => Palan
    [26] => 
    [27] => xxxxx Montgomery Ave.
    [28] => xxxxxx
    [29] => CA
    [30] => xxxxxx
    [31] => US
    [32] => 
    [33] => 
    [34] => 
    [35] => 
    [36] => 
    [37] => xxxxxxxxxxxxxxxxxxxxxx
    [38] => M
    [39] => ip_addr="xxx.xx.xxx.10"
    [40] => 
)

The "x"'s represent numbers or words I took out

What is also interesting is that the ip address is coming from the vps and not the domain. Vps ip is xxx.xx.xxx.10 while the ssl cert and dedicated ip for the domain rest at xxx.xx.xxx.11

I have somebody that has a working version of the authorize.net emulation, so I know it works.

I'm stumped and confused. Any help would be appreciated!

Comments

hankpalan.com’s picture

After some careful thought and logic, I came up with some conclusions on my own. Since eprocessingnetwork is catching the transaction but ubercart is saying its declined then the error must be happening in the response back to ubercart from eprocessingnetwork.

Please somebody point out that I'm wrong or at least on the right path.

Using the code out of the uc_authorizenet.module
lines 553-566:

  /**
   * Response key index:
   * 0 = Response Code
   * 2 = Response Reason Code
   * 3 = Response Reason Text
   * 4 = Authorization Code
   * 5 = Address Verification Service (AVS) Response
   * 6 = Transaction ID; needed for CREDIT, PRIOR_AUTH_CAPTURE, and VOID transactions.
   * 9 = Amount
   * 11 = Transaction Type
   * 32 = Tax Amount Charged
   * 37 = Transaction Response MD5 Hash
   * 38 = Card Code (CVV) Response
   */

I compared it with one of the debugging logs that you see above.
The log is saying that [0]=1 which = "This transaction has been approved" as you can see by [3] the response reason text and by referencing this site: http://www.authorize.net/support/merchant/Transaction_Response/Response_...

So the debugging log say's it got approved and even the "Rejected" reason said it got approved in the order admin notes.

Going back go the code in the uc_authorizenet.module
lines 569-575:

  if ($response[0] != '1') {
    // Fail the charge with the reason text in the decline message.
    $result = array(
      'success' => FALSE,
      'message' => t('Credit card payment declined: @message', array('@message' => $response[3])),
      'uid' => $user->uid,
    );

According to the above code my transaction should be showing that its going through according to ubercart, but its not.

Why is ubercart mixing up it's response? And am I on the right track?

hankpalan.com’s picture

Status: Active » Fixed

After three days of beating my head against the wall I finally got ahold of one of my developer friends. He spent an hour or so familiarizing himself with how Drupal and Ubercart work and he solved it.

uc_authorizenet.module

Problem code:

  // Trim off the encapsulating character from the results.
  for ($i = 0; $i < count($response); $i++) {
    $response[$i] = substr($response[$i], 1, strlen($response[$i]) - 2);
  }

Fixed Code:

  // Trim off the encapsulating character from the results.
 /* for ($i = 0; $i < count($response); $i++) {
    $response[$i] = substr($response[$i], 1, strlen($response[$i]) - 2);
  }

This was specifically for eprocessing emulation of authorize.net

It was cutting off the response back so ubercart wasn't thinking it was going through.

If there is a better way to do what was done please let me know as I am not a php guru.
Hopefully somebody else has had this problem and can now fix theirs.

Status: Fixed » Closed (fixed)

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

jberg1’s picture

Version: 6.x-2.0-rc7 » 6.x-2.4

This also works when using it for InternetSecure gateway