Using the uc_recurring module, we found that a recent batch of renewal transactions failed with the following error:

Error processing order 96666: Error: The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:customerShippingAddressId' element is invalid - The value '' is invalid according to its datatype 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:numericString' - The Pattern constraint failed.

As it turns out, Authorize.net won't accept an empty string for this element. When empty, zero must be passed. This patch addresses this by checking for an empty string and supplying 0 (zero) when the string is empty.

Also included in this patch, but not required, is an additional order admin comment for logging the Authorize.net error to the order itself. This is helpful with recurring transactions, since uc_recurring is abstracted and doesn't seem to have access to the API response and can't log it itself.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, uc_authorizenet.module-fix_CIM_error.patch, failed testing.

r.aubin’s picture

Status: Needs work » Needs review
FileSize
925 bytes

Adding new patch with path to module file....first one failed. Boo.

Status: Needs review » Needs work

The last submitted patch, uc_authorizenet.module-fix_CIM_error.patch, failed testing.

DanZ’s picture

Version: 6.x-2.11 » 6.x-2.x-dev
Priority: Major » Normal
Status: Needs work » Needs review

Patches need to be applied to the current -dev module.

This doesn't affect most users, so it's a "normal" instead of a "major" (although it is certainly important for those people!).

DanZ’s picture

Status: Needs review » Needs work

The last submitted patch, uc_authorizenet.module-fix_CIM_error.patch, failed testing.

r.aubin’s picture

Great, thanks DanZ. Tried to find a good template for getting my patch to pass testing, but was unable. Rolling it from my own dev environment using SVN. If there's something I need to do to make the patch file compatible with the test suite, let me know and I can update it.

DanZ’s picture

Hmm. You don't use SVN any more. Use GIT instead.

You should be making patches from the current -dev repository, too.

Complete directions are at https://drupal.org/node/129292/git-instructions/6.x-2.x.

Also, just FYI, Drupal 6 will be unsupported later this year when Drupal 8 is released. This might be good time to consider upgrading to Drupal 7 / Ubercart 3, since you'll have to do it later, anyway.

DanZ’s picture

Status: Needs work » Needs review
FileSize
1.16 KB

Let's see what the testbot thinks of this (completely untested) version of your patch. (I don't run D6, so I just went through the motions at https://drupal.org/node/129292/git-instructions/6.x-2.x, because you only modified two lines.)

longwave’s picture

This is basically a followup to #1578482: customerShippingAddressId needs to be added to uc_authorizenet CIM payments, I wonder why rickmanelius did not suffer from this issue. I don't use uc_recurring or Authorize.Net so I have no idea whether this is the correct thing to do or not.

I do however agree with adding comments for failed charges, as we already do the same for successful ones.

longwave’s picture

Also, as you are using uc_recurring and Authorize.Net, are you able to shed any light on #1777024: Invalid ARB payment notification received.? I guess you're not seeing the same issue?

r.aubin’s picture

I'm not sure on http://drupal.org/node/1777024. We're not using ARB, but from what experience we have had with Auth.net's API, it does require a particular order to the elements passed.

Looks like #1578482 was using d7. Might be why rickmanelius didn't encounter the error?

longwave’s picture

Status: Needs review » Fixed

I committed the fix for customerShippingAddressId to 6.x only, as I am not sure whether the same applies to 7.x.

I also rearranged the uc_order_comment_save() code slightly to avoid duplication, and committed that to both branches.

Status: Fixed » Closed (fixed)

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