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

chrisrockwell created an issue. See original summary.

chrisrockwell’s picture

Priority: Normal » Critical
Status: Closed (duplicate) » Active

As a result of these errors we can't accept any non-us billing address

chrisrockwell’s picture

Uploading quick fix in case anyone comes across this one. I'm guessing we shouldn't sent the state element if there isn't one.

chrisrockwell’s picture

Title: Unable to create customer profile » The 'state' element should not be included when creating a BillTo object if the address does not include a state.
chrisrockwell’s picture

This 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.

chrisrockwell’s picture

On 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.

chrisrockwell’s picture

Title: The 'state' element should not be included when creating a BillTo object if the address does not include a state. » Created billTo object should not include fields that aren't available/necessary for customers location
Assigned: chrisrockwell » Unassigned
Issue summary: View changes
chrisrockwell’s picture

Status: Active » Needs review
StatusFileSize
new1.72 KB

Based 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.

bojanz’s picture

This approach makes sense. Remember though that $billTo should be snake_case ($bill_to) to match coding standards.

That can be fixed on commit though.

chrisrockwell’s picture

Updated based on feedback.

subhojit777’s picture

subhojit777’s picture

This is the correct one.

mglaman’s picture

Status: Needs review » Fixed

Thanks, everyone!

  • mglaman committed fdfb808 on 8.x-1.x authored by subhojit777
    Issue #2918431 by chrisrockwell, subhojit777: Created billTo object...

Status: Fixed » Closed (fixed)

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