Character limits for fields in API calls are not enforced

Created on 19 September 2019, over 5 years ago
Updated 8 May 2024, 8 months ago

Revised

All text fields when posting to authorize.net's API have maximum length values and transactions will fail if these strings are not truncated.
Many of the text fields in commerce support a longer value than authorize.net's API supports. Maxlength needs to be enforced so transactions are accepted or customers will abandon carts.

Original Issue:

I had an order fail with this error. The Authorize.net API says the company name max length is 50. So we need to do the same thing we did to address and only send the max allowed. While it's unlikely that the first or last name would be that long but I've set them as well in the patch as they have the same max 50 limit.

Received response with code Error from Authorize.net: E00003: The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:company' element is invalid - The value XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX is invalid according to its datatype 'String' - The actual length is greater than the MaxLength value.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇺🇸United States jphelan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024