diff --git a/Makefile b/Makefile index 7c3ace459..de3a68b13 100755 --- a/Makefile +++ b/Makefile @@ -90,9 +90,4 @@ npm-package-install: prepare-zip: composer install --no-dev --optimize-autoloader --classmap-authoritative composer dump-autoload --no-dev --optimize --classmap-authoritative - cp .github/.htaccess vendor/.htaccess - rm -rf .git .docker .editorconfig .github tests .php-cs-fixer.php Makefile cypress .docker cypress.config.js cypress.env.json docker-compose*.yml .gitignore bin codeception.yml package-lock.json package.json .php_cs.dist .php-cs-fixer.dist - - - - + rm -rf .git .docker .editorconfig .github tests .php-cs-fixer.php Makefile cypress .docker cypress.config.js cypress.env.json docker-compose*.yml .gitignore bin codeception.yml package-lock.json package.json .php_cs.dist .php-cs-fixer.dist .php-cs-fixer.dist.php diff --git a/README.md b/README.md index 639346878..847b381e4 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Receive payments from European customers with ease. Mollie provides payment meth Choose the best payment provider available for your online PrestaShop store. Create your merchant account at [Mollie.com](https://www.mollie.com/). -Mollie supports the following payment methods: iDEAL, Credit card, Bancontact, SOFORT Banking, ING Home’Pay, Bank transfers, PayPal, KBC / CBC Payment Button, Belfius, CartaSi, Cartes Bancaires, EPS, Giropay, Klarna: Pay later, Klarna: Slice it +Mollie supports the following payment methods: iDEAL, Credit card, Bancontact, SOFORT Banking, ING Home’Pay, Bank transfers, PayPal, KBC / CBC Payment Button, Belfius, CartaSi, Cartes Bancaires, EPS, Klarna: Pay later, Klarna: Slice it [![Build Status](https://travis-ci.org/mollie/PrestaShop.svg?branch=master)](https://travis-ci.org/mollie/PrestaShop) [![Greenkeeper badge](https://badges.greenkeeper.io/mollie/PrestaShop.svg)](https://greenkeeper.io/) diff --git a/README_DE.md b/README_DE.md index acf6f2a01..c255125c5 100644 --- a/README_DE.md +++ b/README_DE.md @@ -128,11 +128,6 @@ Die Karten tragen ebenfalls das Markenzeichen von Visa. Dies macht sie zur wichtigsten Zahlungsmethode in Österreich, die bei österreichischen Konsumenten hohe Beliebtheit genießt. -### Giropay -[Giropay](https://www.mollie.com/de/payments/giropay). Giropay ist eine der beliebtesten Überweisungsmethoden Deutschlands. - -Deutsche Kunden schenken dieser Zahlungsmethode ihr Vertrauen, da sie von über 1.500 Banken landesweit unterstützt wird. - ### Klarna: Rechnung [Klarna: Rechnung](https://www.mollie.com/de/payments/klarna-pay-later). Klarna ist eine flexible Zahlungslösung, die Ihren Kunden verschiedene, flexible Zahlungsmöglichkeiten zur Verfügung stellt. diff --git a/README_ES.md b/README_ES.md index 1bf6155e9..df0f1fe9a 100644 --- a/README_ES.md +++ b/README_ES.md @@ -128,11 +128,6 @@ Las tarjetas que comparten marca con Visa. Esto hace que el EPS sea el principal tipo de pago por transferencia bancaria en Austria y muy popular entre los compradores austriacos. -### Giropay -[Giropay](https://www.mollie.com/es/payments/giropay). Giropay es un tipo de pago por transferencia bancaria, popular en Alemania. - -Utiliza más de 1.500 bancos alemanes, lo que lo convierte en un tipo de pago confiable para los clientes alemanes. - ### Klarna: Pay later [Klarna: Pay later](https://www.mollie.com/es/payments/klarna-pay-later). Klarna es una solución de pago flexible que les permite a sus clientes diversas formas de pago flexibles. diff --git a/README_FR.md b/README_FR.md index ccd4ff9d5..bb1cc73e5 100644 --- a/README_FR.md +++ b/README_FR.md @@ -128,11 +128,6 @@ Les cartes sont co-marquées avec Visa. Devenue très populaire auprès des consommateurs autrichiens, EPS est la référence en matière de virement bancaire en Autriche. -### Giropay -[Giropay](https://www.mollie.com/fr/payments/giropay). Giropay est une méthode de paiement très populaire de virement bancaire en Allemagne. - -Utilisé par plus de 15000 à travers le pays, cela en fait un moyen de paiement fiable, réputé auprès des consommateurs allemands. - ### Klarna : Pay later [Klarna : Pay later](https://www.mollie.com/fr/payments/klarna-pay-later). Klarna est une solution de paiement flexible, qui permet à vos clients des modes de paiement variés. diff --git a/README_NL.md b/README_NL.md index c2d142407..3b9554016 100644 --- a/README_NL.md +++ b/README_NL.md @@ -117,11 +117,6 @@ De kaarten zijn co-branded met Visa. Dit maakt EPS de belangrijkste betaalmethode voor bankoverboekingen in Oostenrijk en zeer populair bij Oostenrijkse klanten. -### Giropay -[Giropay](https://www.mollie.com/nl/payments/giropay). Giropay is een populaire bankoverboeking betaalmethode in Duitsland. - -Het maakt gebruik van meer dan 1.500 Duitse banken, waardoor het een vertrouwde betaalmethode is onder Duitse klanten. - ### Klarna: Achteraf betalen [Klarna: Achteraf betalen](https://www.mollie.com/nl/payments/klarna-pay-later). Klarna is een flexibele betaaloplossing, waarmee je je klanten diverse mogelijkheden voor uitgestelde betaling biedt. diff --git a/changelog.md b/changelog.md index 09a8211bc..78048bcf8 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,14 @@ # Changelog # +## Changes in release 6.2.2 ## ++ Error handling improvements ++ Mobile phone fix then field is removed ++ Riverty, Trustly, Payconiq payment methods added and GiroPay removed ++ HTTP status ++ Dependencies version bump ++ Improved installation process + ## Changes in release 6.2.1 ## + Ideal v2 payment method improvement diff --git a/composer.json b/composer.json index ab171d36f..6f4806454 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "mollie/mollie-api-php": "v2.65.0", "segmentio/analytics-php": "^1.5", "sentry/sentry": "3.17.0", - "league/container": "2.5.0", + "league/container": "3.3.3", "prestashop/module-lib-service-container": "v2.0", "webmozart/assert": "^1.11", "symfony/http-client": "^4.4", diff --git a/controllers/front/webhook.php b/controllers/front/webhook.php index fa2710aa3..abca3b115 100644 --- a/controllers/front/webhook.php +++ b/controllers/front/webhook.php @@ -11,8 +11,10 @@ */ use Mollie\Adapter\ToolsAdapter; +use Mollie\Api\Exceptions\ApiException; use Mollie\Controller\AbstractMollieController; use Mollie\Errors\Http\HttpStatusCode; +use Mollie\Exception\TransactionException; use Mollie\Handler\ErrorHandler\ErrorHandler; use Mollie\Infrastructure\Response\JsonResponse; use Mollie\Logger\PrestaLoggerInterface; @@ -50,9 +52,6 @@ public function initContent(): void /** @var PrestaLoggerInterface $logger */ $logger = $this->module->getService(PrestaLoggerInterface::class); - /** @var ErrorHandler $errorHandler */ - $errorHandler = $this->module->getService(ErrorHandler::class); - /** @var ToolsAdapter $tools */ $tools = $this->module->getService(ToolsAdapter::class); @@ -95,20 +94,12 @@ public function initContent(): void try { $this->executeWebhook($transactionId); + } catch (ApiException $exception) { + $this->handleException($exception, HttpStatusCode::HTTP_BAD_REQUEST, 'Api request failed'); + } catch (TransactionException $exception) { + $this->handleException($exception, $exception->getCode(), 'Failed to handle transaction'); } catch (\Throwable $exception) { - $logger->error('Failed to handle webhook', [ - 'Exception message' => $exception->getMessage(), - 'Exception code' => $exception->getCode(), - ]); - - $errorHandler->handle($exception, $exception->getCode(), false); - - $this->releaseLock(); - - $this->ajaxResponse(JsonResponse::error( - $this->module->l('Failed to handle webhook', self::FILE_NAME), - $exception->getCode() - )); + $this->handleException($exception, HttpStatusCode::HTTP_BAD_REQUEST, 'Failed to handle webhook'); } $this->releaseLock(); @@ -158,4 +149,25 @@ private function setContext(int $cartId): void $this->context->cart = $cart; } + + private function handleException(Throwable $exception, int $httpStatusCode, string $logMessage): void + { + /** @var PrestaLoggerInterface $logger */ + $logger = $this->module->getService(PrestaLoggerInterface::class); + + /** @var ErrorHandler $errorHandler */ + $errorHandler = $this->module->getService(ErrorHandler::class); + + $logger->error($logMessage, [ + 'Exception message' => $exception->getMessage(), + 'Exception code' => $httpStatusCode, + ]); + + $errorHandler->handle($exception, $httpStatusCode, false); + $this->releaseLock(); + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Failed to handle webhook', self::FILE_NAME), + $httpStatusCode + )); + } } diff --git a/cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js b/cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js index 9f28a15a3..9d69131bc 100755 --- a/cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js +++ b/cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js @@ -215,19 +215,7 @@ it('C339365: 28 Przelewy24 Checkouting [Orders API]', () => { it('C339366: 29 Przelewy24 Order Shipping, Refunding [Orders API]', () => { cy.OrderRefundingShippingOrdersAPI() }) -it('C339367: 30 Giropay Checkouting [Orders API]', () => { - cy.navigatingToThePayment() - //Payment method choosing - cy.contains('giropay').click({force:true}) - cy.get('.condition-label > .js-terms').click({force:true}) - cy.contains('Place order').click() - cy.get('[value="paid"]').click() - cy.get('[class="button form__button"]').click() - cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') -}); -it('C339368: 31 Giropay Order Shipping, Refunding [Orders API]', () => { - cy.OrderRefundingShippingOrdersAPI() -}) + it('C339369: 32 EPS Checkouting [Orders API]', () => { cy.navigatingToThePayment() //Payment method choosing diff --git a/cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js b/cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js index faffc9163..a78b25544 100755 --- a/cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js +++ b/cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js @@ -180,19 +180,7 @@ it('C339391: 56 Przelewy24 Checkouting [Payments API]', () => { it('C339392: 57 Przelewy24 BO Refunding, Partial Refunding [Payments API]', () => { cy.OrderRefundingPartialPaymentsAPI() }); -it('C339393: 58 Giropay Checkouting [Payments API]', () => { - cy.navigatingToThePayment() - //Payment method choosing - cy.contains('giropay').click({force:true}) - cy.get('.condition-label > .js-terms').click({force:true}) - cy.contains('Place order').click() - cy.get('[value="paid"]').click() - cy.get('[class="button form__button"]').click() - cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') -}); -it('C339394: 59 Giropay BO Refunding, Partial Refunding [Payments API]', () => { - cy.OrderRefundingPartialPaymentsAPI() -}); + it('C339395: 60 EPS Checkouting [Payments API]', () => { cy.navigatingToThePayment() //Payment method choosing diff --git a/cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js b/cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js index 85586a8c3..c6964ffa2 100755 --- a/cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js +++ b/cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js @@ -204,19 +204,6 @@ it('C339365: 28 Przelewy24 Checkouting [Orders API]', () => { it('C339366: 29 Przelewy24 Order Shipping, Refunding [Orders API]', () => { cy.OrderRefundingShippingOrdersAPI() }) -it('C339367: 30 Giropay Checkouting [Orders API]', () => { - cy.navigatingToThePaymentPS8() - //Payment method choosing - cy.contains('giropay').click({force:true}) - cy.get('.condition-label > .js-terms').click({force:true}) - cy.contains('Place order').click() - cy.get('[value="paid"]').click() - cy.get('[class="button form__button"]').click() - cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') -}); -it('C339368: 31 Giropay Order Shipping, Refunding [Orders API]', () => { - cy.OrderRefundingShippingOrdersAPI() -}) it('C339369: 32 EPS Checkouting [Orders API]', () => { cy.navigatingToThePaymentPS8() //Payment method choosing diff --git a/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js b/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js index fd98721ef..8b0657a29 100755 --- a/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js +++ b/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js @@ -170,19 +170,6 @@ it('C339391: 56 Przelewy24 Checkouting [Payments API]', () => { it('C339392: 57 Przelewy24 BO Refunding, Partial Refunding [Payments API]', () => { cy.OrderRefundingPartialPaymentsAPI() }); -it('C339393: 58 Giropay Checkouting [Payments API]', () => { - cy.navigatingToThePaymentPS8() - //Payment method choosing - cy.contains('giropay').click({force:true}) - cy.get('.condition-label > .js-terms').click({force:true}) - cy.contains('Place order').click() - cy.get('[value="paid"]').click() - cy.get('[class="button form__button"]').click() - cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') -}); -it('C339394: 59 Giropay BO Refunding, Partial Refunding [Payments API]', () => { - cy.OrderRefundingPartialPaymentsAPI() -}); it('C339395: 60 EPS Checkouting [Payments API]', () => { cy.navigatingToThePaymentPS8() //Payment method choosing diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 860faab4d..c398bce51 100755 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -42,7 +42,7 @@ import 'cypress-iframe'; // Cypress.Commands.add("login", (email, password) => { ... }) Cypress.Commands.add("ConfOrdersAPI1784", () => { - const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "bancontact", "eps", "giropay", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint", "blik", "bancomatpay"]; + const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "bancontact", "eps", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint", "blik", "bancomatpay"]; // Iterate through the paymentMethods array using forEach paymentMethods.forEach(method => { @@ -59,7 +59,7 @@ Cypress.Commands.add("ConfOrdersAPI1784", () => { }) Cypress.Commands.add("ConfPaymentsAPI1784", () => { - const paymentMethods = ["giropay", "eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay", "twint", "blik", "bancomatpay"]; + const paymentMethods = ["eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay", "twint", "blik", "bancomatpay"]; // Iterate through the paymentMethods array using forEach paymentMethods.forEach(method => { diff --git a/mollie.php b/mollie.php index c68e33c91..21621619f 100755 --- a/mollie.php +++ b/mollie.php @@ -84,7 +84,7 @@ public function __construct() { $this->name = 'mollie'; $this->tab = 'payments_gateways'; - $this->version = '6.2.1'; + $this->version = '6.2.2'; $this->author = 'Mollie B.V.'; $this->need_instance = 1; $this->bootstrap = true; @@ -155,6 +155,8 @@ private function loadEnv() */ public function install() { + PrestaShopLogger::addLog('Mollie install started', 1, null, 'Mollie', 1); + if (!$this->isPhpVersionCompliant()) { $this->_errors[] = $this->l('You\'re using an outdated PHP version. Upgrade your PHP version to use this module. The Mollie module supports versions PHP 7.2.0 and higher.'); @@ -166,9 +168,11 @@ public function install() return false; } + PrestaShopLogger::addLog('Mollie prestashop install successful', 1, null, 'Mollie', 1); // TODO inject base install and subscription services $coreInstaller = $this->getService(Mollie\Install\Installer::class); + PrestaShopLogger::addLog('Mollie core install initiated', 1, null, 'Mollie', 1); if (!$coreInstaller->install()) { $this->_errors = array_merge($this->_errors, $coreInstaller->getErrors()); @@ -176,6 +180,8 @@ public function install() return false; } + PrestaShopLogger::addLog('Mollie core install successful', 1, null, 'Mollie', 1); + $subscriptionInstaller = new Installer( new DatabaseTableInstaller(), new AttributeInstaller( @@ -187,6 +193,7 @@ public function install() ), new HookInstaller($this) ); + PrestaShopLogger::addLog('Mollie subscription installer initiated', 1, null, 'Mollie', 1); if (!$subscriptionInstaller->install()) { $this->_errors = array_merge($this->_errors, $subscriptionInstaller->getErrors()); @@ -194,6 +201,7 @@ public function install() return false; } + PrestaShopLogger::addLog('Mollie subscription install successful', 1, null, 'Mollie', 1); return true; } diff --git a/src/Config/Config.php b/src/Config/Config.php index 6ca067414..946946d57 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -47,7 +47,6 @@ class Config 'ideal' => ['nl'], 'bancontact' => ['be'], 'paypal' => [], - 'giropay' => ['de'], 'eps' => ['at'], 'belfius' => ['be'], 'inghomepay' => ['be'], @@ -64,6 +63,9 @@ class Config 'ro', 'bl', 'mf', 'pm', 'sm', 'sk', 'sl', 'es', 'se', 'ch', 'gb', 'uk', ], 'mybank' => [], + 'trustly' => ['at', 'de', 'ee', 'es', 'fi', 'lt', 'lv', 'nl'], + 'riverty' => ['nl', 'be', 'de', 'at'], + 'payconiq' => [], ]; const SUPPORTED_PHP_VERSION = '5.6'; @@ -240,6 +242,7 @@ class Config const MOLLIE_METHOD_ID_APPLE_PAY = 'applepay'; const MOLLIE_VOUCHER_METHOD_ID = 'voucher'; const MOLLIE_in3_METHOD_ID = 'in3'; + const RIVERTY = 'riverty'; const MOLLIE_VOUCHER_CATEGORY_NULL = 'null'; const MOLLIE_VOUCHER_CATEGORY_MEAL = 'meal'; @@ -275,6 +278,7 @@ class Config PaymentMethod::BILLIE, self::MOLLIE_VOUCHER_METHOD_ID, self::MOLLIE_in3_METHOD_ID, + self::RIVERTY, ]; const PAYMENT_API_ONLY_METHODS = [ @@ -301,7 +305,6 @@ class Config 'directdebit' => 'Direct Debit', 'eps' => 'EPS', 'giftcard' => 'Giftcard', - 'giropay' => 'Giropay', 'ideal' => 'iDEAL', 'inghomepay' => 'ING Homepay', 'kbc' => 'KBC', @@ -322,6 +325,9 @@ class Config 'alma' => 'Alma', 'blik' => 'BLIK', 'klarna' => 'Pay with Klarna.', + 'riverty' => 'Riverty', + 'payconiq' => 'Payconiq', + 'trustly' => 'Trustly', ]; const MOLLIE_BUTTON_ORDER_TOTAL_REFRESH = 'MOLLIE_BUTTON_ORDER_TOTAL_REFRESH'; diff --git a/src/Install/Installer.php b/src/Install/Installer.php index 60bcc10eb..f8c52300b 100644 --- a/src/Install/Installer.php +++ b/src/Install/Installer.php @@ -28,6 +28,7 @@ use Mollie\Utility\MultiLangUtility; use OrderState; use PrestaShopException; +use PrestaShopLogger; use Tab; use Tools; use Validate; @@ -96,8 +97,11 @@ public function install() $this->module->registerHook($hook); } + PrestaShopLogger::addLog('Mollie hooks registered successful', 1, null, 'Mollie', 1); + try { $this->orderStateInstaller->install(); + PrestaShopLogger::addLog('Mollie order state install successful', 1, null, 'Mollie', 1); } catch (CouldNotInstallModule $e) { $errorHandler->handle($e, $e->getCode(), false); $this->errors[] = $this->module->l('Unable to install Mollie statuses', self::FILE_NAME); @@ -107,6 +111,7 @@ public function install() try { $this->initConfig(); + PrestaShopLogger::addLog('Mollie configurations installed', 1, null, 'Mollie', 1); } catch (Exception $e) { $errorHandler->handle($e, $e->getCode(), false); $this->errors[] = $this->module->l('Unable to install config', self::FILE_NAME); @@ -115,6 +120,7 @@ public function install() } try { $this->setDefaultCarrierStatuses(); + PrestaShopLogger::addLog('Mollie default carriers installed', 1, null, 'Mollie', 1); } catch (Exception $e) { $errorHandler->handle($e, $e->getCode(), false); $this->errors[] = $this->module->l('Unable to install default carrier statuses', self::FILE_NAME); @@ -126,6 +132,7 @@ public function install() try { $this->installVoucherFeatures(); + PrestaShopLogger::addLog('Mollie voucher features installed', 1, null, 'Mollie', 1); } catch (Exception $e) { $errorHandler->handle($e, $e->getCode(), false); $this->errors[] = $this->module->l('Unable to install voucher attributes', self::FILE_NAME); @@ -134,6 +141,7 @@ public function install() } $this->copyEmailTemplates(); + PrestaShopLogger::addLog('Mollie email templates copied', 1, null, 'Mollie', 1); return $this->databaseTableInstaller->install(); } diff --git a/src/Provider/PhoneNumberProvider.php b/src/Provider/PhoneNumberProvider.php index 022d144a5..86c016dc6 100644 --- a/src/Provider/PhoneNumberProvider.php +++ b/src/Provider/PhoneNumberProvider.php @@ -13,6 +13,7 @@ namespace Mollie\Provider; use Address; +use AddressFormat; if (!defined('_PS_VERSION_')) { exit; @@ -53,6 +54,12 @@ public function getFromAddress(Address $address) private function getMobileOrPhone(Address $address) { - return $address->phone_mobile ?: $address->phone; + $addressFormat = new AddressFormat((int) $address->id_country); + + if (strpos($addressFormat->format, 'phone_mobile') !== false) { + return $address->phone_mobile ?: $address->phone; + } + + return $address->phone; } } diff --git a/src/ServiceProvider/PrestashopContainer.php b/src/ServiceProvider/PrestashopContainer.php index 87b0c62bb..8f13e4f13 100644 --- a/src/ServiceProvider/PrestashopContainer.php +++ b/src/ServiceProvider/PrestashopContainer.php @@ -14,15 +14,15 @@ namespace Mollie\ServiceProvider; -use Interop\Container\ContainerInterface as InteropContainerInterface; use PrestaShop\PrestaShop\Adapter\SymfonyContainer; +use Psr\Container\ContainerInterface as PsrContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; if (!defined('_PS_VERSION_')) { exit; } -class PrestashopContainer implements InteropContainerInterface +class PrestashopContainer implements PsrContainerInterface { /** @var SymfonyContainer|ContainerInterface|null */ private $container; diff --git a/subscription/Install/Installer.php b/subscription/Install/Installer.php index 6d854ad74..8cfe08d43 100644 --- a/subscription/Install/Installer.php +++ b/subscription/Install/Installer.php @@ -14,6 +14,8 @@ namespace Mollie\Subscription\Install; +use PrestaShopLogger; + if (!defined('_PS_VERSION_')) { exit; } @@ -43,22 +45,31 @@ public function install(): bool { if (!$this->databaseInstaller->install()) { $this->errors = $this->databaseInstaller->getErrors(); + PrestaShopLogger::addLog('Mollie subscription databases install failed', 1, null, 'Mollie', 1); return false; } + PrestaShopLogger::addLog('Mollie subscription databases installed', 1, null, 'Mollie', 1); + if (!$this->attributeInstaller->install()) { $this->errors = $this->attributeInstaller->getErrors(); + PrestaShopLogger::addLog('Mollie subscription attributes install failed', 1, null, 'Mollie', 1); return false; } + PrestaShopLogger::addLog('Mollie subscription attributes install successful', 1, null, 'Mollie', 1); + if (!$this->hookInstaller->install()) { $this->errors = $this->hookInstaller->getErrors(); + PrestaShopLogger::addLog('Mollie subscription hooks install failed', 1, null, 'Mollie', 1); return false; } + PrestaShopLogger::addLog('Mollie subscription hooks install successful', 1, null, 'Mollie', 1); + return true; } } diff --git a/views/templates/admin/mollie_components_info.tpl b/views/templates/admin/mollie_components_info.tpl index 830d8d9dc..585712b76 100644 --- a/views/templates/admin/mollie_components_info.tpl +++ b/views/templates/admin/mollie_components_info.tpl @@ -8,7 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart *} -