We need to apply the patch of "Authorize.net Direct Post Signature Key patch" in our Magento 2.1.5 version and current patch available for Magento 2.2.x, so is that possible to work with 2.1.5 without any issues?
Thanks
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityThis patch is applicable on all magento 2.x versions.
Alternatively you can use patched files from following address and replace them in your vendor folder.
https://github.com/MeetanshiInc/Magento-Authorize-Net-Direct-Post-Patch-for-M1-M2
I found 2 available patches on https://magento.com/tech-resources/download
My installation is a Composer install of Magento 2.1.8.
My experience is that the Composer Based Install - 2.2.x patch failed on my installation with conflicts.
patching file vendor/magento/module-authorizenet/Model/Directpost.php
Hunk #1 FAILED at 543.
1 out of 1 hunk FAILED -- saving rejects to file vendor/magento/module-authorizenet/Model/Directpost.php.rej
patching file vendor/magento/module-authorizenet/Model/Directpost/Request.php
patching file vendor/magento/module-authorizenet/Model/Directpost/Response.php
patching file vendor/magento/module-authorizenet/etc/adminhtml/system.xml
patching file vendor/magento/module-authorizenet/etc/config.xml
I encoutred an issue with file vendor/magento/module-authorizenet/Model/Directpost.php as mentionned by @DJNateDaGreat in my 2.1.8 Opens source version,
My solution was to edit the file in order to align it with what patch expects to find like below (removing the newLine in the if condition) :
in vendor/magento/module-authorizenet/Model/Directpost.php
change line 537 :
$response = $this->getResponse();
//md5 check
if (
!$this->getConfigData('trans_md5')
|| !$this->getConfigData('login')
|| !$response->isValidHash($this->getConfigData('trans_md5'), $this->getConfigData('login'))
) {
to :
$response = $this->getResponse();
//md5 check
if (!$this->getConfigData('trans_md5')
|| !$this->getConfigData('login')
|| !$response->isValidHash($this->getConfigData('trans_md5'), $this->getConfigData('login'))
) {
Once i did it the patch was applied with success.
Seems the patch was generated from a 2.2+ branch see : https://github.com/magento/magento2/blob/2.1.8/app/code/Magento/Authorizenet/Model/Directpost.php
https://github.com/magento/magento2/blob/2.2.1/app/code/Magento/Authorizenet/Model/Directpost.php