We’ve set up quite a few sites that use authorize.net recently, and I thought I’d share some of the lessons we’ve learned to save you some time and headaches.

There are 4 different states you can be in while using Authorize.net: (1) live server, (2) live server in test mode, (3) sandbox server, and (4) sandbox server in test mode. Any API keys you generate while in one of these states will only work in that state. So if you generate a transaction key in test mode and then switch back to live mode, you will need to generate a new one and update your code base accordingly.

Sandbox in Test Mode: As far as I can tell, you will never need to use this.

Sandbox Server: When you sign up for a test/sandbox account, you can checkout with a few different card numbers that they will send you. This test account is completely separate from your live account.

Live Server in Test Mode: You can put your account in test mode in order to make some purchases on your site. I know that the Visa test number 4111 1111 1111 1111 works in test mode, but I’m unsure if there are other test numbers that work. As far as I can tell though, transactions put through in test mode won’t show up when you are using the Transaction Details API.

Live Server: Transactions here will be put in the “unsettled” transactions for up to a day before clearing. In order to test code using the transaction details API, we often put through a real transaction on the live server, and then void it after we test.

Common Errors

There are several cryptic error codes we have come across; here are a couple that we eventually were able to fix.

 The merchant API Login ID is invalid or the account is inactive.

This is what happened for us when we generated an API transaction key when in test mode, and tried to use it in live mode. The solution was to just regenerate the transaction key.

 The Nova Bank Number or Terminal ID is incorrect. Call Merchant Service Provider.

If the Merchant Service Provider isn’t set up within Authorize.net, you will get this error. The good thing is that this has nothing to do with your code or API setup.

 

If you’ve got any other tips and tricks for working with Authorize.net, please post them in the comments below.