I’d been wracking my brain trying to figure out how to get FedEx shipping to work. Even after entering in all of the information correctly, I was still getting the following error:
This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.
Originally I thought it was because the account number I had copy and pasted from the client still had the dashes in it: XXXX-XXXX-X, so I removed the dashes, cleared the cache, and still the same problem.
Finally, I found a post detailing how to enable logging for the fedex output (http://www.magentocommerce.com/boards/viewthread/6996/#t29967), and I discovered that it was still being added to the XML file with the dashes, and FedEx was wanting a 9 digit account number.
Something was still adding in the dashes to the account number.
I opened up /app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php and on line 162 (in version 1.1.6 anyways) was the following code:
I couldn’t find out where that getAccount function was defined, but changing that line to the following striped out teh dashes and allowed Fedex to work:
$requestHeader->addChild('AccountNumber', preg_replace("/[^0-9]+/", "", $r->getAccount()));
This probably won’t fix all the issues people are having, but hopefully it can steer some of you in the right direction.
And if anyone knows anything about that getAccount code why it would be adding in the dashes, any information would be helpful.