Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

payULogger.CRITICAL: PosId is empty #23

Open
p24-max opened this issue Jun 29, 2023 · 1 comment
Open

payULogger.CRITICAL: PosId is empty #23

p24-max opened this issue Jun 29, 2023 · 1 comment

Comments

@p24-max
Copy link

p24-max commented Jun 29, 2023

Given:

  • When magento is configured with multiple websites/stores
  • PayU is only enabled for 1 of those websites

Issue:
Critical error gets logged when cart is loaded in all websites/stores where PayU is not enabled

Expected result:
No error is logged, as PayU is disabled

Affected code line:
https://github.com/PayU-EMEA/plugin_magento_24/blob/master/lib/OpenPayU/AuthType/Basic.php#L14

Call stack
image

Versions:

  • Magento 2.4.4-p2
  • PHP 8.1
@p24-max
Copy link
Author

p24-max commented Jun 29, 2023

Who also faces this issue, here is a patch:

diff --git a/vendor/payu/magento24-payment-gateway/Model/GetPayMethods.php b/vendor/payu/magento24-payment-gateway/Model/GetPayMethods.php
--- a/vendor/payu/magento24-payment-gateway/Model/GetPayMethods.php
+++ b/vendor/payu/magento24-payment-gateway/Model/GetPayMethods.php	(date 1688021803195)
@@ -84,6 +84,10 @@
     public function execute()
     {
         try {
+            if (!$this->gatewayConfig->getValue('main_parameters/active', $this->storeId)) {
+                return [];
+            }
+
             $this->payUConfig->setDefaultConfig(ConfigProvider::CODE);
             $payURetrive = $this->openPayURetrieve;
             $response = $payURetrive::payMethods($this->availableLocale->execute())->getResponse();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant