【问题标题】:Magento 2.3.1 Authorize.net Payment Method - The authenticity of the gateway response could not be verifiedMagento 2.3.1 Authorize.net Payment Method - 无法验证网关响应的真实性
【发布时间】:2019-10-22 17:15:30
【问题描述】:

当您在 Magento 2.3.1 上使用 Authorized.Tet 作为付款方式下订单时 出现此错误

“无法验证网关响应的真实性”

谁能告诉我这个错误是怎么回事并帮助我修复这个错误?

V1/guest-carts/fYSiT09cTjrNy2T14YzaXPXDlDMjMUUL/payment-information 400 (bad request)


{message: "The authenticity of the gateway response could not be verified.",…}
message: "The authenticity of the gateway response could not be verified."
trace: "#0 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Checkout\Model\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder('fYSiT09cTjrNy2T...', 'roeland@alwayso...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#1 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callParent('savePaymentInfo...', Array)
#2 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->Magento\Framework\Interception\{closure}('fYSiT09cTjrNy2T...', 'roeland@alwayso...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#3 /home/eaglesc3/public_html/generated/code/Magento/Checkout/Model/GuestPaymentInformationManagement/Interceptor.php(26): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callPlugins('savePaymentInfo...', Array, Array)
#4 [internal function]: Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->savePaymentInformationAndPlaceOrder('fYSiT09cTjrNy2T...', 'roeland@alwayso...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#5 /home/eaglesc3/public_html/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)
#6 /home/eaglesc3/public_html/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))
#7 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#8 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)
#9 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#10 /home/eaglesc3/public_html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(26): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)
#11 /home/eaglesc3/public_html/vendor/magento/framework/App/Http.php(136): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#12 /home/eaglesc3/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#13 /home/eaglesc3/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http\Interceptor->launch()
#14 /home/eaglesc3/public_html/index.php(92): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#15 {main}"

【问题讨论】:

    标签: magento2 payment-gateway authorize.net


    【解决方案1】:

    刚刚在 2.3.3 上解决了同样的问题。在使用 authorize.net 的沙箱为我们的开发服务器生成新密钥后,我遇到了它。以为我可能以错误的顺序生成了密钥(根据 glsAdmin 的回答),但生成时间的顺序正确。我调试了事务响应,并且那里有必要的数据(填充了transHashSha2)。那么,到底出了什么问题?

    在我的情况下,它通过重新生成密钥并在生成新密钥时选中“立即禁用旧交易密钥”和“立即禁用旧签名密钥”框来解决Authorize.net 上的密钥。

    【讨论】:

      【解决方案2】:

      我们在从 Magento1 迁移到 Magento2.3.1 时遇到了完全相同的问题,专门用于 authorize.net 转换。

      我犯了一个错误,即在创建新的交易密钥之前访问 authorize.net 并创建新的签名。

      经过大量阅读(以及来自https://www.solvature.us/ 的一些帮助),我们发现创建顺序与新创建密钥一样重要。

      首先创建一个新的事务密钥(请记住,这可能会影响主动集成,所以要小心)。其次,创建新签名。

      希望这会有所帮助。

      【讨论】:

        【解决方案3】:

        查看source code,此错误似乎集中在用于验证响应的哈希值周围。 transactionResponse->transHashSha2 和 transactionResponse->transHash 似乎都是空的或哈希本身无效。

        Your version of Magento seems to support this change 并指出您需要做什么来解决此问题。由于您使用的是支持此更改的 Magento 版本,因此您可能必须更改您的 Authorize.Net 帐户。确保您:

        1. 获取新的 Authorize.Net 签名密钥
          1. 通过https://account.authorize.net登录商户界面。
          2. 单击主工具栏中的帐户。
          3. 点击左侧主菜单中的设置。
          4. 点击 API 凭据和密钥。
          5. 选择新签名密钥。查看可用选项。
          6. 点击提交继续。
          7. 请求并输入 PIN 码进行验证。
          8. 将显示您的新签名密钥。复制此密钥以添加到您的 Magento 管理员配置中。
        2. 更新您的 Magento 配置
          1. 登录 Magento 管理员。
          2. 在管理侧边栏上,单击商店。然后在“设置”下,单击“配置”。
          3. 在面板中,点击销售,然后点击付款方式。
          4. 展开 Authorize.net Direct Post 部分。
          5. 在签名密钥中输入 SHA-512 签名密钥。
          6. 点击保存配置。

        【讨论】:

        • 我还需要“立即禁用旧事务密钥”和“立即禁用旧签名密钥”才能再次开始工作
        猜你喜欢
        • 1970-01-01
        • 2013-10-02
        • 2011-04-29
        • 1970-01-01
        • 2017-07-15
        • 2015-07-24
        • 2014-06-16
        • 2012-05-08
        相关资源
        最近更新 更多