Start the Authorize.Net module on Magento 2.4 | Knowledge Base

How to start the Authorize.Net module on Magento 2.4

According to the last update on 31 July 2019, the Authorize.Net payment module version 1.0.1 has been removed from Magento 2.4. The current version of Authorise.Net SDK can not be installed, because it depends on PHP 7.3 version but Magento 2.4 requires PHP 7.4.

Problem

Authorize.Net payment module has been removed from Magento 2.4 and the version 1.0.1 (updated on 31 July, 2019) that is currently published on Magento Marketplace can not be installed the usual way via composer on Magento 2.4.

Why the official module can't be installed: The current version of Authorize.Net SDK depends on PHP 7.3 version but Magento 2.4 requires PHP 7.4.

Luckily, there is a branch on the official Authorize.Net Github account that solves this problem. We hope that Authorize.Net will eventually update their module and the update will be published on Magento Marketplace. Until then, you can use the solution described below.

 

The solution for this problem is as follows:

  • Download the Authorize.Net module bypassing a composer dependencies check;
  • Unzip it into the right folder in Magento;
  • Install Authorize.Net’s SDK that is compatible with the latest PHP versions;
  • Install JWT, a library to work with JSON Web Token and JSON Web Signature;
  • Run setup: upgrade.

 

General Steps:

  1.   Get the latest version of the Authorize.Net module on Magento Marketplace: https://marketplace.magento.com/authorizenet-magento-module-authorizenet.html Before installing perform the steps below first.
  2.   Create an account or log in to github.com and generate a Personal Access Token with the default settings, save it. https://github.com/settings/tokens
  3.   In your Magento server SSH console launch the following commands. Before launching, replace the text in [placeholders] with your data:
MAGENTO_ROOT=[path to you magento root folder without the last “/” symbol, i.e. /var/www/html]
MM_USER=[user] (!) [user] is a PublicKey from https://marketplace.magento.com/customer/accessKeys/
MM_PASSWORD=[password] (!) [password] is a PrivateKey from https://marketplace.magento.com/customer/accessKeys/

 

NOTE: All the values, i.e. [magento root folder], [user], [password] shouldn’t have square braces ([]).

 

  1.   Execute the following commands in the SSH console. Note the commands should be entered the same way as below. 
mkdir ~/anet_setup
cd ~/anet_setup
MM_TOKEN=$(php -r "echo(base64_encode('${MM_USER}:${MM_PASSWORD}'));")

wget --header='User-Agent: Composer/1.10.19 (Linux; 5.0.0-38-generic; PHP 7.0.4)' --header="Authorization: Basic ${MM_TOKEN}" https://repo.magento.com/archives/authorizenet/magento-module-core/authorizenet-magento-module-core-1.0.1.0.zip
wget --header='User-Agent: Composer/1.10.19 (Linux; 5.0.0-38-generic; PHP 7.0.4)' --header="Authorization: Basic ${MM_TOKEN}" https://repo.magento.com/archives/authorizenet/magento-module-centinel/authorizenet-magento-module-centinel-1.0.1.0.zip
wget --header='User-Agent: Composer/1.10.19 (Linux; 5.0.0-38-generic; PHP 7.0.4)' --header="Authorization: Basic ${MM_TOKEN}" https://repo.magento.com/archives/authorizenet/magento-module-creditcard/authorizenet-magento-module-creditcard-1.0.1.0.zip
wget --header='User-Agent: Composer/1.10.19 (Linux; 5.0.0-38-generic; PHP 7.0.4)' --header="Authorization: Basic ${MM_TOKEN}" https://repo.magento.com/archives/authorizenet/magento-module-webhooks/authorizenet-magento-module-webhooks-1.0.2.0.zip
wget --header='User-Agent: Composer/1.10.19 (Linux; 5.0.0-38-generic; PHP 7.0.4)' --header="Authorization: Basic ${MM_TOKEN}" https://repo.magento.com/archives/authorizenet/magento-module-echeck/authorizenet-magento-module-echeck-1.0.1.0.zip
wget --header='User-Agent: Composer/1.10.19 (Linux; 5.0.0-38-generic; PHP 7.0.4)' --header="Authorization: Basic ${MM_TOKEN}" https://repo.magento.com/archives/authorizenet/magento-module-paypalexpress/authorizenet-magento-module-paypalexpress-1.0.1.0.zip
wget --header='User-Agent: Composer/1.10.19 (Linux; 5.0.0-38-generic; PHP 7.0.4)' --header="Authorization: Basic ${MM_TOKEN}" https://repo.magento.com/archives/authorizenet/magento-module-visacheckout/authorizenet-magento-module-visacheckout-1.0.1.0.zip

mkdir -p ${MAGENTO_ROOT}/app/code/AuthorizeNet/Core

mkdir -p ${MAGENTO_ROOT}/app/code/AuthorizeNet/Centinel
mkdir -p ${MAGENTO_ROOT}/app/code/AuthorizeNet/CreditCard
mkdir -p ${MAGENTO_ROOT}/app/code/AuthorizeNet/Webhooks
mkdir -p ${MAGENTO_ROOT}/app/code/AuthorizeNet/ECheck
mkdir -p ${MAGENTO_ROOT}/app/code/AuthorizeNet/PayPalExpress
mkdir -p ${MAGENTO_ROOT}/app/code/AuthorizeNet/VisaCheckout

unzip authorizenet-magento-module-core-1.0.1.0.zip -d ${MAGENTO_ROOT}/app/code/AuthorizeNet/Core/
unzip authorizenet-magento-module-centinel-1.0.1.0.zip -d ${MAGENTO_ROOT}/app/code/AuthorizeNet/Centinel/
unzip authorizenet-magento-module-creditcard-1.0.1.0.zip -d ${MAGENTO_ROOT}/app/code/AuthorizeNet/CreditCard/
unzip authorizenet-magento-module-webhooks-1.0.2.0.zip -d ${MAGENTO_ROOT}/app/code/AuthorizeNet/Webhooks/
unzip authorizenet-magento-module-echeck-1.0.1.0.zip -d ${MAGENTO_ROOT}/app/code/AuthorizeNet/ECheck/
unzip authorizenet-magento-module-paypalexpress-1.0.1.0.zip -d ${MAGENTO_ROOT}/app/code/AuthorizeNet/PayPalExpress/
unzip authorizenet-magento-module-visacheckout-1.0.1.0.zip -d ${MAGENTO_ROOT}/app/code/AuthorizeNet/VisaCheckout/

cd ${MAGENTO_ROOT}
composer require authorizenet/authorizenet:2.0.2 (here the server will ask you to enter the token that you should have created as outlined in p.2)
composer require lcobucci/jwt:"^3.2"
bin/magento setup:upgrade

 

After these steps, the Authorize.Net module should work on your Magento 2.4. 

The solution was tested by our QA team on Magento 2.4.2 and the Authorize.Net module version 1.0.1.

Still Have Questions?

Our customer care team is here for you!

Contact Us