I am preparing to launch a recurring order product on my site and every time my test order fires, it status remains as pending, and the order is never sent to authorize.net. Additionally, I see the error "Error: Recurring fee 2 for product failed." in the log for the order which originally created the recurring order.

I don't think this is an issue with authorize.net rejecting the orders as they confirmed that nothing is being sent to them for processing.

Why would my orders never get out of the pending state? Could there be a problem in conditional actions? I'm not sure what I should see there to know what is wrong.

CommentFileSizeAuthor
#13 uc_authorizenet.module.patch442 bytesflamingvan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

univate’s picture

If you are using Auth.net CIM and have configured this in ubercart then this shouldn't happen.

As noted on the project page we still don't have full Auth.net ARB support due to recurring code in the core uc_authorizenet module and we need people like yourself who are using this gateway to push the ubercart guys to commit the patch I have supplied to fix this issue: #580938: Create Authorize.net ARB recurring fee handler

The ubercart issue: #592420: Move UC Recurring Fees code out of Authorize.Net module

I have no interest in this gateway myself so its not something I am willing to spend much time on, I have done the work, someone else need to take this issue up with the ubercart guys and convince them to commit it.

walden’s picture

I am using CIM to process my recurring fees. I have checked the "production" mode and "Always create a CIM profile for securely storing CC info for later use." in the CIM section of admin/store/settings/payment/edit/gateways

Do the issues you linked to above still apply to me if I'm not using ARB?

RSTaylor’s picture

Note: This may or may not be related, but that can occur if the total is $0.00. In that case, it may actually be sending to Authorize.net, but Authorize.net rejects it as an API schema error (as if the XML were invalid). There is no admin comment or log comment to explain what happened, and I think that there would be no record of it on the Authorize.net side either (not in the merchant interface, anyway).

Related: http://drupal.org/node/691884 and http://drupal.org/node/691926

flamingvan’s picture

I looked into this and it turns out that a missing phone number in the authorize.net payment profile is the problem. Once that is filled in the payment goes through. But why would the phone be required for the recurring payment but not the initial one? Weird...

flamingvan’s picture

Here's the fix. You've got to add the phone field to the CIM account creation. The file is modules\ubercart\payment\uc_authorizenet\uc_authorizenet.module around line 1106.
Make sure the fields go in this order:

function _uc_authorize_cim_xml_billto($order) {
  $billing_country = uc_get_country_data(array('country_id' => $order->billing_country));
  return array(
    'firstName' => substr($order->billing_first_name, 0, 50),
    'lastName' => substr($order->billing_last_name, 0, 50),
    'company' => substr($order->billing_company, 0, 50),
    'address' => substr($order->billing_street1, 0, 60),
    'city' => substr($order->billing_city, 0, 40),
    'state' => substr(uc_get_zone_code($order->billing_zone), 0, 2),
    'zip' => substr($order->billing_postal_code, 0, 20),
    'country' => !$billing_country ? '' : $billing_country[0]['country_iso_code_2'],
    'phoneNumber' => substr($order->billing_phone, 0, 25)	
  );
}
univate’s picture

Project: UC Recurring Payments and Subscriptions » Ubercart
Component: Miscellaneous » Code

If this is the issue then this is a problem that needs to be fixed in the uc_authorizenet module in ubercart.

univate’s picture

Title: Recurring Orders are Stuck in "Pending" State » uc_authorizenet should include phone field
TR’s picture

@flamingvan: Is this documented in the Authorize.net protocol? Can you roll a patch for this fix? Also, if the phone number *must* be sent for the transaction to succeed, then you should add a hook_form_alter() to uc_authorizenet in order to make the phone number field mandatory on the checkout page.

flamingvan’s picture

Sorry for my slow reply. Would you still like me to roll a patch for this?

TR’s picture

Yes please.

TR’s picture

Status: Active » Postponed (maintainer needs more info)
TR’s picture

Component: Code » Payment
flamingvan’s picture

FileSize
442 bytes

Here's a patch. Sorry this took so long for me to do. I have no way of testing it. I don't have an authorize.net account. I was using my client's account and their site is in production so I can't mess with it. Can anyone test this?

I didn't make the phone number field mandatory. I don't think it needs to be filled out for this to work.

longwave’s picture

Category: support » feature
Status: Postponed (maintainer needs more info) » Needs review
longwave’s picture

Status: Needs review » Fixed

Committed to both branches.

TR’s picture

As I said in #8, if phone field is required by Authorize.net in order for transactions to succeed, then this payment gateway should alter the checkout form to ensure that data is collected.

If the phone field is *not* required by Authorize.net, then I don't see how this patch fixes the original issue.

No one who has experienced the problem has tested the patch, so it's not clear to me that it fixes anything.

longwave’s picture

At least we are sending the phone number now if one was supplied, which is an improvement from before. If this is still an issue the community can reopen it and describe any remaining problems.

Status: Fixed » Closed (fixed)

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