It is followed by a foreach to which they are passed:
foreach ($paymentMethods as $paymentMethod) {
if (in_array(PaymentMethodsToHide::PAYMENT_TYPE_TO_CONFIG_MAP[$paymentMethod['type'] ?? ''] ?? '', $this->configHelper->getPaymentMethodsToHide())) {
$isActive = false;
break;
}
}
However, there is no check for null returned, causing an error to occur:
[2024-03-06T13:24:12.663499+00:00] main.CRITICAL: Exception: Warning: Invalid argument supplied for foreach() in /var/www/html/vendor/pay-now/paynow-magento2/Model/Ui/DigitalWalletConfigProvider.php on line 34 in /var/www/html/vendor/magento/framework/App/ErrorHandler.php:61
This error can cause the checkout to display incorrectly or not to display at all.
Magento version: 2.4.4-p2 PayNow version: 1.5.2
There is a line of code in the Paynow\PaymentGateway\Model\Ui\DigitalWalletConfigProvider that retrieves available digital wallets:
It is followed by a foreach to which they are passed:
However, there is no check for null returned, causing an error to occur:
This error can cause the checkout to display incorrectly or not to display at all.