From 1a1d129a54e03fbcb738c067b4c164c50f072ae8 Mon Sep 17 00:00:00 2001 From: ivan-pugach-mondu <155441636+ivan-pugach-mondu@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:41:52 +0300 Subject: [PATCH] PT-1774: Magento2-Shirtracer-LIVE - Error in CreateOrder observer. (#111) --- Helpers/Log.php | 6 +++--- Plugin/AddTemplateVariable.php | 2 +- composer.json | 2 +- etc/module.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Helpers/Log.php b/Helpers/Log.php index 61b9a51..15f293c 100755 --- a/Helpers/Log.php +++ b/Helpers/Log.php @@ -116,9 +116,9 @@ public function logTransaction($order, $response, $addons = null, $paymentMethod 'is_confirmed' => 1, 'invoice_iban' => $response['merchant']['viban'] ?? null, 'external_data' => json_encode([ - 'merchant_company_name' => $response['merchant']['company_name'] ?: null, - 'buyer_country_code' => $response['content_configuration']['buyer_country_code'] ?: null, - 'bank_account' => $response['bank_account'] ?: null + 'merchant_company_name' => isset($response['merchant']['company_name']) ? $response['merchant']['company_name'] : null, + 'buyer_country_code' => isset($response['content_configuration']['buyer_country_code']) ? $response['content_configuration']['buyer_country_code'] : null, + 'bank_account' => isset($response['bank_account']) ? $response['bank_account'] : null ]) ]; $monduLogger->addData($logData); diff --git a/Plugin/AddTemplateVariable.php b/Plugin/AddTemplateVariable.php index a68c22b..4daad96 100644 --- a/Plugin/AddTemplateVariable.php +++ b/Plugin/AddTemplateVariable.php @@ -92,7 +92,7 @@ public function beforeSetVars( 'countryId' => $externalData['buyer_country_code'] ?: $billingAddress->getCountryId(), 'merchant_company_name' => $externalData['merchant_company_name'], 'bank_account' => $externalData['bank_account'], - 'invoiceId' => $vars['invoice']->getIncrementId(), + 'invoiceId' => isset($vars['invoice']) && $vars['invoice']->getIncrementId() ? $vars['invoice']->getIncrementId() : '', 'iban' => $monduLog['invoice_iban'], 'paymentMethod' => $vars['order']->getPayment()->getMethodInstance()->getTitle(), 'netTerms' => isset($monduLog['authorized_net_term']) ? $monduLog['authorized_net_term'] : '' diff --git a/composer.json b/composer.json index 21d3a9c..09add44 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "mondu_gmbh/magento2-payment", "description": "Mondu payment method for magento 2", "type": "magento2-module", - "version": "2.3.7", + "version": "2.3.8", "license": [ "MIT" ], diff --git a/etc/module.xml b/etc/module.xml index 7e3d89c..cc09a56 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - +