3

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

1

This 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

  • Thanks for your help and i will go through it. – Ketan Mar 7 at 9:27
0

I found 2 available patches on https://magento.com/tech-resources/download

  • Composer Based Install - 2.2.x
  • Github Based Install - 2.2.x

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
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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