Using Magento 2.2.4 - I have the Auth.net Direct Post payment method enabled, the Magento Auth.net patch applied, and with the configuration:

Gateway URL:


Transaction Details Url:


I'm seeing the transactions in the Auth.net sandbox payment.log:

(TESTMODE) This transaction has been approved

but an error is being thrown on the Magento side:

Please enter a transaction ID to authorize this payment

I've tried with Test Mode both enabled and disabled. How can I get this working properly?

1 Answer 1


Normally - Authorize.NET does not return a transaction ID in the test mode

Please update with below file :app/code/Magento/Authorizenet/Model/Directpost.php

if (!$this->getResponse()->getXTransId()) { // approx line number 664

replace with

if (!$this->getResponse()->getXTestRequest() && !$this->getResponse()->getXTransId()) {

I hope its work for you.

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.