magento2.4.5-P1版本集成了Checkout.com支付v4.3.0 测试环境支付不成功 打印PlaceOrder.php文件的$this->methodHandler 是空的

magento2.4.5-P1版本集成了Checkout.com支付v4.3.0 测试环境支付不成功 打印PlaceOrder.php文件的$this->methodHandler 是空的

protected function requestPayment(CartInterface $quote, $data): ?Payment
{
    if ($quote->getPayment()->getMethod() === null) {
        $paymentMethod = $data['methodId'];
        $quote->setPaymentMethod($paymentMethod); //payment method
        $quote->getPayment()->importData(['method' => $paymentMethod]);
    }

    // Get the method id
    $methodId = $quote->getPayment()->getMethodInstance()->getCode();
    $logger = \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Framework\Logger\Monolog::class);
    $logger->addRecord(\Monolog\Logger::INFO, var_export($this->methodHandler, true));
    // Send the charge request
    return $this->methodHandler->get($methodId)->sendPaymentRequest(
        $data,
        $quote->getGrandTotal(),
        $quote->getQuoteCurrencyCode(),
        $quote->getReservedOrderId()
    );
}
已回答
0