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.
|PASSED: [[SimpleTest]]: [MySQL] 2,148 pass(es).|
|FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch uc_authorizenet.module-fix_CIM_error_0.patch. Unable to apply patch. See the log in the details link for more information.|
|FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch uc_authorizenet.module-fix_CIM_error.patch. Unable to apply patch. See the log in the details link for more information.|