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.
Comment | File | Size | Author |
---|---|---|---|
#9 | ubercart_authorizenet.module-fix_CIM_error-1933424-9.patch | 1.16 KB | DanZ |
#2 | uc_authorizenet.module-fix_CIM_error.patch | 925 bytes | r.aubin |
uc_authorizenet.module-fix_CIM_error.patch | 859 bytes | r.aubin | |
Comments
Comment #2
r.aubin CreditAttribution: r.aubin commentedAdding new patch with path to module file....first one failed. Boo.
Comment #4
DanZ CreditAttribution: DanZ commentedPatches 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!).
Comment #5
DanZ CreditAttribution: DanZ commented#2: uc_authorizenet.module-fix_CIM_error.patch queued for re-testing.
Comment #7
r.aubin CreditAttribution: r.aubin commentedGreat, 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.
Comment #8
DanZ CreditAttribution: DanZ commentedHmm. 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.
Comment #9
DanZ CreditAttribution: DanZ commentedLet'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.)
Comment #10
longwaveThis 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.
Comment #11
longwaveAlso, 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?
Comment #12
r.aubin CreditAttribution: r.aubin commentedI'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?
Comment #13
longwaveI 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.