setAdditionalInformation not working (Magento 2)
Hello while placing an order using paysafe payment method.
Below error appears.
Error: Call to a member function getAdditionalInformation() on null in /app/code/Paysafe/Payment/Controller/CC/Redirect.php:55
On payment page – https://website.com/paysafe/cc/redirect
namespace PaysafePaymentGatewayResponse;
use MagentoPaymentGatewayDataPaymentDataObjectInterface;
use MagentoPaymentGatewayResponseHandlerInterface;
use MagentoSalesModelOrder;
class TxnIdHandler implements HandlerInterface
{
public function handle(array $handlingSubject, array $response)
{
if (isset($response[‘acsURL’])) {
$payment->setAdditionalInformation(‘3ds_redirect_url’, $response[‘acsURL’]);
}
}
}
Below file & method is not getting executed & that’s where the AdditionalInformation is set on payment method.
That gives error on
PaysafePaymentControllerCcRedirect.php
$order = $this->checkoutSession->getLastRealOrder();
/** @var OrderPayment $payment */
$payment = $order->getPayment();
$redirectUrl = $payment->getAdditionalInformation(‘3ds_redirect_url’);
Any thoughts on how to fix it ?