Magento's core code does not pass address line 2 to Authorize.net. This is a problem when Authorize.net is set to send email receipts, which get sent to the customer missing their shipping address apartment number, etc. (The Magento order confirmation email is fine.)

To replicate the problem:

1) Authorize.net is set to email a receipt.
Meaning, you log in to your authorize.net account > Settings > Email Receipt > Check the box for "Email transaction receipt to customer (if email address is provided)"

2) Customer places an order with address line 1 and 2, then pays via Authorize.net. FirstName LastName Address Line 1 Address Line 2 (apt 203) City, State ZIP

3) OH NO, the customer receives an email receipt from Authorize.net showing only address line 1; it does not show address line 2. This causes some customers to panic thinking their package will not be delivered correctly.

Update: I'll post an answer tomorrow. Not permitted to answer my own question for 8 hours...

1 Answer 1


Proposed solution (disclaimer: for future versions of Magento, and modifying core directly can be overwritten with updates):

In app/code/core/Mage/Authorizenet/Model/Directpost/Request.php

line 140 was:


should be:

->setXAddress(strval($billing->getStreet(1)).' '.strval($billing->getStreet(2)))

line 160 was:


should be:

->setXShipToAddress(strval($shipping->getStreet(1)).' '.strval($shipping->getStreet(2)))

Thoughts? Any potential AVS (address verification service) problems?

Update: Ideally, also convince Authorize.net to separate Address into Address Line 1 and Address Line 2, to prevent any possible problems with Address Verification Service (AVS) type Z (street address: no match, zip: match, extended zip: no match) and W (street address: no match, zip: match, extended zip: match) rejections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.