I have two payment options set up in Magento

PayPal, and Authorize.net. PayPal works fine. Authorize.net is throwing an error and I can't for the life of my figure it out. I been searching for DAYS.


After selecting Authorize.net and putting in the required information, I'm redirected to the next step of the OnePage checkout process ("ORDER REVIEW").

Upon clicking "Place Order" I get the following error message in a dialog box at the top of my browser:

"There was an error processing your order. Please contact us or try again."

What I do know:

  • Authorize.net is configured properly in the backend. API and Transaction Keys are all 100% correct. I've checked this 100 times over.

  • This problem is not being caused by something on Authorize.net's end. This is a Magento issue.

  • As far as I've tested, I've never been able to get passed this error. Having a registered account, checking out as a guest, etc. seems to have no affect.


I completely cleared the exception.log for a fresh file, and went through my checkout process again in an effort to debug the problem.

This is the first time I've ever tried debugging an issue through log files, so help here would be appreciated.


If anybody can provide any help with this, I would GREATLY appreciate it. You'll save me from gauging my eyes out too. I've been searching around for days on how to fix this problem and can't find anything that works. It's really important that I have this up and functional within the next day or so.

4 Answers 4


As you said, this is not an Authorize.net-specific issue. I believe your error is occurring from Mage_Checkout_OnepageController::saveOrderAction(), where a generic Exception is thrown. You can inspect the method for the error message.

This could be due to many things, so it will require you to debug it. Check at each step within this method what kind of values are being passed around. My guess is for a common cause is that, if all of your settings are correct, you have customization that checks the payment data and throwing an exception.

You can take a look at from Mage_Sales_Model_Quote_Payment::importData(), or whatever class is overriding this class and method, if any, for example, to debug the issue.


Upon examining your exception log, you'll see an entry of saveOrderAction() as I mentioned, and now I'm certain that's what's causing your order error. There's also a constraint violation error in there, but I'm going to assume you just copied and pasted your logs. On line 213 in the link, it says

2014-11-12T03:24:44+00:00 ERR (3): exception 'Mage_Core_Exception' with message 'Gateway error: (TESTMODE) The merchant login ID or password is invalid or the account is inactive.' in /home2/david/public_html/store/app/Mage.php:595

There you go; your Authorize.net credential is the problem. Two things I would check first.

  1. Check that "test mode" is off if you're on a sandbox Authorize.net account.

  2. Use https://test.authorize.net/gateway/transact.dll instead of whatever Magento proides if you're using a sandbox account.

More info: https://support.authorize.net/authkb/index?page=content&id=A415&pmv=print&impressions=false


Others have mentioned different errors as well. You should look into those. They will make great debugging practice!

  • There shouldn't be any customization in files like that, however, I had a freelancer theme the website. So who knows what they've done. As for the two files you mentioned above, they haven't been touched. Time to start learning how to debug. I've never done it before.
    – David M
    Nov 20, 2014 at 1:55
  • If you have a test environment (or the site isn't live) try disabling all non-native extensions and switch your theme back to the base (or in the case of 1.9 rwd) theme by going to System -> Configuration -> Design. See if the problem persists. If this fixes it, then, re-enable each extension one-by-one. Nov 20, 2014 at 3:24
  • I'm updating my answer to your posted logs.
    – laketuna
    Nov 20, 2014 at 15:04

The problem you're having is because Magento is trying to insert transactions into either the "sales_flat_quote_payment" or "sales_flat_order_payment" table. This is why you're seeing the error: Integrity constraint violation: 1062 Duplicate entry '121' for key 'PRIMARY''

If you open those tables in MySQL, find any records with ID 121 or higher and delete them. You should then be able to process the payments.

I'm 100% sure this is the problem, so it's just a matter of finding the right table and deleting the records.

I'm assuming the sites not in production. If it is, then you may not be able to delete these records. Then there's another solution...

  • Yes, my website is in production and has been for a while. We decided to adopt Authorize.net for the holidays, and free ourselves from the tight grasp of PayPal. I'll look into deleting these records. Thank you so much for the lead!
    – David M
    Nov 20, 2014 at 18:25
  • I don't see how you came to conclude the payment quote or payment table is having issues. If anything, those constraint errors are coming from log_... as Marius has pointed out. Did you get anywhere @DavidM?
    – laketuna
    Nov 21, 2014 at 15:43

by the looks of the error message, it seams there is a problem while inserting values in the visitors log tables.
You should truncate all the tables that start with log_ except log_summary_type


in my case, the log file exception.log said "Illegal scheme supplied, only alphanumeric characters are permitted"

was a blank space in the gateway url

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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