Magento 2 - Auth.net Sandbox not working
-
05-03-2021 - |
Question
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:
https://test.authorize.net/gateway/transact.dll
Transaction Details Url:
https://apitest.authorize.net/xml/v1/request.api
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?
No correct solution
OTHER TIPS
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.