diff --git a/UI/PaymentBoosterConfigProvider.php b/UI/PaymentBoosterConfigProvider.php index 88252b34..3b2ecb69 100644 --- a/UI/PaymentBoosterConfigProvider.php +++ b/UI/PaymentBoosterConfigProvider.php @@ -11,6 +11,7 @@ use Magento\Directory\Model\Country; use Magento\Directory\Model\ResourceModel\Country\CollectionFactory; use Magento\Config\Model\Config\Source\Nooptreq as NooptreqSource; +use Psr\Log\LoggerInterface; /** * Config provider for Payment Booster. @@ -37,6 +38,11 @@ class PaymentBoosterConfigProvider implements ConfigProviderInterface */ private $collectionFactory; + /** + * @var LoggerInterface + */ + private $logger; + /** * @var array */ @@ -52,12 +58,14 @@ public function __construct( CheckoutData $checkoutData, Config $config, AllowedCountries $allowedCountries, - CollectionFactory $collectionFactory + CollectionFactory $collectionFactory, + LoggerInterface $logger ) { $this->checkoutData = $checkoutData; $this->config = $config; $this->allowedCountries = $allowedCountries; $this->collectionFactory = $collectionFactory; + $this->logger = $logger; } /** @@ -66,6 +74,8 @@ public function __construct( public function getConfig(): array { if (!$this->checkoutData->getPublicOrderId()) { + $errorMsg = "No public order ID."; + $this->logger->critical('Error in PaymentBoosterConfigProvider->getConfig(): '.$errorMsg); return []; } @@ -77,6 +87,20 @@ public function getConfig(): array $epsAuthToken = $this->checkoutData->getEpsAuthToken(); $epsGatewayId = $this->checkoutData->getEpsGatewayId(); if ($jwtToken === null || $epsAuthToken === null || $epsGatewayId === null) { + $errorMsgs = []; + if ($jwtToken === null) { + $errorMsgs[] = '$jwtToken is null.'; + } + + if ($epsAuthToken === null) { + $errorMsgs[] = '$epsAuthToken is null.'; + } + + if ($epsGatewayId === null) { + $errorMsgs[] = '$epsGatewayId is null.'; + } + + $this->logger->critical('Error in PaymentBoosterConfigProvider->getConfig(): '.implode(', ', $errorMsgs)); return []; } return [ diff --git a/composer.json b/composer.json index 4a1c672c..6fcc75d0 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,9 @@ "magento/module-quote": ">=101.1.1 <101.2.8", "magento/module-store": ">=101.0.1 <101.1.8" }, + "replace": { + "bold-commerce/module-checkout":"*" + }, "autoload": { "files": [ "registration.php"