I need to update this patch on magento 2.1.7 - I am confused with file structure. CE-2.0.0 to CE-2.3.0/vendor/magento/module-authorizenet/

where should I upload these files and what is my CLI command i would need to execute this? any help would be appreciated


Now Apply Patch directly in vendor folder
This patch is applicable on all Magento 2.x and 1.x versions.

Alternatively you can use patched files from following address and replace them in your vendor folder.


If Need Run php bin/magento setup:upgrade; php bin/magento setup:static-content:deploy -f;

After apply patch you will see Signature Key enter image description here

  • if I upload the files from this module to Vendor directly, it prompts me to overwrite some files, I select yes, when I do that its breaks up my site. – roger Mar 19 at 21:15
  • You need to be in developer mode, and then you need to run the SSH upgrade, static content deploy, and clear cache commands, after you replace those files. . . – styzzz Mar 21 at 13:23
  • This package have files with Magento version wise. please check you Magento version and files version – Jugal Kishor Mar 22 at 10:51

Honestly, the patch is poorly written. It was based on a magento 2.2 and up and for php 7.0 and higher. In my case, had lower php and magento 2.1.1, applied the patch per instruction and broke my site and had a bunch of Parse error in the code.

so I did the following and and now it is working (more tests needed...beware this was a dirty work-around):

Files to modify in location: vendor/magento/module-authorizenet/Model/Directpost/Request.php vendor/magento/module-authorizenet/Model/Directpost/Response.php

The following code needs to be modified: In vendor/magento/module-authorizenet/Model/Directpost/Request.php
Line 245 remove :
: string

Line 258 (change):
private function getSignatureKey(): string to this----> private function getSignatureKey()

Line 271 (change) : private function setSignatureKey(string $signatureKey)
to this---->private function setSignatureKey($signatureKey)

In vendor/magento/module-authorizenet/Model/Directpost/Response.php
Line 79 (change):
private function generateSha2Hash(string $signatureKey): string
to this----> private function generateSha2Hash($signatureKey)

Line 114 (change and add):
foreach ($hashFields as $field) {
$message .= ($this->getData($field) ?? '') . '^';

TO THIS ------>

foreach ($hashFields as $field) { if (!empty($this->getData($field))) { $message .= $this->getData($field); } $message .= '^';

Then run compile.

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.