We are having a couple orders fail because of not being able to create the customer profile, auth.net is responding with:
Error from Authorize.net: E00003: The element 'billTo' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'state' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'phoneNumber, faxNumber, email' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
For an address in Grenada, there are no zip codes:
The element 'billTo' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'zip' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
Comments
Comment #2
chrisrockwell commented#2914764: Received response with code Error from Authorize.net: E00003: invalid child element 'email' in namespace
Comment #3
chrisrockwell commentedAs a result of these errors we can't accept any non-us billing address
Comment #4
chrisrockwell commentedUploading quick fix in case anyone comes across this one. I'm guessing we shouldn't sent the
stateelement if there isn't one.Comment #5
chrisrockwell commentedComment #6
chrisrockwell commentedThis is fixed in #2813401: Use Accept.js to ease PCI requirements. by removing the state element but this should probably stay open until that's committed.
Comment #7
chrisrockwell commentedOn second/third/(fourth?) thought I'm not sure the Accept.js way is appropriate. IIRC (and I don't have access to the fraud prevention screens) the account holder can specify levels of fraud protection - if an account holder requires full address verification, not sending the state, in cases where a state should be sent, would cause failures.
Comment #8
chrisrockwell commentedComment #9
chrisrockwell commentedBased on what I'm reading here: https://support.authorize.net/authkb/index?page=content&id=A649 state is never required, so my comment re: accept.js isn't valid.
I'm attaching a patch that makes both state and zip optional. It would be up to store owners to configure their AVS settings (within Authorize.net) to allow for profiles without zip codes to pass.
Comment #10
bojanz commentedThis approach makes sense. Remember though that $billTo should be snake_case ($bill_to) to match coding standards.
That can be fixed on commit though.
Comment #11
chrisrockwell commentedUpdated based on feedback.
Comment #12
subhojit777Rerolled.
Comment #13
subhojit777This is the correct one.
Comment #14
mglamanThanks, everyone!