8 replies [Last post]
mk31762's picture
Offline
Joined: 05/28/2009
Juice: 44
Was this information Helpful?

This is my first outing with Drupal and Ubercart. I am very close to completing a site but I am having a problem with Authorize.net. Every attempt to process a transaction ends with the generic "We were unable to process your credit card payment" error message. My watchdog table only shows a uc_payment error that says the credit card number is invalid. There are no uc_authorizenet errors.

My API Login and Tansaction Key are correct and have been verified with Authorize.net several times. A small transaction was run through the Authorize.net website and it worked fine. According to support at Authorize.net, they aren't even seeing my test transactions hit the gateway.

All of this leads me to believe that the CC validator is not working properly; that the payment module is never even connecting to Authorize.net. To check this, I disabled card number validation but I am still getting the same error.

I am configured to run in Live mode and have CVV turned on.

I would be eternally grateful for a little help with this.

Thanks!

MK

mk31762's picture
Offline
Joined: 05/28/2009
Juice: 44
New info

Despite Authorize.net's claim that my transactions are not reaching the gateway, I am actually receiving a response code back from them - unless the uc_authorizenet module is making up response codes somewhere I haven't discovered yet.

I tweaked the watchdog logger a little to capture the reason code - I'm not sure why it doesn't do that already. the code I am getting back is 6 - which is credit card number is invalid. Nothing new, except that it proves that the communication link is working. It's beginning to seem like my card numbers are getting mangled somehow. I'll be on the phone with Authorize.net later today to see if they can shed some light on this.

Thanks

PatW's picture
Offline
Joined: 03/31/2009
Juice: 138
Generate new transaction key?

I was having a similar problem. Authorize.net suggested I generate a new transaction key. I don't understand why, but that did the trick and my transactions are now being approved again as before. Smiling.

mk31762's picture
Offline
Joined: 05/28/2009
Juice: 44
Didn't work for me

The site owner generated a new key and I'm still getting the exact same error.

mk31762's picture
Offline
Joined: 05/28/2009
Juice: 44
Re: Didn't work for me

I don't know if I didn't setup something properly, or what, but after a very long call with Authorize.net we determined that only the last 4 digits of the card number were being posted. After combing through the code in the order, credit, payment and authorizenet modules I saw that, per PCI compliance requirements, only the last 4 digits of the card number were being saved. However, it is from this saved data that the card number is being extracted and sent to Authorize.net.

In uc_credit.module, in the uc_credit_order function, under the 'save' condition I changed the following line:

'cc_number' => substr($arg1->payment_details['cc_number'], -4),

to

'cc_number' => $arg1->payment_details['cc_number'],

Finally, my test transaction went through. At least it looks like it did.

Something's not right here. If I fat-fingered something because I don't know what I'm doing, that's fine, but it sure would be nice if one of the guys who knows something about this could respond.

MK

steve123's picture
Offline
Joined: 09/18/2008
Juice: 92
How are u processing the card?

Are you using the card details for offline processing because this problem will be encountered only if the card details are stored for offline card processing.

venture into the unknown!

mk31762's picture
Offline
Joined: 05/28/2009
Juice: 44
Re: How are u processing the card?

We don't need to. How do I turn that feature off? I'm probably missing it, but I don't see a configuration option for that anywhere.

steve123's picture
Offline
Joined: 09/18/2008
Juice: 92
Re: Re: How are u processing the card?

store administartion>>Configuration>>payment settings >>payment methods tab

unders credit card setting
Attempt to process credit card payments at checkout. check this check box
try this, this might help

venture into the unknown!

mk31762's picture
Offline
Joined: 05/28/2009
Juice: 44
Re: Re: Re: How are u processing the card?

Ok, I finally figured it out. It was me.

It took me a hell of a long time to track this down and the chain of events leading to this error are pretty complicated.

In short, I inserted a couple of image buttons onto the review checkout page by altering the form in such a way that it interfered with the uc_credit module's alteration of the same form. Specifically, I did a global unset on $form['back'] and $form['submit'] and then only verified that I wasn't interfering with the original form in uc_cart. What happened is that a small section of code in uc_credit.module wasn't being executed which stores the card data in session. Subsequently, the empty session variable was written to the cache. The hook_order implementation in uc_credit.module tries to read the card data from the cache and, if the cache is empty, as it was in my case, it assumes that cards are being processed offline and it uses the truncated data stored in the database instead.

Whew! Talk about knowing just enough to be dangerous!

Thanks for the help.