From 7ef03740b5a0a1f735e3feae5ac1af3487bd7d5c Mon Sep 17 00:00:00 2001 From: mandan2 <61560082+mandan2@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:55:16 +0300 Subject: [PATCH 01/15] PIPRES-329: Use Mollie mapped status for initial subscription order (#827) * PIPRES-329: Use Mollie mapped status for initial subscription order * moved price compare before validateOrder call --- src/Utility/NumberUtility.php | 2 +- src/Utility/OrderStatusUtility.php | 8 +++--- .../CouldNotHandleRecurringOrder.php | 8 ++++++ subscription/Exception/ExceptionCode.php | 1 + .../Handler/RecurringOrderHandler.php | 25 ++++++++++++------- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/Utility/NumberUtility.php b/src/Utility/NumberUtility.php index f34ea296a..f7c4f5977 100644 --- a/src/Utility/NumberUtility.php +++ b/src/Utility/NumberUtility.php @@ -114,7 +114,7 @@ public static function divide( return (float) $result->toPrecision($precision, $roundingMode); } - public static function isEqual($a, $b) + public static function isEqual(float $a, float $b): bool { $firstNumber = self::getNumber($a); $secondNumber = self::getNumber($b); diff --git a/src/Utility/OrderStatusUtility.php b/src/Utility/OrderStatusUtility.php index 5d07977f0..2ac6fd999 100644 --- a/src/Utility/OrderStatusUtility.php +++ b/src/Utility/OrderStatusUtility.php @@ -56,10 +56,10 @@ public static function transformPaymentStatusToRefunded($transaction) $remainingAmount = $payment->getAmountRemaining(); } } - $amountRefunded = $transaction->amountRefunded->value; - $amountPayed = $transaction->amountCaptured->value; - $isPartiallyRefunded = NumberUtility::isLowerThan($amountRefunded, $amountPayed); - $isFullyRefunded = NumberUtility::isEqual($amountRefunded, $amountPayed); + $amountRefunded = (float) $transaction->amountRefunded->value; + $amountPaid = (float) $transaction->amountCaptured->value; + $isPartiallyRefunded = NumberUtility::isLowerThan($amountRefunded, $amountPaid); + $isFullyRefunded = NumberUtility::isEqual($amountRefunded, $amountPaid); if ($isPartiallyRefunded) { if ($isVoucher && NumberUtility::isEqual(0, $remainingAmount)) { diff --git a/subscription/Exception/CouldNotHandleRecurringOrder.php b/subscription/Exception/CouldNotHandleRecurringOrder.php index 88c00de19..a8aa3f9d5 100644 --- a/subscription/Exception/CouldNotHandleRecurringOrder.php +++ b/subscription/Exception/CouldNotHandleRecurringOrder.php @@ -19,4 +19,12 @@ public static function failedToApplySelectedCarrier(): self ExceptionCode::RECURRING_ORDER_FAILED_TO_APPLY_SELECTED_CARRIER ); } + + public static function cartAndPaidPriceAreNotEqual(): self + { + return new self( + 'Cart and paid price are not equal', + ExceptionCode::RECURRING_ORDER_CART_AND_PAID_PRICE_ARE_NOT_EQUAL + ); + } } diff --git a/subscription/Exception/ExceptionCode.php b/subscription/Exception/ExceptionCode.php index 69a0b5e2e..1d2710b49 100644 --- a/subscription/Exception/ExceptionCode.php +++ b/subscription/Exception/ExceptionCode.php @@ -26,4 +26,5 @@ class ExceptionCode public const RECURRING_ORDER_FAILED_TO_FIND_SELECTED_CARRIER = 3001; public const RECURRING_ORDER_FAILED_TO_APPLY_SELECTED_CARRIER = 3002; + public const RECURRING_ORDER_CART_AND_PAID_PRICE_ARE_NOT_EQUAL = 3003; } diff --git a/subscription/Handler/RecurringOrderHandler.php b/subscription/Handler/RecurringOrderHandler.php index 56833468a..96cea54d3 100644 --- a/subscription/Handler/RecurringOrderHandler.php +++ b/subscription/Handler/RecurringOrderHandler.php @@ -30,6 +30,7 @@ use Mollie\Subscription\Repository\RecurringOrderRepositoryInterface; use Mollie\Subscription\Repository\RecurringOrdersProductRepositoryInterface; use Mollie\Subscription\Utility\ClockInterface; +use Mollie\Utility\NumberUtility; use Mollie\Utility\SecureKeyUtility; use MolRecurringOrder; use MolRecurringOrdersProduct; @@ -245,11 +246,24 @@ private function createSubscription(Payment $transaction, MolRecurringOrder $rec $methodName = $paymentMethod->method_name ?: Config::$methods[$transaction->method]; + $subscriptionPaidTotal = (float) $subscription->amount->value; + $cartTotal = (float) $newCart->getOrderTotal(true, Cart::BOTH); + + if (!NumberUtility::isEqual($cartTotal, $subscriptionPaidTotal)) { + // TODO when improved logging with context will be implemented, remove this logging + $this->logger->error('Paid price is not equal to the order\'s total', [ + 'Paid price' => $subscriptionPaidTotal, + 'Order price' => $cartTotal, + ]); + + throw CouldNotHandleRecurringOrder::cartAndPaidPriceAreNotEqual(); + } + try { $this->mollie->validateOrder( (int) $newCart->id, - (int) $this->configuration->get(Config::MOLLIE_STATUS_AWAITING), - (float) $subscription->amount->value, + (int) Config::getStatuses()[$transaction->status], + $subscriptionPaidTotal, sprintf('subscription/%s', $methodName), null, ['transaction_id' => $transaction->id], @@ -268,13 +282,6 @@ private function createSubscription(Payment $transaction, MolRecurringOrder $rec $orderId = (int) Order::getIdByCartId((int) $newCart->id); $order = new Order($orderId); - if ((float) $order->total_paid_tax_incl !== (float) $subscription->amount->value) { - $this->logger->error('Paid price is not equal to the order\'s total', [ - 'Paid price' => (float) $subscription->amount->value, - 'Order price' => (float) $order->total_paid_tax_incl, - ]); - } - $this->mollieOrderCreationService->createMolliePayment($transaction, (int) $newCart->id, $order->reference, (int) $orderId, PaymentStatus::STATUS_PAID); $this->orderStatusService->setOrderStatus($orderId, (int) Config::getStatuses()[$transaction->status]); From a723d6bcbd004abcac86d0ff2ee1b87e67f55c3d Mon Sep 17 00:00:00 2001 From: mandan2 <61560082+mandan2@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:09:27 +0300 Subject: [PATCH 02/15] PIPRES-346: Voucher visibility fix (#829) * PIPRES-346: Voucher visibility fix * reverted back logic --- src/Service/VoucherService.php | 17 ++++++++++------- src/Validator/VoucherValidator.php | 3 ++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Service/VoucherService.php b/src/Service/VoucherService.php index 8820327f4..07acd6341 100644 --- a/src/Service/VoucherService.php +++ b/src/Service/VoucherService.php @@ -46,17 +46,20 @@ public function getVoucherCategory(array $cartItem, $selectedVoucherCategory) } } - public function getProductCategory(array $cartItem) + public function getProductCategory(array $cartItem): string { if (!isset($cartItem['features'])) { return ''; } + $idFeatureValue = false; + foreach ($cartItem['features'] as $feature) { - if (!$this->isVoucherFeature($feature['id_feature'])) { + if (!$this->isVoucherFeature((int) $feature['id_feature'])) { continue; } - $idFeatureValue = $feature['id_feature_value']; + + $idFeatureValue = (int) $feature['id_feature_value']; } if (!$idFeatureValue) { @@ -66,15 +69,15 @@ public function getProductCategory(array $cartItem) return $this->getVoucherCategoryByFeatureValueId($idFeatureValue); } - private function isVoucherFeature($featureId) + private function isVoucherFeature(int $featureId): bool { - return (int) $this->configuration->get(Config::MOLLIE_VOUCHER_FEATURE_ID) === (int) $featureId; + return (int) $this->configuration->get(Config::MOLLIE_VOUCHER_FEATURE_ID) === $featureId; } - private function getVoucherCategoryByFeatureValueId($idFeatureValue) + private function getVoucherCategoryByFeatureValueId(int $idFeatureValue): string { foreach (Config::MOLLIE_VOUCHER_CATEGORIES as $key => $categoryName) { - if ($this->configuration->get(Config::MOLLIE_VOUCHER_FEATURE . $key) === $idFeatureValue) { + if ((int) $this->configuration->get(Config::MOLLIE_VOUCHER_FEATURE . $key) === $idFeatureValue) { return $key; } } diff --git a/src/Validator/VoucherValidator.php b/src/Validator/VoucherValidator.php index c885a1310..36fd54715 100644 --- a/src/Validator/VoucherValidator.php +++ b/src/Validator/VoucherValidator.php @@ -34,7 +34,7 @@ public function __construct(ConfigurationAdapter $configuration, VoucherService $this->voucherService = $voucherService; } - public function validate(array $products) + public function validate(array $products): bool { if (Config::MOLLIE_VOUCHER_CATEGORY_NULL !== $this->configuration->get(Config::MOLLIE_VOUCHER_CATEGORY)) { return true; @@ -42,6 +42,7 @@ public function validate(array $products) foreach ($products as $product) { $voucherCategory = $this->voucherService->getProductCategory($product); + if ($voucherCategory) { return true; } From 8fd6928e07692e7b3f2a063273739243d66727d2 Mon Sep 17 00:00:00 2001 From: mandan2 <61560082+mandan2@users.noreply.github.com> Date: Tue, 24 Oct 2023 09:39:02 +0300 Subject: [PATCH 03/15] PIPRES-348: Move subscription options to subscription tab (#832) * PIPRES-348: WIP move subscription options to subscription tab * added carrier repository to provide with carrier choices, moved template to another file * phpstan * adjusted PS 1.7.6 support * removed validations from formProcess * simplified formProcess --- config/routes.yml | 8 +++ config/services.yml | 45 ++++++++++++++ src/Builder/FormBuilder.php | 57 +---------------- .../Symfony/AbstractSymfonyController.php | 6 +- .../Symfony/SubscriptionController.php | 55 +++++++++++++++-- .../ChoiceProvider/CarrierOptionsProvider.php | 35 +++++++++++ .../SubscriptionOptionsConfiguration.php | 60 ++++++++++++++++++ .../SubscriptionOptionsDataProvider.php | 43 +++++++++++++ .../Form/Options/SubscriptionOptionsType.php | 41 +++++++++++++ .../Handler/RecurringOrderHandler.php | 1 + subscription/Logger/Logger.php | 2 + .../Subscription/subscriptions-grid.html.twig | 4 +- .../subscriptions-settings.html.twig | 61 +++++++++++++++++++ 13 files changed, 352 insertions(+), 66 deletions(-) create mode 100644 subscription/Form/ChoiceProvider/CarrierOptionsProvider.php create mode 100644 subscription/Form/Options/SubscriptionOptionsConfiguration.php create mode 100644 subscription/Form/Options/SubscriptionOptionsDataProvider.php create mode 100644 subscription/Form/Options/SubscriptionOptionsType.php create mode 100644 views/templates/admin/Subscription/subscriptions-settings.html.twig diff --git a/config/routes.yml b/config/routes.yml index b2814487e..204756e25 100644 --- a/config/routes.yml +++ b/config/routes.yml @@ -14,6 +14,14 @@ admin_subscription_index: _legacy_controller: AdminMollieSubscriptionOrders _legacy_link: AdminMollieSubscriptionOrders +admin_subscription_options_submit: + path: admin-subscription-options-submit + methods: POST + defaults: + _controller: Mollie\Subscription\Controller\Symfony\SubscriptionController::submitOptionsAction + _legacy_controller: AdminMollieSubscriptionOrders + _legacy_link: AdminMollieSubscriptionOrders + admin_subscription_search: path: admin-subscription methods: POST diff --git a/config/services.yml b/config/services.yml index c0da042b5..76634b961 100644 --- a/config/services.yml +++ b/config/services.yml @@ -41,3 +41,48 @@ services: Mollie\Subscription\Grid\Accessibility\SubscriptionCancelAccessibility: class: Mollie\Subscription\Grid\Accessibility\SubscriptionCancelAccessibility + + carrier_options_provider: + class: Mollie\Subscription\Form\ChoiceProvider\CarrierOptionsProvider + public: true + arguments: + - '@Mollie' + + subscription_options_configuration: + class: Mollie\Subscription\Form\Options\SubscriptionOptionsConfiguration + arguments: + - '@prestashop.adapter.legacy.configuration' + + subscription_options_data_provider: + class: Mollie\Subscription\Form\Options\SubscriptionOptionsDataProvider + arguments: + - '@subscription_options_configuration' + + subscription_options_type: + class: Mollie\Subscription\Form\Options\SubscriptionOptionsType + parent: 'form.type.translatable.aware' + public: true + arguments: + - '@carrier_options_provider' + - '@Mollie' + tags: + - { name: form.type } + + subscription_options_form_handler: + class: 'PrestaShop\PrestaShop\Core\Form\Handler' + arguments: + - '@form.factory' + - '@prestashop.core.hook.dispatcher' + - '@subscription_options_data_provider' + - 'Mollie\Subscription\Form\Options\SubscriptionOptionsType' + - 'SubscriptionOptions' + + # NOTE: works for PS < 1.7.8 + subscription_options_form_handler_deprecated: + class: 'PrestaShop\PrestaShop\Core\Form\FormHandler' + arguments: + - '@=service("form.factory").createBuilder()' + - '@prestashop.core.hook.dispatcher' + - '@subscription_options_data_provider' + - 'subscription_options': 'Mollie\Subscription\Form\Options\SubscriptionOptionsType' + - 'SubscriptionOptions' diff --git a/src/Builder/FormBuilder.php b/src/Builder/FormBuilder.php index 111c9f83f..eacef51b6 100644 --- a/src/Builder/FormBuilder.php +++ b/src/Builder/FormBuilder.php @@ -24,7 +24,6 @@ use Mollie\Api\Types\RefundStatus; use Mollie\Config\Config; use Mollie\Provider\CustomLogoProviderInterface; -use Mollie\Repository\CarrierRepositoryInterface; use Mollie\Repository\TaxRulesGroupRepositoryInterface; use Mollie\Service\ApiService; use Mollie\Service\ConfigFieldService; @@ -91,8 +90,6 @@ class FormBuilder /** @var Context */ private $context; - /** @var CarrierRepositoryInterface */ - private $carrierRepository; public function __construct( Mollie $module, @@ -106,8 +103,7 @@ public function __construct( CustomLogoProviderInterface $creditCardLogoProvider, ConfigurationAdapter $configuration, TaxRulesGroupRepositoryInterface $taxRulesGroupRepository, - Context $context, - CarrierRepositoryInterface $carrierRepository + Context $context ) { $this->module = $module; $this->apiService = $apiService; @@ -121,7 +117,6 @@ public function __construct( $this->configuration = $configuration; $this->taxRulesGroupRepository = $taxRulesGroupRepository; $this->context = $context; - $this->carrierRepository = $carrierRepository; } public function buildSettingsForm() @@ -532,8 +527,6 @@ protected function getAdvancedSettingsSection() ], ]; - $input = array_merge($input, $this->getShippingOptions($advancedSettings)); - $messageStatus = $this->module->l('Status for %s payments', self::FILE_NAME); $descriptionStatus = $this->module->l('`%s` payments get `%s` status', self::FILE_NAME); $messageMail = $this->module->l('Send email when %s', self::FILE_NAME); @@ -828,52 +821,4 @@ private function getSettingTabs($isApiKeyProvided) return $tabs; } - - private function getShippingOptions(string $tab): array - { - /** @var \Carrier[] $carriers */ - $carriers = $this->carrierRepository->findAllBy([ - 'active' => 1, - 'deleted' => 0, - ]); - - $mappedCarriers = []; - - $mappedCarriers[] = [ - 'id' => 0, - 'name' => $this->module->l('Not selected', self::FILE_NAME), - ]; - - foreach ($carriers as $carrier) { - $mappedCarriers[] = [ - 'id' => $carrier->id, - 'name' => $carrier->name, - ]; - } - - $header = [ - 'type' => 'mollie-h2', - 'name' => '', - 'tab' => $tab, - 'title' => $this->module->l('Subscriptions', self::FILE_NAME), - ]; - - $options = [ - 'type' => 'select', - 'label' => $this->module->l('Select shipping option to use in subscription orders', self::FILE_NAME), - 'desc' => $this->module->l('WARNING: do not change selection after getting first subscription order.', self::FILE_NAME), - 'tab' => $tab, - 'name' => Config::MOLLIE_SUBSCRIPTION_ORDER_CARRIER_ID, - 'options' => [ - 'query' => $mappedCarriers, - 'id' => 'id', - 'name' => 'name', - ], - ]; - - return [ - $header, - $options, - ]; - } } diff --git a/subscription/Controller/Symfony/AbstractSymfonyController.php b/subscription/Controller/Symfony/AbstractSymfonyController.php index f7b35a56c..2ea50f1d3 100644 --- a/subscription/Controller/Symfony/AbstractSymfonyController.php +++ b/subscription/Controller/Symfony/AbstractSymfonyController.php @@ -4,7 +4,6 @@ use Module; use Mollie; -use Mollie\ServiceProvider\LeagueServiceContainerProvider; use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; /** @@ -12,16 +11,13 @@ */ abstract class AbstractSymfonyController extends FrameworkBundleAdminController { - /** @var LeagueServiceContainerProvider */ - protected $leagueContainer; - /** @var Mollie */ protected $module; public function __construct() { parent::__construct(); - $this->leagueContainer = new LeagueServiceContainerProvider(); + /* @phpstan-ignore-next-line */ $this->module = Module::getInstanceByName('mollie'); } diff --git a/subscription/Controller/Symfony/SubscriptionController.php b/subscription/Controller/Symfony/SubscriptionController.php index ba13cca0d..29dea1fcb 100644 --- a/subscription/Controller/Symfony/SubscriptionController.php +++ b/subscription/Controller/Symfony/SubscriptionController.php @@ -10,6 +10,8 @@ use Mollie\Subscription\Filters\SubscriptionFilters; use Mollie\Subscription\Grid\SubscriptionGridDefinitionFactory; use Mollie\Subscription\Handler\SubscriptionCancellationHandler; +use Mollie\Utility\PsVersionUtility; +use PrestaShop\PrestaShop\Core\Form\FormHandlerInterface; use PrestaShop\PrestaShop\Core\Grid\GridFactoryInterface; use PrestaShopBundle\Security\Annotation\AdminSecurity; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -30,7 +32,7 @@ class SubscriptionController extends AbstractSymfonyController public function indexAction(SubscriptionFilters $filters, Request $request) { /** @var Shop $shop */ - $shop = $this->leagueContainer->getService(Shop::class); + $shop = $this->module->getService(Shop::class); if ($shop->getContext() !== \Shop::CONTEXT_SHOP) { if (!$this->get('session')->getFlashBag()->has('error')) { @@ -41,16 +43,61 @@ public function indexAction(SubscriptionFilters $filters, Request $request) } /** @var GridFactoryInterface $currencyGridFactory */ - $currencyGridFactory = $this->leagueContainer->getService('subscription_grid_factory'); + $currencyGridFactory = $this->module->getService('subscription_grid_factory'); $currencyGrid = $currencyGridFactory->getGrid($filters); + if (PsVersionUtility::isPsVersionGreaterOrEqualTo(_PS_VERSION_, '1.7.8.0')) { + $formHandler = $this->get('subscription_options_form_handler')->getForm(); + } else { + $formHandler = $this->get('subscription_options_form_handler_deprecated')->getForm(); + } + return $this->render('@Modules/mollie/views/templates/admin/Subscription/subscriptions-grid.html.twig', [ 'currencyGrid' => $this->presentGrid($currencyGrid), 'enableSidebar' => true, - 'help_link' => $this->generateSidebarLink($request->attributes->get('_legacy_controller')), + 'subscriptionOptionsForm' => $formHandler->createView(), ]); } + /** + * @AdminSecurity("is_granted('create', request.get('_legacy_controller'))") + * + * @param Request $request + * + * @return RedirectResponse + */ + public function submitOptionsAction(Request $request): RedirectResponse + { + if (PsVersionUtility::isPsVersionGreaterOrEqualTo(_PS_VERSION_, '1.7.8.0')) { + /** @var FormHandlerInterface $formHandler */ + $formHandler = $this->get('subscription_options_form_handler'); + } else { + /** @var FormHandlerInterface $formHandler */ + $formHandler = $this->get('subscription_options_form_handler_deprecated'); + } + + $form = $formHandler->getForm(); + $form->handleRequest($request); + + if (!$form->isSubmitted() || !$form->isValid()) { + $this->addFlash( + 'error', + $this->module->l('Failed to save options. Try again or contact support.', self::FILE_NAME) + ); + + return $this->redirectToRoute('admin_subscription_index'); + } + + $formHandler->save($form->getData()); + + $this->addFlash( + 'success', + $this->module->l('Options saved successfully.', self::FILE_NAME) + ); + + return $this->redirectToRoute('admin_subscription_index'); + } + /** * Provides filters functionality. * @@ -82,7 +129,7 @@ public function searchAction(Request $request): RedirectResponse public function cancelAction(int $subscriptionId): RedirectResponse { /** @var SubscriptionCancellationHandler $subscriptionCancellationHandler */ - $subscriptionCancellationHandler = $this->leagueContainer->getService(SubscriptionCancellationHandler::class); + $subscriptionCancellationHandler = $this->module->getService(SubscriptionCancellationHandler::class); try { $subscriptionCancellationHandler->handle($subscriptionId); diff --git a/subscription/Form/ChoiceProvider/CarrierOptionsProvider.php b/subscription/Form/ChoiceProvider/CarrierOptionsProvider.php new file mode 100644 index 000000000..17c45a00a --- /dev/null +++ b/subscription/Form/ChoiceProvider/CarrierOptionsProvider.php @@ -0,0 +1,35 @@ +carrierRepository = $module->getService(CarrierRepositoryInterface::class); + } + + public function getChoices(): array + { + /** @var \Carrier[] $carriers */ + $carriers = $this->carrierRepository->findAllBy([ + 'active' => 1, + 'deleted' => 0, + ]); + + $choices = []; + + foreach ($carriers as $carrier) { + $choices[$carrier->name] = (int) $carrier->id; + } + + return $choices; + } +} diff --git a/subscription/Form/Options/SubscriptionOptionsConfiguration.php b/subscription/Form/Options/SubscriptionOptionsConfiguration.php new file mode 100644 index 000000000..e3cb1ee5a --- /dev/null +++ b/subscription/Form/Options/SubscriptionOptionsConfiguration.php @@ -0,0 +1,60 @@ +configuration = $configuration; + } + + /** + * {@inheritdoc} + */ + public function getConfiguration(): array + { + return [ + 'carrier' => $this->configuration->getInt(Config::MOLLIE_SUBSCRIPTION_ORDER_CARRIER_ID), + ]; + } + + /** + * {@inheritdoc} + */ + public function updateConfiguration(array $configuration): array + { + if (!$this->validateConfiguration($configuration)) { + return []; + } + + $this->configuration->set( + Config::MOLLIE_SUBSCRIPTION_ORDER_CARRIER_ID, + $configuration['carrier'] + ); + + return []; + } + + /** + * {@inheritdoc} + */ + public function validateConfiguration(array $configuration): bool + { + return isset( + $configuration['carrier'] + ); + } +} diff --git a/subscription/Form/Options/SubscriptionOptionsDataProvider.php b/subscription/Form/Options/SubscriptionOptionsDataProvider.php new file mode 100644 index 000000000..2d534613c --- /dev/null +++ b/subscription/Form/Options/SubscriptionOptionsDataProvider.php @@ -0,0 +1,43 @@ +subscriptionOptionsConfiguration = $subscriptionOptionsConfiguration; + } + + /** + * {@inheritdoc} + */ + public function getData(): array + { + if (PsVersionUtility::isPsVersionGreaterOrEqualTo(_PS_VERSION_, '1.7.8.0')) { + return $this->subscriptionOptionsConfiguration->getConfiguration(); + } + + return ['subscription_options' => $this->subscriptionOptionsConfiguration->getConfiguration()]; + } + + /** + * {@inheritdoc} + */ + public function setData(array $data): array + { + if (PsVersionUtility::isPsVersionGreaterOrEqualTo(_PS_VERSION_, '1.7.8.0')) { + return $this->subscriptionOptionsConfiguration->updateConfiguration($data); + } + + return $this->subscriptionOptionsConfiguration->updateConfiguration($data['subscription_options']); + } +} diff --git a/subscription/Form/Options/SubscriptionOptionsType.php b/subscription/Form/Options/SubscriptionOptionsType.php new file mode 100644 index 000000000..22de3db2e --- /dev/null +++ b/subscription/Form/Options/SubscriptionOptionsType.php @@ -0,0 +1,41 @@ +carrierOptionProvider = $carrierOptionProvider; + $this->module = $module; + } + + public function buildForm(FormBuilderInterface $builder, array $options): void + { + $builder + ->add('carrier', ChoiceType::class, [ + 'required' => true, + 'choices' => $this->carrierOptionProvider->getChoices(), + // TODO migrate to modern translation system + 'placeholder' => $this->module->l('Choose your carrier'), + ]); + } +} diff --git a/subscription/Handler/RecurringOrderHandler.php b/subscription/Handler/RecurringOrderHandler.php index 96cea54d3..a35e2a265 100644 --- a/subscription/Handler/RecurringOrderHandler.php +++ b/subscription/Handler/RecurringOrderHandler.php @@ -85,6 +85,7 @@ public function __construct( ConfigurationAdapter $configuration, RecurringOrdersProductRepositoryInterface $recurringOrdersProductRepository, CarrierRepositoryInterface $carrierRepository, + // TODO use subscription logger after it's fixed PrestaLoggerInterface $logger, CreateSpecificPriceAction $createSpecificPriceAction, OrderRepositoryInterface $orderRepository diff --git a/subscription/Logger/Logger.php b/subscription/Logger/Logger.php index 11b6cc7fc..86f9a3df1 100644 --- a/subscription/Logger/Logger.php +++ b/subscription/Logger/Logger.php @@ -10,6 +10,8 @@ class Logger implements LoggerInterface const LOG_OBJECT_TYPE = 'mollie_sub_log'; + // TODO fix this logger + /** * @return null */ diff --git a/views/templates/admin/Subscription/subscriptions-grid.html.twig b/views/templates/admin/Subscription/subscriptions-grid.html.twig index 735467ba9..ee791a18e 100644 --- a/views/templates/admin/Subscription/subscriptions-grid.html.twig +++ b/views/templates/admin/Subscription/subscriptions-grid.html.twig @@ -1,4 +1,4 @@ -{#** +{# ** * 2007-2019 PrestaShop and Contributors * * NOTICE OF LICENSE @@ -29,6 +29,8 @@ {% block content %} + {{ include('@Modules/mollie/views/templates/admin/Subscription/subscriptions-settings.html.twig') }} +
{{ include('@PrestaShop/Admin/Common/Grid/grid_panel.html.twig', {'grid': currencyGrid }) }} diff --git a/views/templates/admin/Subscription/subscriptions-settings.html.twig b/views/templates/admin/Subscription/subscriptions-settings.html.twig new file mode 100644 index 000000000..b206df9bb --- /dev/null +++ b/views/templates/admin/Subscription/subscriptions-settings.html.twig @@ -0,0 +1,61 @@ +{# ** + * 2007-2019 PrestaShop and Contributors + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * https://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@prestashop.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to https://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2019 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * International Registered Trademark & Property of PrestaShop SA + * #} + +{% if subscriptionOptionsForm.subscription_options is defined and subscriptionOptionsForm.subscription_options %} + {% set subscriptionOptionsForm = subscriptionOptionsForm.subscription_options %} +{% endif %} + +{% block subscription_options %} +
+
+ {{ form_start(subscriptionOptionsForm, {method: 'POST', action: path('admin_subscription_options_submit'), attr: {id: 'subscription-options'}}) }} +
+

+ settings {{ 'Subscription options'|trans }} +

+
+
+
+ {# TODO translations will be enabled only after we will migrate to moden translation system #} + {{ ps.label_with_help('Carrier to use in subscription orders'|trans, 'WARNING: do not change selection after getting first subscription order.'|trans) }} +
+ {{ form_errors(subscriptionOptionsForm.carrier) }} + {{ form_widget(subscriptionOptionsForm.carrier) }} +
+
+ {{ form_rest(subscriptionOptionsForm) }} +
+
+ +
+ {{ form_end(subscriptionOptionsForm) }} +
+
+{% endblock %} From 5636cae9591b09eeea818d283a66058cf2bcfb7a Mon Sep 17 00:00:00 2001 From: mandan2 <61560082+mandan2@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:35:48 +0300 Subject: [PATCH 04/15] PIPRES-348: Form handler compatibility for lower PS versions (#834) * PIPRES-348: Form handler compatibility for lower PS versions * fix * fix --- .../Subscription/subscriptions-settings.html.twig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/views/templates/admin/Subscription/subscriptions-settings.html.twig b/views/templates/admin/Subscription/subscriptions-settings.html.twig index b206df9bb..7591371ce 100644 --- a/views/templates/admin/Subscription/subscriptions-settings.html.twig +++ b/views/templates/admin/Subscription/subscriptions-settings.html.twig @@ -23,8 +23,10 @@ * International Registered Trademark & Property of PrestaShop SA * #} +{% set subscriptionOptions = subscriptionOptionsForm %} + {% if subscriptionOptionsForm.subscription_options is defined and subscriptionOptionsForm.subscription_options %} - {% set subscriptionOptionsForm = subscriptionOptionsForm.subscription_options %} + {% set subscriptionOptions = subscriptionOptionsForm.subscription_options %} {% endif %} {% block subscription_options %} @@ -41,11 +43,10 @@ {# TODO translations will be enabled only after we will migrate to moden translation system #} {{ ps.label_with_help('Carrier to use in subscription orders'|trans, 'WARNING: do not change selection after getting first subscription order.'|trans) }}
- {{ form_errors(subscriptionOptionsForm.carrier) }} - {{ form_widget(subscriptionOptionsForm.carrier) }} + {{ form_errors(subscriptionOptions.carrier) }} + {{ form_widget(subscriptionOptions.carrier) }}
- {{ form_rest(subscriptionOptionsForm) }}
+ {{ form_rest(subscriptionOptionsForm) }} {{ form_end(subscriptionOptionsForm) }} From ae7959f8f44031c72dddc4654d2237735ebb4583 Mon Sep 17 00:00:00 2001 From: mandan2 <61560082+mandan2@users.noreply.github.com> Date: Tue, 24 Oct 2023 14:19:58 +0300 Subject: [PATCH 05/15] Sentry fixes (#835) * Sentry fixes * allow php-http discovery --- composer.json | 5 ++++- mollie.php | 33 +++++++++++++++++++++++------ src/Provider/PaymentFeeProvider.php | 8 +++---- src/Service/ApiService.php | 10 ++++----- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index 895fa0191..8d7b53375 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,10 @@ "platform": { "php": "7.2" }, - "prepend-autoloader": false + "prepend-autoloader": false, + "allow-plugins": { + "php-http/discovery": true + } }, "type": "prestashop-module", "author": "PrestaShop" diff --git a/mollie.php b/mollie.php index 3ce85292f..6970d8a77 100755 --- a/mollie.php +++ b/mollie.php @@ -471,7 +471,7 @@ public function hookDisplayBackOfficeHeader() */ public function hookDisplayAdminOrder($params) { - /** @var \Mollie\Repository\PaymentMethodRepository $paymentMethodRepo */ + /** @var PaymentMethodRepositoryInterface $paymentMethodRepo */ $paymentMethodRepo = $this->getService(PaymentMethodRepositoryInterface::class); /** @var \Mollie\Service\ShipmentServiceInterface $shipmentService */ @@ -568,8 +568,8 @@ public function hookPaymentOptions($params) */ public function hookDisplayOrderConfirmation() { - /** @var \Mollie\Repository\PaymentMethodRepository $paymentMethodRepo */ - $paymentMethodRepo = $this->getService(\Mollie\Repository\PaymentMethodRepository::class); + /** @var PaymentMethodRepositoryInterface $paymentMethodRepo */ + $paymentMethodRepo = $this->getService(PaymentMethodRepositoryInterface::class); $payment = $paymentMethodRepo->getPaymentBy('cart_id', (string) Tools::getValue('id_cart')); if (!$payment) { return ''; @@ -634,6 +634,10 @@ public function hookActionOrderStatusUpdate(array $params): void return; } + if ($order->module !== $this->name) { + return; + } + if (!$this->getApiClient()) { return; } @@ -771,6 +775,12 @@ public function hookDisplayPDFInvoice($params): string return ''; } + $order = $params['object']->getOrder(); + + if ($order->module !== $this->name) { + return ''; + } + $localeRepo = $this->get('prestashop.core.localization.locale.repository'); if (!$localeRepo) { @@ -786,7 +796,7 @@ public function hookDisplayPDFInvoice($params): string $invoiceTemplateBuilder = $this->getService(\Mollie\Builder\InvoicePdfTemplateBuilder::class); $templateParams = $invoiceTemplateBuilder - ->setOrder($params['object']->getOrder()) + ->setOrder($order) ->setLocale($locale) ->buildParams(); @@ -930,8 +940,8 @@ public function hookActionValidateOrder($params) $newPayment = $apiClient->payments->create($paymentData->jsonSerialize()); - /** @var \Mollie\Repository\PaymentMethodRepository $paymentMethodRepository */ - $paymentMethodRepository = $this->getService(\Mollie\Repository\PaymentMethodRepository::class); + /** @var PaymentMethodRepositoryInterface $paymentMethodRepository */ + $paymentMethodRepository = $this->getService(PaymentMethodRepositoryInterface::class); $paymentMethodRepository->addOpenStatusPayment( $cartId, $orderPayment, @@ -958,15 +968,24 @@ public function hookActionObjectOrderPaymentAddAfter($params) $paymentMethodRepo = $this->getService(PaymentMethodRepositoryInterface::class); $orders = Order::getByReference($orderPayment->order_reference); + /** @var Order $order */ $order = $orders->getFirst(); + if (!Validate::isLoadedObject($order)) { return; } + + if ($order->module !== $this->name) { + return; + } + $mollieOrder = $paymentMethodRepo->getPaymentBy('cart_id', $order->id_cart); + if (!$mollieOrder) { return; } + $orderPayment->payment_method = Config::$methods[$mollieOrder['method']]; $orderPayment->update(); } @@ -1037,7 +1056,7 @@ public static function resendOrderPaymentLink($orderId) { /** @var Mollie $module */ $module = Module::getInstanceByName('mollie'); - /** @var \Mollie\Repository\PaymentMethodRepository $molliePaymentRepo */ + /** @var PaymentMethodRepositoryInterface $molliePaymentRepo */ $molliePaymentRepo = $module->getService(PaymentMethodRepositoryInterface::class); $molPayment = $molliePaymentRepo->getPaymentBy('cart_id', (string) Cart::getCartIdByOrderId($orderId)); if (\Mollie\Utility\MollieStatusUtility::isPaymentFinished($molPayment['bank_status'])) { diff --git a/src/Provider/PaymentFeeProvider.php b/src/Provider/PaymentFeeProvider.php index 4daad5fda..10c55e689 100644 --- a/src/Provider/PaymentFeeProvider.php +++ b/src/Provider/PaymentFeeProvider.php @@ -71,7 +71,7 @@ public function __construct( public function getPaymentFee(MolPaymentMethod $paymentMethod, float $totalCartPriceTaxIncl): PaymentFeeData { // TODO handle exception on all calls. - $surchargeFixedPriceTaxExcl = $paymentMethod->surcharge_fixed_amount_tax_excl; + $surchargeFixedPriceTaxExcl = (float) $paymentMethod->surcharge_fixed_amount_tax_excl; $surchargePercentage = (float) $paymentMethod->surcharge_percentage; $surchargeLimit = (float) $paymentMethod->surcharge_limit; @@ -86,9 +86,9 @@ public function getPaymentFee(MolPaymentMethod $paymentMethod, float $totalCartP } $taxCalculator = $this->taxProvider->getTaxCalculator( - $paymentMethod->tax_rules_group_id, - $address->id_country, - $address->id_state + (int) $paymentMethod->tax_rules_group_id, + (int) $address->id_country, + (int) $address->id_state ); $paymentFeeCalculator = new PaymentFeeCalculator($taxCalculator, $this->context); diff --git a/src/Service/ApiService.php b/src/Service/ApiService.php index 03c27c133..5af028622 100644 --- a/src/Service/ApiService.php +++ b/src/Service/ApiService.php @@ -206,13 +206,13 @@ private function getMethodsObjForConfig($apiMethods) if (!empty($paymentMethod->surcharge_fixed_amount_tax_excl)) { $apiMethod['surcharge_fixed_amount_tax_incl'] = $this->getSurchargeFixedAmountTaxInclPrice( - $paymentMethod->surcharge_fixed_amount_tax_excl, - $paymentMethod->tax_rules_group_id, + (float) $paymentMethod->surcharge_fixed_amount_tax_excl, + (int) $paymentMethod->tax_rules_group_id, $this->context->getCountryId() ); $paymentMethod->surcharge_fixed_amount_tax_excl = NumberUtility::toPrecision( - $paymentMethod->surcharge_fixed_amount_tax_excl, + (float) $paymentMethod->surcharge_fixed_amount_tax_excl, NumberUtility::FLOAT_PRECISION ); @@ -443,12 +443,12 @@ private function toPrecisionForDecimalNumbers(MolPaymentMethod $paymentMethod): ); $paymentMethod->min_amount = NumberUtility::toPrecision( - $paymentMethod->min_amount, + (float) $paymentMethod->min_amount, NumberUtility::FLOAT_PRECISION ); $paymentMethod->max_amount = NumberUtility::toPrecision( - $paymentMethod->max_amount, + (float) $paymentMethod->max_amount, NumberUtility::FLOAT_PRECISION ); From ea7bf2d92db275df801216bef8cee95e9d52a8a9 Mon Sep 17 00:00:00 2001 From: mandan2 <61560082+mandan2@users.noreply.github.com> Date: Tue, 14 Nov 2023 16:32:17 +0200 Subject: [PATCH 06/15] PIPRES-319: Atomic process for controllers (#842) * PIPRES-319: Lock process adapter (#839) * PIPRES-319: Webhook controller protection (#841) * PIPRES-319: Webhook controller protection * phpstan and test fix * warning fix * stan fix * webhook thrown exception improvements * removed comment * csfixer --- controllers/front/payment.php | 2 +- controllers/front/return.php | 2 +- .../front/subscriptionUpdateWebhook.php | 92 ++++++++++-- controllers/front/subscriptionWebhook.php | 72 ++++++--- controllers/front/webhook.php | 140 +++++++++++------- src/Config/Config.php | 2 + src/Controller/AbstractMollieController.php | 103 +++++++++++++ src/Exception/Code/ExceptionCode.php | 3 + src/Infrastructure/Adapter/Lock.php | 79 ++++++++++ .../Exception/CouldNotHandleLocking.php | 33 +++++ src/Infrastructure/Response/JsonResponse.php | 41 +++++ src/Infrastructure/Response/Response.php | 21 +++ src/Logger/PrestaLogger.php | 22 ++- .../Infrastructure/Adapter/LockTest.php | 74 +++++++++ tests/Unit/Factory/SubscriptionDataTest.php | 24 +-- 15 files changed, 616 insertions(+), 94 deletions(-) create mode 100644 src/Infrastructure/Adapter/Lock.php create mode 100644 src/Infrastructure/Exception/CouldNotHandleLocking.php create mode 100644 src/Infrastructure/Response/JsonResponse.php create mode 100644 src/Infrastructure/Response/Response.php create mode 100644 tests/Integration/Infrastructure/Adapter/LockTest.php diff --git a/controllers/front/payment.php b/controllers/front/payment.php index 042842b53..62119cd9b 100644 --- a/controllers/front/payment.php +++ b/controllers/front/payment.php @@ -34,7 +34,7 @@ */ class MolliePaymentModuleFrontController extends ModuleFrontController { - const FILE_NAME = 'payment'; + private const FILE_NAME = 'payment'; /** @var bool */ public $ssl = true; diff --git a/controllers/front/return.php b/controllers/front/return.php index e9b8de776..3d8fcc59b 100644 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -32,7 +32,7 @@ class MollieReturnModuleFrontController extends AbstractMollieController /** @var Mollie */ public $module; - const FILE_NAME = 'return'; + private const FILE_NAME = 'return'; /** @var bool */ public $ssl = true; diff --git a/controllers/front/subscriptionUpdateWebhook.php b/controllers/front/subscriptionUpdateWebhook.php index 3d62c9706..704434d0a 100644 --- a/controllers/front/subscriptionUpdateWebhook.php +++ b/controllers/front/subscriptionUpdateWebhook.php @@ -10,8 +10,12 @@ * @codingStandardsIgnoreStart */ +use Mollie\Adapter\ToolsAdapter; use Mollie\Controller\AbstractMollieController; use Mollie\Errors\Http\HttpStatusCode; +use Mollie\Handler\ErrorHandler\ErrorHandler; +use Mollie\Infrastructure\Response\JsonResponse; +use Mollie\Logger\PrestaLoggerInterface; use Mollie\Subscription\Handler\SubscriptionPaymentMethodUpdateHandler; if (!defined('_PS_VERSION_')) { @@ -20,6 +24,8 @@ class MollieSubscriptionUpdateWebhookModuleFrontController extends AbstractMollieController { + private const FILE_NAME = 'subscriptionUpdateWebhook'; + /** @var Mollie */ public $module; /** @var bool */ @@ -40,29 +46,89 @@ protected function displayMaintenancePage() public function initContent() { - if (Configuration::get(Mollie\Config\Config::MOLLIE_DEBUG_LOG)) { - PrestaShopLogger::addLog('Mollie incoming subscription webhook: ' . Tools::file_get_contents('php://input')); - } + /** @var PrestaLoggerInterface $logger */ + $logger = $this->module->getService(PrestaLoggerInterface::class); - exit($this->executeWebhook()); - } + /** @var ErrorHandler $errorHandler */ + $errorHandler = $this->module->getService(ErrorHandler::class); - protected function executeWebhook() - { - $transactionId = Tools::getValue('id'); - $subscriptionId = Tools::getValue('subscription_id'); + /** @var ToolsAdapter $tools */ + $tools = $this->module->getService(ToolsAdapter::class); + + $logger->info(sprintf('%s - Controller called', self::FILE_NAME)); + + if (!$this->module->getApiClient()) { + $logger->error(sprintf('Unauthorized in %s', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Unauthorized', self::FILE_NAME), + HttpStatusCode::HTTP_UNAUTHORIZED + )); + } + + $transactionId = (string) $tools->getValue('id'); if (!$transactionId) { - $this->respond('failed', HttpStatusCode::HTTP_UNPROCESSABLE_ENTITY, 'Missing transaction id'); + $logger->error(sprintf('Missing transaction id in %s', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Missing transaction id', self::FILE_NAME), + HttpStatusCode::HTTP_UNPROCESSABLE_ENTITY + )); } + + $subscriptionId = (string) $tools->getValue('subscription_id'); + if (!$subscriptionId) { - $this->respond('failed', HttpStatusCode::HTTP_UNPROCESSABLE_ENTITY, 'Missing subscription id'); + $logger->error(sprintf('Missing subscription id in %s', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Missing subscription id', self::FILE_NAME), + HttpStatusCode::HTTP_UNPROCESSABLE_ENTITY + )); + } + + $lockResult = $this->applyLock(sprintf( + '%s-%s-%s', + self::FILE_NAME, + $transactionId, + $subscriptionId + )); + + if (!$lockResult->isSuccessful()) { + $logger->error(sprintf('Resource conflict in %s', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Resource conflict', self::FILE_NAME), + HttpStatusCode::HTTP_CONFLICT + )); } /** @var SubscriptionPaymentMethodUpdateHandler $subscriptionPaymentMethodUpdateHandler */ $subscriptionPaymentMethodUpdateHandler = $this->module->getService(SubscriptionPaymentMethodUpdateHandler::class); - $subscriptionPaymentMethodUpdateHandler->handle($transactionId, $subscriptionId); - return 'OK'; + try { + $subscriptionPaymentMethodUpdateHandler->handle($transactionId, $subscriptionId); + } catch (\Throwable $exception) { + $logger->error('Failed to handle subscription update', [ + 'Exception message' => $exception->getMessage(), + 'Exception code' => $exception->getCode(), + ]); + + $errorHandler->handle($exception, null, false); + + $this->releaseLock(); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Failed to handle subscription update', self::FILE_NAME), + $exception->getCode() + )); + } + + $this->releaseLock(); + + $logger->info(sprintf('%s - Controller action ended', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::success([])); } } diff --git a/controllers/front/subscriptionWebhook.php b/controllers/front/subscriptionWebhook.php index 433e6b290..1c524a507 100644 --- a/controllers/front/subscriptionWebhook.php +++ b/controllers/front/subscriptionWebhook.php @@ -10,9 +10,11 @@ * @codingStandardsIgnoreStart */ +use Mollie\Adapter\ToolsAdapter; use Mollie\Controller\AbstractMollieController; use Mollie\Errors\Http\HttpStatusCode; use Mollie\Handler\ErrorHandler\ErrorHandler; +use Mollie\Infrastructure\Response\JsonResponse; use Mollie\Logger\PrestaLoggerInterface; use Mollie\Subscription\Handler\RecurringOrderHandler; @@ -22,6 +24,8 @@ class MollieSubscriptionWebhookModuleFrontController extends AbstractMollieController { + private const FILE_NAME = 'subscriptionWebhook'; + /** @var Mollie */ public $module; /** @var bool */ @@ -42,29 +46,54 @@ protected function displayMaintenancePage() public function initContent() { - if (Configuration::get(Mollie\Config\Config::MOLLIE_DEBUG_LOG)) { - PrestaShopLogger::addLog('Mollie incoming subscription webhook: ' . Tools::file_get_contents('php://input')); - } + /** @var PrestaLoggerInterface $logger */ + $logger = $this->module->getService(PrestaLoggerInterface::class); - exit($this->executeWebhook()); - } + /** @var ErrorHandler $errorHandler */ + $errorHandler = $this->module->getService(ErrorHandler::class); - protected function executeWebhook() - { - $transactionId = Tools::getValue('id'); + /** @var ToolsAdapter $tools */ + $tools = $this->module->getService(ToolsAdapter::class); + + $logger->info(sprintf('%s - Controller called', self::FILE_NAME)); + + if (!$this->module->getApiClient()) { + $logger->error(sprintf('Unauthorized in %s', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Unauthorized', self::FILE_NAME), + HttpStatusCode::HTTP_UNAUTHORIZED + )); + } + + $transactionId = (string) $tools->getValue('id'); if (!$transactionId) { - $this->respond('failed', HttpStatusCode::HTTP_UNPROCESSABLE_ENTITY, 'Missing transaction id'); + $logger->error(sprintf('Missing transaction id in %s', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Missing transaction id', self::FILE_NAME), + HttpStatusCode::HTTP_UNPROCESSABLE_ENTITY + )); } - /** @var RecurringOrderHandler $recurringOrderHandler */ - $recurringOrderHandler = $this->module->getService(RecurringOrderHandler::class); + $lockResult = $this->applyLock(sprintf( + '%s-%s', + self::FILE_NAME, + $transactionId + )); - /** @var ErrorHandler $errorHandler */ - $errorHandler = $this->module->getService(ErrorHandler::class); + if (!$lockResult->isSuccessful()) { + $logger->error(sprintf('Resource conflict in %s', self::FILE_NAME)); - /** @var PrestaLoggerInterface $logger */ - $logger = $this->module->getService(PrestaLoggerInterface::class); + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Resource conflict', self::FILE_NAME), + HttpStatusCode::HTTP_CONFLICT + )); + } + + /** @var RecurringOrderHandler $recurringOrderHandler */ + $recurringOrderHandler = $this->module->getService(RecurringOrderHandler::class); try { $recurringOrderHandler->handle($transactionId); @@ -76,9 +105,18 @@ protected function executeWebhook() $errorHandler->handle($exception, null, false); - $this->respond('failed', HttpStatusCode::HTTP_BAD_REQUEST); + $this->releaseLock(); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Failed to handle recurring order', self::FILE_NAME), + $exception->getCode() + )); } - $this->respond('OK'); + $this->releaseLock(); + + $logger->info(sprintf('%s - Controller action ended', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::success([])); } } diff --git a/controllers/front/webhook.php b/controllers/front/webhook.php index 699298883..fa2710aa3 100644 --- a/controllers/front/webhook.php +++ b/controllers/front/webhook.php @@ -10,11 +10,12 @@ * @codingStandardsIgnoreStart */ -use Mollie\Api\Exceptions\ApiException; -use Mollie\Config\Config; +use Mollie\Adapter\ToolsAdapter; use Mollie\Controller\AbstractMollieController; use Mollie\Errors\Http\HttpStatusCode; use Mollie\Handler\ErrorHandler\ErrorHandler; +use Mollie\Infrastructure\Response\JsonResponse; +use Mollie\Logger\PrestaLoggerInterface; use Mollie\Service\TransactionService; use Mollie\Utility\TransactionUtility; @@ -24,6 +25,8 @@ class MollieWebhookModuleFrontController extends AbstractMollieController { + private const FILE_NAME = 'webhook'; + /** @var Mollie */ public $module; /** @var bool */ @@ -42,82 +45,117 @@ protected function displayMaintenancePage() { } - /** - * @throws ApiException - * @throws PrestaShopDatabaseException - * @throws PrestaShopException - */ - public function initContent() + public function initContent(): void { - if ((int) Configuration::get(Config::MOLLIE_DEBUG_LOG) === Config::DEBUG_LOG_ALL) { - PrestaShopLogger::addLog('Mollie incoming webhook: ' . Tools::file_get_contents('php://input')); + /** @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); + + $logger->info(sprintf('%s - Controller called', self::FILE_NAME)); + + if (!$this->module->getApiClient()) { + $logger->error(sprintf('Unauthorized in %s', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Unauthorized', self::FILE_NAME), + HttpStatusCode::HTTP_UNAUTHORIZED + )); + } + + $transactionId = (string) $tools->getValue('id'); + + if (!$transactionId) { + $logger->error(sprintf('Missing transaction id %s', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Missing transaction id', self::FILE_NAME), + HttpStatusCode::HTTP_UNPROCESSABLE_ENTITY + )); + } + + $lockResult = $this->applyLock(sprintf( + '%s-%s', + self::FILE_NAME, + $transactionId + )); + + if (!$lockResult->isSuccessful()) { + $logger->error(sprintf('Resource conflict in %s', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::error( + $this->module->l('Resource conflict', self::FILE_NAME), + HttpStatusCode::HTTP_CONFLICT + )); } try { - exit($this->executeWebhook()); + $this->executeWebhook($transactionId); } catch (\Throwable $exception) { - PrestaShopLogger::addLog('Error occurred: ' . $exception->getMessage(), 3, null, 'Mollie'); + $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->releaseLock(); + + $logger->info(sprintf('%s - Controller action ended', self::FILE_NAME)); + + $this->ajaxResponse(JsonResponse::success([])); } /** - * @return string - * - * @throws ApiException - * @throws PrestaShopDatabaseException - * @throws PrestaShopException + * @throws Throwable */ - protected function executeWebhook() + protected function executeWebhook(string $transactionId): void { /** @var TransactionService $transactionService */ $transactionService = $this->module->getService(TransactionService::class); - /** @var ErrorHandler $errorHandler */ - $errorHandler = $this->module->getService(ErrorHandler::class); + if (TransactionUtility::isOrderTransaction($transactionId)) { + $transaction = $this->module->getApiClient()->orders->get($transactionId, ['embed' => 'payments']); + } else { + $transaction = $this->module->getApiClient()->payments->get($transactionId); - $transactionId = Tools::getValue('id'); - if (!$transactionId) { - $this->respond('failed', HttpStatusCode::HTTP_UNPROCESSABLE_ENTITY, 'Missing transaction id'); + if ($transaction->orderId) { + $transaction = $this->module->getApiClient()->orders->get($transaction->orderId, ['embed' => 'payments']); + } } - if (!$this->module->getApiClient()) { - $this->respond('failed', HttpStatusCode::HTTP_UNAUTHORIZED, 'API key is missing or incorrect'); - } + $cartId = $transaction->metadata->cart_id ?? 0; - try { - if (TransactionUtility::isOrderTransaction($transactionId)) { - $transaction = $this->module->getApiClient()->orders->get($transactionId, ['embed' => 'payments']); - } else { - $transaction = $this->module->getApiClient()->payments->get($transactionId); - if ($transaction->orderId) { - $transaction = $this->module->getApiClient()->orders->get($transaction->orderId, ['embed' => 'payments']); - } - } - $metaData = $transaction->metadata; - $cartId = $metaData->cart_id ?? 0; - $this->setContext($cartId); - $payment = $transactionService->processTransaction($transaction); - } catch (\Throwable $e) { - $errorHandler->handle($e, $e->getCode(), false); - $this->respond('failed', $e->getCode(), $e->getMessage()); - } + if (!$cartId) { + // TODO webhook structure will change, no need to create custom exception for one time usage - /* @phpstan-ignore-next-line */ - if (is_string($payment)) { - return $payment; + throw new \Exception(sprintf('Missing Cart ID. Transaction ID: [%s]', $transactionId), HttpStatusCode::HTTP_NOT_FOUND); } - return 'OK'; + $this->setContext($cartId); + + $transactionService->processTransaction($transaction); } - private function setContext(int $cartId) + private function setContext(int $cartId): void { - if (!$cartId) { - return; - } $cart = new Cart($cartId); + $this->context->currency = new Currency($cart->id_currency); $this->context->customer = new Customer($cart->id_customer); + $this->context->cart = $cart; } } diff --git a/src/Config/Config.php b/src/Config/Config.php index 1509c77ba..6f348ef25 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -282,6 +282,8 @@ class Config const APPLE_PAY_DIRECT_ORDER_CREATION_MAX_WAIT_RETRIES = 10; const BANCONTACT_ORDER_CREATION_MAX_WAIT_RETRIES = 600; + public const LOCK_TIME_TO_LIVE = 60; + /** @var array */ public static $methods = [ 'banktransfer' => 'Bank', diff --git a/src/Controller/AbstractMollieController.php b/src/Controller/AbstractMollieController.php index 2b2a98909..11f144842 100644 --- a/src/Controller/AbstractMollieController.php +++ b/src/Controller/AbstractMollieController.php @@ -13,9 +13,28 @@ use Mollie\Errors\Error; use Mollie\Errors\Http\HttpStatusCode; +use Mollie\Infrastructure\Adapter\Lock; +use Mollie\Infrastructure\Response\JsonResponse; +use Mollie\Infrastructure\Response\Response; +use Mollie\Logger\PrestaLoggerInterface; class AbstractMollieController extends \ModuleFrontControllerCore { + private const FILE_NAME = 'AbstractMollieController'; + + /** @var Lock */ + private $lock; + + /** @var \Mollie */ + public $module; + + public function __construct() + { + parent::__construct(); + + $this->lock = $this->module->getService(Lock::class); + } + protected function respond($status, $statusCode = HttpStatusCode::HTTP_OK, $message = ''): void { http_response_code($statusCode); @@ -31,8 +50,92 @@ protected function respond($status, $statusCode = HttpStatusCode::HTTP_OK, $mess protected function ajaxRender($value = null, $controller = null, $method = null): void { + // TODO remove this later parent::ajaxRender($value, $controller, $method); exit; } + + protected function ajaxResponse($value, $controller = null, $method = null): void + { + /** @var PrestaLoggerInterface $logger */ + $logger = $this->module->getService(PrestaLoggerInterface::class); + + if ($value instanceof JsonResponse) { + if ($value->getStatusCode() === JsonResponse::HTTP_INTERNAL_SERVER_ERROR) { + $logger->error('Failed to return valid response', [ + 'context' => [ + 'response' => $value->getContent(), + ], + ]); + } + + http_response_code($value->getStatusCode()); + + $value = $value->getContent(); + } + + try { + $this->ajaxRender($value, $controller, $method); + } catch (\Throwable $exception) { + $logger->error('Could not return ajax response', [ + 'response' => json_encode($value ?: []), + 'Exception message' => $exception->getMessage(), + 'Exception code' => $exception->getCode(), + ]); + } + + exit; + } + + protected function applyLock(string $resource): Response + { + /** @var PrestaLoggerInterface $logger */ + $logger = $this->module->getService(PrestaLoggerInterface::class); + + try { + $this->lock->create($resource); + + if (!$this->lock->acquire()) { + $logger->error('Lock resource conflict', [ + 'resource' => $resource, + ]); + + return Response::respond( + $this->module->l('Resource conflict', self::FILE_NAME), + Response::HTTP_CONFLICT + ); + } + } catch (\Throwable $exception) { + $logger->error('Failed to lock process', [ + 'Exception message' => $exception->getMessage(), + 'Exception code' => $exception->getCode(), + ]); + + return Response::respond( + $this->module->l('Internal error', self::FILE_NAME), + Response::HTTP_INTERNAL_SERVER_ERROR + ); + } + + return Response::respond( + '', + Response::HTTP_OK + ); + } + + protected function releaseLock(): void + { + /** @var PrestaLoggerInterface $logger */ + $logger = $this->module->getService(PrestaLoggerInterface::class); + + try { + $this->lock->release(); + } catch (\Throwable $exception) { + $logger->error('Failed to release process', [ + 'Exception message' => $exception->getMessage(), + 'Exception code' => $exception->getCode(), + ]); + } + } } diff --git a/src/Exception/Code/ExceptionCode.php b/src/Exception/Code/ExceptionCode.php index cdd7ddb31..d7f21cef6 100644 --- a/src/Exception/Code/ExceptionCode.php +++ b/src/Exception/Code/ExceptionCode.php @@ -8,6 +8,9 @@ class ExceptionCode public const INFRASTRUCTURE_FAILED_TO_INSTALL_ORDER_STATE = 1001; public const INFRASTRUCTURE_UNKNOWN_ERROR = 1002; + public const INFRASTRUCTURE_LOCK_EXISTS = 1003; + public const INFRASTRUCTURE_LOCK_ON_ACQUIRE_IS_MISSING = 1004; + public const INFRASTRUCTURE_LOCK_ON_RELEASE_IS_MISSING = 1005; public const FAILED_TO_FIND_CUSTOMER_ADDRESS = 2001; diff --git a/src/Infrastructure/Adapter/Lock.php b/src/Infrastructure/Adapter/Lock.php new file mode 100644 index 000000000..8c3978734 --- /dev/null +++ b/src/Infrastructure/Adapter/Lock.php @@ -0,0 +1,79 @@ +lockFactory = new LockFactoryV4($store); + + return; + } + + // Symfony 3.4+ + $this->lockFactory = new LockFactoryV3($store); + } + + /** + * @throws CouldNotHandleLocking + */ + public function create(string $resource, int $ttl = Config::LOCK_TIME_TO_LIVE, bool $autoRelease = true): void + { + if ($this->lock) { + throw CouldNotHandleLocking::lockExists(); + } + + $this->lock = $this->lockFactory->createLock($resource, $ttl, $autoRelease); + } + + /** + * @throws CouldNotHandleLocking + */ + public function acquire(bool $blocking = false): bool + { + if (!$this->lock) { + throw CouldNotHandleLocking::lockOnAcquireIsMissing(); + } + + return $this->lock->acquire($blocking); + } + + /** + * @throws CouldNotHandleLocking + */ + public function release(): void + { + if (!$this->lock) { + throw CouldNotHandleLocking::lockOnReleaseIsMissing(); + } + + $this->lock->release(); + + $this->lock = null; + } + + public function __destruct() + { + try { + $this->release(); + } catch (CouldNotHandleLocking $exception) { + return; + } + } +} diff --git a/src/Infrastructure/Exception/CouldNotHandleLocking.php b/src/Infrastructure/Exception/CouldNotHandleLocking.php new file mode 100644 index 000000000..c6c23fe58 --- /dev/null +++ b/src/Infrastructure/Exception/CouldNotHandleLocking.php @@ -0,0 +1,33 @@ + true, + 'errors' => [], + 'data' => $data, + ], $status); + } + + /** + * @param string|array $error + */ + public static function error($error, int $status = 400): self + { + if (!is_array($error)) { + $error = [$error]; + } + + return new self([ + 'success' => false, + 'errors' => $error, + 'data' => [], + ], $status); + } +} diff --git a/src/Infrastructure/Response/Response.php b/src/Infrastructure/Response/Response.php new file mode 100644 index 000000000..a97cbbfdb --- /dev/null +++ b/src/Infrastructure/Response/Response.php @@ -0,0 +1,21 @@ +configuration = $configuration; + } + public function emergency($message, array $context = []) { throw new NotImplementedException('not implemented method'); @@ -33,11 +45,15 @@ public function critical($message, array $context = []) public function error($message, array $context = []) { + if ((int) $this->configuration->get(Config::MOLLIE_DEBUG_LOG) === Config::DEBUG_LOG_NONE) { + return; + } + $uniqueMessage = sprintf('Log ID (%s) | %s', uniqid('', true), $message); \PrestaShopLogger::addLog( $this->getMessageWithContext($uniqueMessage, $context), - 2 + 3 ); } @@ -53,6 +69,10 @@ public function notice($message, array $context = []) public function info($message, array $context = []) { + if ((int) $this->configuration->get(Config::MOLLIE_DEBUG_LOG) !== Config::DEBUG_LOG_ALL) { + return; + } + $uniqueMessage = sprintf('Log ID (%s) | %s', uniqid('', true), $message); \PrestaShopLogger::addLog( diff --git a/tests/Integration/Infrastructure/Adapter/LockTest.php b/tests/Integration/Infrastructure/Adapter/LockTest.php new file mode 100644 index 000000000..a5803fd41 --- /dev/null +++ b/tests/Integration/Infrastructure/Adapter/LockTest.php @@ -0,0 +1,74 @@ +getService(Lock::class); + + $lock->create('test-lock-name'); + + $this->assertTrue($lock->acquire()); + + $lock->release(); + } + + public function testItSuccessfullyLocksResourceFromAnotherProcess(): void + { + /** @var Lock $lock */ + $lock = $this->getService(Lock::class); + + $lock->create('test-lock-name'); + + $this->assertTrue($lock->acquire()); + + /** @var Lock $newLock */ + $newLock = $this->getService(Lock::class); + + $newLock->create('test-lock-name'); + + $this->assertFalse($newLock->acquire()); + } + + public function testItUnsuccessfullyCompletesLockFlowFailedToCreateLockWithMissingLock(): void + { + /** @var Lock $lock */ + $lock = $this->getService(Lock::class); + + $this->expectException(CouldNotHandleLocking::class); + $this->expectExceptionCode(ExceptionCode::INFRASTRUCTURE_LOCK_EXISTS); + + $lock->create('test-lock-name'); + $lock->create('test-lock-name'); + } + + public function testItUnsuccessfullyCompletesLockFlowFailedToAcquireLockWithMissingLock(): void + { + /** @var Lock $lock */ + $lock = $this->getService(Lock::class); + + $this->expectException(CouldNotHandleLocking::class); + $this->expectExceptionCode(ExceptionCode::INFRASTRUCTURE_LOCK_ON_ACQUIRE_IS_MISSING); + + $lock->acquire(); + } + + public function testItUnsuccessfullyCompletesLockFlowFailedToReleaseLockWithMissingLock(): void + { + /** @var Lock $lock */ + $lock = $this->getService(Lock::class); + + $this->expectException(CouldNotHandleLocking::class); + $this->expectExceptionCode(ExceptionCode::INFRASTRUCTURE_LOCK_ON_RELEASE_IS_MISSING); + + $lock->release(); + } +} diff --git a/tests/Unit/Factory/SubscriptionDataTest.php b/tests/Unit/Factory/SubscriptionDataTest.php index edbe8e30c..88bec26bf 100644 --- a/tests/Unit/Factory/SubscriptionDataTest.php +++ b/tests/Unit/Factory/SubscriptionDataTest.php @@ -5,7 +5,7 @@ namespace Mollie\Tests\Unit\Factory; use Mollie; -use Mollie\Adapter\Link; +use Mollie\Adapter\Context; use Mollie\Repository\MolCustomerRepository; use Mollie\Repository\PaymentMethodRepository; use Mollie\Subscription\Constants\IntervalConstant; @@ -13,6 +13,7 @@ use Mollie\Subscription\DTO\Object\Amount; use Mollie\Subscription\DTO\Object\Interval; use Mollie\Subscription\Factory\CreateSubscriptionDataFactory; +use Mollie\Subscription\Provider\SubscriptionCarrierDeliveryPriceProvider; use Mollie\Subscription\Provider\SubscriptionDescriptionProvider; use Mollie\Subscription\Provider\SubscriptionIntervalProvider; use Mollie\Subscription\Repository\CombinationRepository; @@ -58,6 +59,12 @@ public function testBuildSubscriptionData(string $customerId, float $totalAmount ] ); + $context = $this->createMock(Context::class); + $context->expects($this->once())->method('getModuleLink')->willReturn('example-link'); + + $subscriptionCarrierDeliveryPriceProvider = $this->createMock(SubscriptionCarrierDeliveryPriceProvider::class); + $subscriptionCarrierDeliveryPriceProvider->expects($this->once())->method('getPrice')->willReturn(10.00); + $subscriptionDataFactory = new CreateSubscriptionDataFactory( $customerRepositoryMock, $subscriptionIntervalProviderMock, @@ -65,8 +72,9 @@ public function testBuildSubscriptionData(string $customerId, float $totalAmount $currencyAdapterMock, new CombinationRepository(), $paymentMethodRepositoryMock, - new Link(), - new Mollie() + new Mollie(), + $context, + $subscriptionCarrierDeliveryPriceProvider ); $customerMock = $this->createMock('Customer'); @@ -95,7 +103,7 @@ public function subscriptionDataProvider() { $subscriptionDto = new SubscriptionDataDTO( 'testCustomerId', - new Amount(19.99, 'EUR'), + new Amount(29.99, 'EUR'), new Interval(1, IntervalConstant::DAY), 'subscription-' . self::TEST_ORDER_REFERENCE ); @@ -113,16 +121,12 @@ public function subscriptionDataProvider() ] ); - $link = new Link(); - $subscriptionDto->setWebhookUrl($link->getModuleLink( - 'mollie', - 'subscriptionWebhook' - )); + $subscriptionDto->setWebhookUrl('example-link'); return [ 'first example' => [ 'customer id' => 'testCustomerId', - 'total paid amount' => 19.99, + 'total paid amount' => 29.99, 'description' => 'subscription-' . self::TEST_ORDER_REFERENCE, 'expected result' => $subscriptionDto, ], From c4980eebf4c2aa8e61cdff2283b28690b9cb3874 Mon Sep 17 00:00:00 2001 From: jevgenijvisockij Date: Tue, 16 Jan 2024 16:33:07 +0200 Subject: [PATCH 07/15] PIPRES-328: Autoindex, license comments and ps_version checks (#844) * PIPRES-328: Autoindex, license comments and ps_version checks * csfixer * csfixer * removed autoindex and header-stamp from composer * missing ps_version checks * removed spacing between php opening tag and license comment # Conflicts: # tests/seed/settings/defines.inc.php # tests/seed/settings/parameters.php # tests/seed/settings8/defines.inc.php # tests/seed/settings8/parameters.php --- .htaccess | 15 + composer.json | 2 +- .../admin/AdminMollieAjaxController.php | 4 + .../admin/AdminMollieModuleController.php | 4 + .../admin/AdminMollieSettingsController.php | 14 + .../AdminMollieSubscriptionFAQController.php | 14 + ...nMollieSubscriptionFAQParentController.php | 14 + ...dminMollieSubscriptionOrdersController.php | 14 + ...llieSubscriptionOrdersParentController.php | 14 + .../admin/AdminMollieTabParentController.php | 4 + controllers/front/ajax.php | 4 + controllers/front/applePayDirectAjax.php | 4 + controllers/front/bancontactAjax.php | 4 + controllers/front/fail.php | 4 + controllers/front/payScreen.php | 4 + controllers/front/recurringOrderDetail.php | 30 +- controllers/front/return.php | 4 + controllers/front/subscriptions.php | 17 +- mollie.php | 7 +- src/Action/CreateOrderPaymentFeeAction.php | 14 + src/Action/UpdateOrderTotalsAction.php | 14 + src/Action/index.php | 20 ++ src/Adapter/API/CurlPSMollieHttpAdapter.php | 4 + src/Adapter/CartAdapter.php | 14 + src/Adapter/ConfigurationAdapter.php | 4 + src/Adapter/Context.php | 4 + src/Adapter/Customer.php | 4 + src/Adapter/Language.php | 4 + src/Adapter/LegacyContext.php | 4 + src/Adapter/Link.php | 4 + src/Adapter/ProductAttributeAdapter.php | 14 + src/Adapter/Shop.php | 4 + src/Adapter/Smarty.php | 14 + src/Adapter/ToolsAdapter.php | 4 + .../Command/CreateApplePayOrder.php | 4 + .../Command/RequestApplePayPaymentSession.php | 4 + .../Command/UpdateApplePayShippingContact.php | 4 + .../Command/UpdateApplePayShippingMethod.php | 4 + .../CreateApplePayOrderHandler.php | 4 + .../RequestApplePayPaymentSessionHandler.php | 4 + .../UpdateApplePayShippingContactHandler.php | 4 + .../UpdateApplePayShippingMethodHandler.php | 4 + src/Builder/ApiTestFeedbackBuilder.php | 4 + .../ApplePayCarriersBuilder.php | 6 +- .../ApplePayDirect/ApplePayOrderBuilder.php | 4 + .../ApplePayDirect/ApplePayProductBuilder.php | 4 + src/Builder/Content/BaseInfoBlock.php | 4 + src/Builder/Content/LogoInfoBlock.php | 4 + .../PaymentOption/IdealDropdownInfoBlock.php | 4 + .../Content/UpdateMessageInfoBlock.php | 4 + src/Builder/FormBuilder.php | 4 + src/Builder/InvoicePdfTemplateBuilder.php | 4 + src/Builder/TemplateBuilderInterface.php | 4 + src/Calculator/PaymentFeeCalculator.php | 14 + src/Calculator/index.php | 20 ++ .../ApplePayDirect/OrderTotalCollector.php | 5 +- ...nslationCsvFileGeneratorConsoleCommand.php | 4 + .../UpdateTranslationsConsoleCommand.php | 4 + ...dTranslationsFromCsvFileConsoleCommand.php | 4 + src/Config/Config.php | 4 + src/Config/Env.php | 4 + src/Controller/AbstractMollieController.php | 4 + src/Controller/AdminMollieEmailController.php | 4 + src/DTO/ApplePay/Carrier/Carrier.php | 4 + src/DTO/ApplePay/Order.php | 4 + src/DTO/ApplePay/Product.php | 4 + src/DTO/ApplePay/ShippingContent.php | 4 + src/DTO/CreateOrderPaymentFeeActionData.php | 26 +- src/DTO/Line.php | 4 + src/DTO/Object/Amount.php | 4 + src/DTO/Object/Company.php | 24 +- src/DTO/Object/Payment.php | 27 +- src/DTO/OrderData.php | 18 +- src/DTO/OrderStateData.php | 44 +-- src/DTO/PaymentData.php | 10 +- src/DTO/PaymentFeeData.php | 26 +- src/DTO/UpdateOrderTotalsData.php | 32 +- src/Entity/MolCarrierInformation.php | 4 + src/Entity/MolCustomer.php | 4 + src/Entity/MolOrderPaymentFee.php | 4 + src/Entity/MolPaymentMethod.php | 4 + src/Entity/MolPaymentMethodIssuer.php | 4 + src/Entity/MolPendingOrderCart.php | 3 + src/Entity/MolPendingOrderCartRule.php | 4 + src/Enum/EmailTemplate.php | 14 + src/Enum/PaymentTypeEnum.php | 4 + src/Errors/Error.php | 4 + src/Errors/Http/HttpStatusCode.php | 4 + src/Exception/CancelPendingOrderException.php | 4 + src/Exception/Code/ExceptionCode.php | 14 + src/Exception/Code/index.php | 20 ++ .../CouldNotCreateOrderPaymentFee.php | 14 + src/Exception/CouldNotInstallModule.php | 14 + src/Exception/CouldNotUpdateOrderTotals.php | 14 + .../FailedToProvidePaymentFeeException.php | 14 + src/Exception/MollieApiException.php | 4 + src/Exception/MollieException.php | 4 + src/Exception/NotImplementedException.php | 4 + src/Exception/OrderCreationException.php | 4 + src/Exception/RetryOverException.php | 4 + .../ShipmentCannotBeSentException.php | 4 + src/Exception/TransactionException.php | 4 + src/Factory/ContextFactory.php | 4 + src/Factory/CustomerFactory.php | 4 + src/Factory/ModuleFactory.php | 4 + .../Action/Type/SecondChanceRowAction.php | 4 + .../GridDefinitionModifierInterface.php | 6 +- .../Modifier/OrderGridDefinitionModifier.php | 4 + .../Modifier/GridQueryModifierInterface.php | 6 +- .../Query/Modifier/OrderGridQueryModifier.php | 4 + .../SecondChanceAccessibilityChecker.php | 4 + .../Api/OrderEndpointPaymentTypeHandler.php | 4 + ...derEndpointPaymentTypeHandlerInterface.php | 4 + .../CartRuleQuantityChangeHandler.php | 13 +- ...CartRuleQuantityChangeHandlerInterface.php | 5 +- .../CartRule/CartRuleQuantityResetHandler.php | 10 +- .../CartRuleQuantityResetHandlerInterface.php | 5 +- .../CertificateHandlerInterface.php | 4 + .../Exception/CertificationException.php | 4 + src/Handler/ErrorHandler/ErrorHandler.php | 4 + .../CouldNotHandleOrderPaymentFee.php | 14 + .../Exception/ExceptionHandlerInterface.php | 4 + src/Handler/Order/OrderCreationHandler.php | 9 +- src/Handler/Order/OrderPaymentFeeHandler.php | 4 + .../PaymentOption/PaymentOptionHandler.php | 16 +- .../PaymentOptionHandlerInterface.php | 6 +- src/Handler/RetryHandler.php | 4 + .../Settings/PaymentMethodPositionHandler.php | 4 + .../Shipment/ShipmentSenderHandler.php | 4 + src/Infrastructure/Adapter/Lock.php | 14 + src/Infrastructure/Adapter/index.php | 20 ++ .../Exception/CouldNotHandleLocking.php | 14 + src/Infrastructure/Exception/index.php | 20 ++ src/Infrastructure/Response/JsonResponse.php | 14 + src/Infrastructure/Response/Response.php | 14 + src/Infrastructure/Response/index.php | 20 ++ src/Infrastructure/index.php | 20 ++ src/Install/DatabaseTableInstaller.php | 4 + src/Install/Installer.php | 4 + src/Install/InstallerInterface.php | 4 + src/Install/OrderStateInstaller.php | 14 + src/Install/Uninstall.php | 4 + src/Install/UninstallerInterface.php | 4 + src/Logger/PrestaLoggerInterface.php | 14 + src/Presenter/OrderListActionBuilder.php | 4 + src/Provider/AbstractCustomLogoProvider.php | 4 + src/Provider/CreditCardLogoProvider.php | 4 + src/Provider/EnvironmentVersionProvider.php | 4 + .../OrderTotal/OrderTotalProvider.php | 6 +- src/Provider/PaymentFeeProvider.php | 4 + src/Provider/PaymentFeeProviderInterface.php | 4 + .../BancontactPaymentOptionProvider.php | 4 + .../BasePaymentOptionProvider.php | 4 + .../CreditCardPaymentOptionProvider.php | 4 + ...itCardSingleClickPaymentOptionProvider.php | 4 + .../IdealPaymentOptionProvider.php | 4 + .../PaymentOptionProviderInterface.php | 9 +- ...entTypeIdentificationProviderInterface.php | 4 + ...ularInterfacePaymentTypeIdentification.php | 4 + src/Provider/PhoneNumberProvider.php | 4 + src/Provider/PhoneNumberProviderInterface.php | 4 + src/Provider/ProfileIdProvider.php | 4 + src/Provider/ProfileIdProviderInterface.php | 4 + ...utomaticShipmentSenderStatusesProvider.php | 4 + src/Provider/TaxCalculatorProvider.php | 21 +- src/Repository/AbstractRepository.php | 8 +- src/Repository/AddressFormatRepository.php | 14 + .../AddressFormatRepositoryInterface.php | 14 + src/Repository/AddressRepository.php | 14 + src/Repository/AddressRepositoryInterface.php | 14 + src/Repository/AttributeRepository.php | 4 + src/Repository/CarrierRepository.php | 14 + src/Repository/CarrierRepositoryInterface.php | 14 + src/Repository/CartRepository.php | 14 + src/Repository/CartRepositoryInterface.php | 14 + src/Repository/CartRuleRepository.php | 4 + .../CartRuleRepositoryInterface.php | 4 + src/Repository/CountryRepository.php | 4 + src/Repository/CountryRepositoryInterface.php | 14 + src/Repository/CurrencyRepository.php | 4 + .../CurrencyRepositoryInterface.php | 4 + src/Repository/CustomerRepository.php | 14 + .../CustomerRepositoryInterface.php | 14 + src/Repository/GenderRepository.php | 4 + src/Repository/GenderRepositoryInterface.php | 4 + src/Repository/MethodCountryRepository.php | 4 + src/Repository/ModuleRepository.php | 4 + .../MolCarrierInformationRepository.php | 4 + src/Repository/MolCustomerRepository.php | 4 + .../MolOrderPaymentFeeRepository.php | 4 + .../MolOrderPaymentFeeRepositoryInterface.php | 14 + src/Repository/OrderCartRuleRepository.php | 4 + .../OrderCartRuleRepositoryInterface.php | 4 + src/Repository/OrderRepository.php | 4 + src/Repository/OrderRepositoryInterface.php | 4 + src/Repository/OrderShipmentRepository.php | 4 + src/Repository/OrderStateRepository.php | 4 + src/Repository/PaymentMethodRepository.php | 8 +- .../PaymentMethodRepositoryInterface.php | 4 + src/Repository/PendingOrderCartRepository.php | 4 + .../PendingOrderCartRuleRepository.php | 4 + ...endingOrderCartRuleRepositoryInterface.php | 8 +- src/Repository/ProductRepository.php | 14 + src/Repository/ProductRepositoryInterface.php | 14 + .../ReadOnlyRepositoryInterface.php | 4 + src/Repository/TaxRepository.php | 14 + src/Repository/TaxRepositoryInterface.php | 14 + src/Repository/TaxRuleRepository.php | 14 + src/Repository/TaxRuleRepositoryInterface.php | 14 + src/Repository/TaxRulesGroupRepository.php | 14 + .../TaxRulesGroupRepositoryInterface.php | 14 + src/Service/ApiKeyService.php | 4 + src/Service/ApiService.php | 11 +- src/Service/ApiServiceInterface.php | 9 +- src/Service/CancelService.php | 4 + src/Service/CarrierService.php | 4 + src/Service/CartLinesService.php | 14 +- src/Service/ConfigFieldService.php | 4 + src/Service/Content/SmartyTemplateParser.php | 6 +- .../Content/TemplateParserInterface.php | 6 +- src/Service/CountryService.php | 4 + src/Service/CustomerService.php | 4 + .../EntityManager/EntityManagerInterface.php | 6 +- .../EntityManager/ObjectModelManager.php | 6 +- src/Service/ErrorDisplayService.php | 4 + src/Service/ExceptionService.php | 4 + src/Service/IssuerService.php | 4 + src/Service/LanguageService.php | 4 + src/Service/MailService.php | 6 +- src/Service/MolCarrierInformationService.php | 4 + src/Service/MollieOrderCreationService.php | 8 +- src/Service/MollieOrderInfoService.php | 4 + src/Service/MolliePaymentMailService.php | 4 + src/Service/OrderPaymentFeeService.php | 4 + src/Service/OrderStateImageService.php | 4 + src/Service/OrderStatusService.php | 4 + .../PaymentMethodRestrictionValidation.php | 8 +- ...mountPaymentMethodRestrictionValidator.php | 4 + ...lePayPaymentMethodRestrictionValidator.php | 10 +- .../B2bPaymentMethodRestrictionValidator.php | 14 + .../BasePaymentMethodRestrictionValidator.php | 4 + ...cificPaymentMethodRestrictionValidator.php | 4 + ...entMethodRestrictionValidatorInterface.php | 12 +- ...ucherPaymentMethodRestrictionValidator.php | 4 + ...ntMethodRestrictionValidationInterface.php | 6 +- .../PaymentMethodSortProvider.php | 4 + .../PaymentMethodSortProviderInterface.php | 4 + src/Service/PaymentMethodService.php | 8 +- src/Service/PaymentReturnService.php | 4 + src/Service/PaymentsTranslationService.php | 4 + src/Service/RefundService.php | 4 + src/Service/RepeatOrderLinkFactory.php | 4 + src/Service/SettingsSaveService.php | 4 + src/Service/ShipService.php | 4 + .../Shipment/ShipmentInformationSender.php | 9 +- .../ShipmentInformationSenderInterface.php | 4 + src/Service/ShipmentService.php | 4 + src/Service/ShipmentServiceInterface.php | 4 + src/Service/TransactionService.php | 4 + src/Service/UpgradeNoticeService.php | 4 + src/Service/VoucherService.php | 4 + src/ServiceProvider/BaseServiceProvider.php | 14 + .../LeagueServiceContainerProvider.php | 14 + src/ServiceProvider/PrestashopContainer.php | 14 + .../ServiceContainerProviderInterface.php | 17 +- src/ServiceProvider/index.php | 20 ++ src/Tracker/Segment.php | 4 + src/Tracker/TrackerInterface.php | 4 + .../ApplePayDirect/ShippingMethodUtility.php | 5 +- src/Utility/ArrayUtility.php | 4 + src/Utility/AssortUtility.php | 4 + src/Utility/CalculationUtility.php | 4 + src/Utility/CartPriceUtility.php | 4 + src/Utility/ContextUtility.php | 4 + src/Utility/CustomLogoUtility.php | 4 + src/Utility/CustomerUtility.php | 4 + src/Utility/Decoder/DecoderInterface.php | 4 + src/Utility/Decoder/JsonDecoder.php | 4 + src/Utility/EnvironmentUtility.php | 4 + src/Utility/FileUtility.php | 4 + src/Utility/HashUtility.php | 4 + src/Utility/ImageUtility.php | 4 + src/Utility/LocaleUtility.php | 4 + src/Utility/MenuLocationUtility.php | 4 + src/Utility/MollieStatusUtility.php | 4 + src/Utility/MultiLangUtility.php | 4 + src/Utility/NumberUtility.php | 6 +- src/Utility/OrderNumberUtility.php | 4 + src/Utility/OrderRecoverUtility.php | 4 + src/Utility/OrderStatusUtility.php | 4 + src/Utility/PaymentMethodUtility.php | 4 + src/Utility/PsVersionUtility.php | 4 + src/Utility/RefundUtility.php | 4 + src/Utility/SecureKeyUtility.php | 4 + src/Utility/TagsUtility.php | 4 + src/Utility/TextFormatUtility.php | 4 + src/Utility/TextGeneratorUtility.php | 4 + src/Utility/TimeUtility.php | 4 + src/Utility/TransactionUtility.php | 4 + src/Utility/UrlPathUtility.php | 4 + src/Validator/MailValidatorInterface.php | 4 + src/Validator/OrderCallBackValidator.php | 4 + src/Validator/OrderConfMailValidator.php | 4 + src/Validator/VoucherValidator.php | 4 + .../IsPaymentInformationAvailable.php | 14 + .../PaymentType/CanBeRegularPaymentType.php | 4 + .../PaymentTypeVerificationInterface.php | 4 + src/Verification/Shipment/CanSendShipment.php | 27 +- .../ShipmentVerificationInterface.php | 7 +- .../Action/CreateSpecificPriceAction.php | 14 + subscription/Action/index.php | 20 ++ subscription/Api/MandateApi.php | 14 + subscription/Api/MethodApi.php | 14 + subscription/Api/PaymentApi.php | 14 + subscription/Api/SubscriptionApi.php | 14 + subscription/Api/index.php | 20 ++ subscription/Config/Config.php | 14 + subscription/Config/index.php | 20 ++ subscription/Constants/IntervalConstant.php | 14 + .../SubscriptionAvailableMethodConstant.php | 14 + subscription/Constants/index.php | 20 ++ .../Controller/AbstractAdminController.php | 14 + .../Symfony/AbstractSymfonyController.php | 14 + .../Symfony/SubscriptionController.php | 28 +- .../Symfony/SubscriptionFAQController.php | 14 + subscription/Controller/Symfony/index.php | 20 ++ subscription/Controller/index.php | 20 ++ subscription/DTO/CancelSubscriptionData.php | 18 +- subscription/DTO/CreateFreeOrderData.php | 14 + subscription/DTO/CreateMandateData.php | 14 + subscription/DTO/CreateSpecificPriceData.php | 35 +-- subscription/DTO/CreateSubscriptionData.php | 14 + subscription/DTO/GetSubscriptionData.php | 18 +- subscription/DTO/Object/Amount.php | 18 +- subscription/DTO/Object/Interval.php | 18 +- subscription/DTO/Object/index.php | 20 ++ subscription/DTO/UpdateSubscriptionData.php | 18 +- subscription/DTO/index.php | 20 ++ subscription/Entity/MolRecurringOrder.php | 13 + .../Entity/MolRecurringOrdersProduct.php | 13 + subscription/Entity/index.php | 20 ++ .../CouldNotHandleRecurringOrder.php | 14 + .../Exception/CouldNotPresentOrderDetail.php | 14 + ...rovideSubscriptionCarrierDeliveryPrice.php | 14 + subscription/Exception/ExceptionCode.php | 14 + .../MollieModuleNotFoundException.php | 14 + .../Exception/MollieSubscriptionException.php | 14 + .../Exception/NotImplementedException.php | 14 + .../Exception/SubscriptionApiException.php | 14 + .../SubscriptionIntervalException.php | 14 + ...SubscriptionProductValidationException.php | 14 + subscription/Exception/index.php | 20 ++ .../Factory/CancelSubscriptionDataFactory.php | 14 + .../Factory/CreateFreeOrderDataFactory.php | 14 + .../Factory/CreateMandateDataFactory.php | 14 + .../Factory/CreateSubscriptionDataFactory.php | 14 + .../Factory/GetSubscriptionDataFactory.php | 14 + subscription/Factory/MollieApiFactory.php | 14 + .../Factory/UpdateSubscriptionDataFactory.php | 14 + subscription/Factory/index.php | 20 ++ subscription/Filters/SubscriptionFilters.php | 14 + subscription/Filters/index.php | 20 ++ .../ChoiceProvider/CarrierOptionsProvider.php | 14 + subscription/Form/ChoiceProvider/index.php | 20 ++ .../SubscriptionOptionsConfiguration.php | 17 +- .../SubscriptionOptionsDataProvider.php | 14 + .../Form/Options/SubscriptionOptionsType.php | 14 + subscription/Form/Options/index.php | 20 ++ subscription/Form/index.php | 20 ++ .../SubscriptionCancelAccessibility.php | 14 + subscription/Grid/Accessibility/index.php | 20 ++ .../SubscriptionGridDefinitionFactory.php | 14 + .../Grid/SubscriptionGridQueryBuilder.php | 30 +- subscription/Grid/index.php | 20 ++ .../Handler/CustomerAddressUpdateHandler.php | 18 +- .../Handler/FreeOrderCreationHandler.php | 14 + .../Handler/RecurringOrderHandler.php | 14 + .../SubscriptionCancellationHandler.php | 14 + .../Handler/SubscriptionCreationHandler.php | 14 + ...SubscriptionPaymentMethodUpdateHandler.php | 14 + subscription/Handler/index.php | 20 ++ subscription/Install/AbstractInstaller.php | 14 + subscription/Install/AbstractUninstaller.php | 14 + subscription/Install/AttributeInstaller.php | 19 +- subscription/Install/AttributeUninstaller.php | 14 + .../Install/DatabaseTableInstaller.php | 17 +- .../Install/DatabaseTableUninstaller.php | 14 + subscription/Install/HookInstaller.php | 14 + subscription/Install/Installer.php | 14 + subscription/Install/InstallerInterface.php | 14 + subscription/Install/Uninstaller.php | 14 + subscription/Install/UninstallerInterface.php | 14 + subscription/Install/index.php | 20 ++ subscription/Logger/Logger.php | 14 + subscription/Logger/LoggerInterface.php | 14 + subscription/Logger/NullLogger.php | 14 + subscription/Logger/index.php | 20 ++ .../Presenter/OrderDetailPresenter.php | 14 + .../Presenter/RecurringOrderPresenter.php | 14 + .../Presenter/RecurringOrdersPresenter.php | 14 + subscription/Presenter/index.php | 20 ++ .../Provider/MollieModuleServiceProvider.php | 14 + ...bscriptionCarrierDeliveryPriceProvider.php | 14 + .../SubscriptionDescriptionProvider.php | 14 + .../Provider/SubscriptionIntervalProvider.php | 14 + subscription/Provider/index.php | 20 ++ .../Repository/AbstractRepository.php | 18 +- .../Repository/CombinationRepository.php | 14 + .../Repository/CurrencyRepository.php | 14 + .../Repository/LanguageRepository.php | 20 +- .../Repository/OrderDetailRepository.php | 14 + .../OrderDetailRepositoryInterface.php | 14 + .../ProductCombinationRepository.php | 14 + .../Repository/RecurringOrderRepository.php | 14 + .../RecurringOrderRepositoryInterface.php | 14 + .../RecurringOrdersProductRepository.php | 14 + ...urringOrdersProductRepositoryInterface.php | 14 + .../Repository/SpecificPriceRepository.php | 14 + .../SpecificPriceRepositoryInterface.php | 14 + subscription/Repository/index.php | 20 ++ subscription/Utility/Clock.php | 14 + subscription/Utility/ClockInterface.php | 14 + subscription/Utility/index.php | 20 ++ .../CanProductBeAddedToCartValidator.php | 22 +- .../Validator/SubscriptionOrderValidator.php | 14 + .../SubscriptionProductValidator.php | 14 + subscription/Validator/index.php | 20 ++ .../HasSubscriptionProductInCart.php | 14 + subscription/Verification/index.php | 20 ++ subscription/index.php | 20 ++ ...questApplePayPaymentSessionHandlerTest.php | 10 + tests/Integration/Factory/AddressFactory.php | 10 + tests/Integration/Factory/CarrierFactory.php | 10 + tests/Integration/Factory/CartFactory.php | 10 + tests/Integration/Factory/CustomerFactory.php | 10 + .../Integration/Factory/FactoryInterface.php | 10 + tests/Integration/Factory/ProductFactory.php | 10 + tests/Integration/Factory/index.php | 20 ++ .../Infrastructure/Adapter/LockTest.php | 10 + .../Infrastructure/Adapter/index.php | 20 ++ tests/Integration/Infrastructure/index.php | 20 ++ .../Install/OrderStateInstallerTest.php | 10 + tests/Integration/Install/index.php | 20 ++ ...bPaymentMethodRestrictionValidatorTest.php | 10 + .../index.php | 20 ++ .../Service/PaymentMethod/index.php | 20 ++ tests/Integration/Service/index.php | 20 ++ .../Action/CreateSpecificPriceActionTest.php | 10 + .../Integration/Subscription/Action/index.php | 20 ++ .../Factory/TestCreateMandateData.php | 10 + .../Factory/TestCreateSubscriptionData.php | 10 + .../Subscription/Factory/index.php | 20 ++ ...iptionCarrierDeliveryPriceProviderTest.php | 10 + .../Subscription/Provider/index.php | 20 ++ tests/Integration/Subscription/Tool/index.php | 11 +- .../CanProductBeAddedToCartValidatorTest.php | 12 +- .../SubscriptionOrderValidatorTest.php | 12 +- .../SubscriptionProductValidatorTest.php | 10 + .../Subscription/Validator/index.php | 20 ++ tests/Integration/Subscription/index.php | 20 ++ .../CreateOrderPaymentFeeActionTest.php | 10 + .../Action/UpdateOrderTotalsActionTest.php | 10 + tests/Integration/src/Action/index.php | 20 ++ tests/Integration/src/index.php | 20 ++ .../Tests/Unit/Utility/NumberUtilityTest.php | 10 + tests/Mollie/Tests/Unit/Utility/index.php | 20 ++ tests/Mollie/Tests/Unit/index.php | 20 ++ tests/Mollie/Tests/index.php | 20 ++ tests/Mollie/index.php | 20 ++ .../Builder/InvoicePdfTemplateBuilderTest.php | 10 + .../Calculator/PaymentFeeCalculatorTest.php | 10 + tests/Unit/Calculator/index.php | 20 ++ .../OrderTotalCollectorTest.php | 10 + tests/Unit/Factory/SubscriptionDataTest.php | 10 + tests/Unit/Factory/index.php | 20 ++ .../OrderEndpointPaymentTypeHandlerTest.php | 10 + .../Order/OrderPaymentFeeHandlerTest.php | 10 + tests/Unit/Handler/Order/index.php | 20 ++ tests/Unit/Handler/RetryHandlerTest.php | 10 + .../Shipment/ShipmentSenderHandlerTest.php | 10 + .../Unit/Provider/PaymentFeeProviderTest.php | 10 + .../Provider/SubscriptionDescriptionTest.php | 10 + .../Provider/SubscriptionIntervalTest.php | 10 + .../Provider/TaxCalculatorProviderTest.php | 10 + ...AmountPaymentRestrictionValidationTest.php | 10 + ...plePayPaymentRestrictionValidationTest.php | 10 + ...ecificPaymentRestrictionValidationTest.php | 10 + .../PaymentMethodSortProviderTest.php | 10 + .../Unit/Service/UpgradeNoticeServiceTest.php | 10 + tests/Unit/Service/index.php | 36 +-- .../Presenter/OrderDetailPresenterTest.php | 10 + tests/Unit/Subscription/Presenter/index.php | 20 ++ tests/Unit/Subscription/index.php | 20 ++ .../ShippingMethodUtilityTest.php | 10 + tests/Unit/Utility/CalculationUtilityTest.php | 10 + .../OrderConfirmationMailValidatorTest.php | 10 + .../CanBeRegularPaymentTypeTest.php | 10 + .../Shipment/CanSendShipmentTest.php | 10 + tests/Unit/bootstrap.php | 11 +- tests/Unit/index.php | 36 +-- tests/bootstrap.php | 11 +- tests/index.php | 36 +-- tests/phpstan/index.php | 36 +-- tests/seed/settings/defines.inc.php | 218 +++++++++++++ tests/seed/settings/parameters.php | 0 tests/seed/settings1785/defines.inc.php | 26 +- tests/seed/settings1785/parameters.php | 10 + tests/seed/settings8/defines.inc.php | 0 tests/seed/settings8/parameters.php | 0 translations/de.php | 10 + translations/en.php | 10 + translations/fr.php | 10 + translations/nl.php | 10 + upgrade/Upgrade-6.0.2.php | 1 - upgrade/Upgrade-6.0.4.php | 1 - .../Grid/Actions/Row/second_chance.html.twig | 10 + views/assets/compiled/index.php | 20 ++ views/assets/compiled/subscription.bundle.js | 286 ++++-------------- views/assets/index.php | 20 ++ views/assets/js/index.php | 20 ++ views/assets/js/subscription.js | 10 + views/css/admin/menu.css | 10 - views/css/admin/order-list.css | 10 - views/css/front.css | 10 - views/css/front/bancontact_qr_code.css | 10 + .../subscription/customer_order_detail.css | 10 + views/css/front/subscription/index.php | 20 ++ views/js/admin/api_key_test.js | 11 +- .../js/admin/commands/translation_commands.js | 11 +- views/js/admin/custom_logo.js | 11 +- views/js/admin/init_mollie_account.js | 11 +- views/js/admin/order_add.js | 11 +- views/js/admin/order_list.js | 10 - views/js/admin/payment_methods.js | 10 - views/js/admin/settings.js | 11 +- views/js/admin/upgrade_notice.js | 10 - views/js/apple_payment.js | 11 +- .../applePayDirect/applePayDirectCart.js | 11 - .../applePayDirect/applePayDirectProduct.js | 10 - views/js/front/bancontact/qr_code.js | 10 - views/js/front/mollie_error_handle.js | 11 +- views/js/front/mollie_iframe.js | 10 - views/js/front/mollie_single_click.js | 10 - views/js/front/payment_fee.js | 11 +- views/js/front/subscription/index.php | 20 ++ views/js/front/subscription/product.js | 10 + views/js/method_countries.js | 10 - views/js/validation.js | 10 - views/templates/admin/Subscription/index.php | 20 ++ .../Subscription/subscriptions-faq.html.twig | 26 +- .../Subscription/subscriptions-grid.html.twig | 28 +- .../subscriptions-settings.html.twig | 30 +- .../admin/_configure/helpers/form/form.tpl | 16 +- views/templates/admin/api_test_results.tpl | 16 +- .../admin/applePayDirectDocumentation.tpl | 16 +- .../admin/create_new_account_link.tpl | 16 +- views/templates/admin/email_checkbox.tpl | 16 +- views/templates/admin/invoice_description.tpl | 16 +- views/templates/admin/invoice_fee.tpl | 16 +- views/templates/admin/locale_wiki.tpl | 16 +- views/templates/admin/logo.tpl | 16 +- views/templates/admin/manifest.php.tpl | 9 +- .../admin/mollie_bancontact_qr_code_info.tpl | 16 +- .../admin/mollie_components_info.tpl | 16 +- views/templates/admin/mollie_method_info.tpl | 16 +- .../mollie_single_click_payment_info.tpl | 16 +- views/templates/admin/new_release.tpl | 16 +- .../admin/order_total_refresh_results.tpl | 16 +- views/templates/admin/ordergrid.tpl | 16 +- views/templates/admin/profile.tpl | 16 +- views/templates/admin/updateMessage.tpl | 16 +- views/templates/admin/view_logs.tpl | 16 +- views/templates/front/17_error.tpl | 16 +- views/templates/front/17_mollie_return.tpl | 16 +- views/templates/front/17_mollie_wait.tpl | 16 +- views/templates/front/apple_pay_direct.tpl | 16 +- views/templates/front/break.tpl | 16 +- views/templates/front/break_point.tpl | 16 +- views/templates/front/cart_rules_list.tpl | 16 +- views/templates/front/classname.tpl | 16 +- views/templates/front/custom_css.tpl | 16 +- views/templates/front/error.tpl | 16 +- views/templates/front/kbd.tpl | 16 +- views/templates/front/mollie_error.tpl | 16 +- views/templates/front/mollie_return.tpl | 16 +- views/templates/front/mollie_wait.tpl | 16 +- views/templates/front/name_block.tpl | 16 +- .../front/order-confirmation-table.tpl | 2 +- views/templates/front/order_fail.tpl | 16 +- views/templates/front/order_success.tpl | 16 +- views/templates/front/product.tpl | 16 +- views/templates/front/qr_done.tpl | 16 +- views/templates/front/strong.tpl | 16 +- .../front/subscription/customerAccount.tpl | 20 +- .../customerRecurringOrderDetail.tpl | 26 +- .../customerRecurringOrderDetailProduct.tpl | 10 + .../customerSubscriptionsData.tpl | 20 +- views/templates/front/subscription/index.php | 20 ++ .../templates/hook/admin/order-list-icon.tpl | 16 +- views/templates/hook/cancel.tpl | 16 +- views/templates/hook/error_message.tpl | 16 +- views/templates/hook/ideal_dropdown.tpl | 16 +- views/templates/hook/init_urls.tpl | 16 +- .../mollie_awaiting_order_status_error.tpl | 16 +- views/templates/hook/mollie_iframe.tpl | 16 +- views/templates/hook/mollie_iframe_js.tpl | 16 +- views/templates/hook/mollie_single_click.tpl | 16 +- views/templates/hook/ok.tpl | 16 +- views/templates/hook/order_info.tpl | 10 + views/templates/hook/payment.tpl | 16 +- views/templates/hook/qr_code.tpl | 16 +- 611 files changed, 5836 insertions(+), 1457 deletions(-) create mode 100644 .htaccess create mode 100644 src/Action/index.php create mode 100644 src/Calculator/index.php create mode 100644 src/Exception/Code/index.php create mode 100644 src/Infrastructure/Adapter/index.php create mode 100644 src/Infrastructure/Exception/index.php create mode 100644 src/Infrastructure/Response/index.php create mode 100644 src/Infrastructure/index.php create mode 100644 src/ServiceProvider/index.php create mode 100644 subscription/Action/index.php create mode 100644 subscription/Api/index.php create mode 100644 subscription/Config/index.php create mode 100644 subscription/Constants/index.php create mode 100644 subscription/Controller/Symfony/index.php create mode 100644 subscription/Controller/index.php create mode 100644 subscription/DTO/Object/index.php create mode 100644 subscription/DTO/index.php create mode 100644 subscription/Entity/index.php create mode 100644 subscription/Exception/index.php create mode 100644 subscription/Factory/index.php create mode 100644 subscription/Filters/index.php create mode 100644 subscription/Form/ChoiceProvider/index.php create mode 100644 subscription/Form/Options/index.php create mode 100644 subscription/Form/index.php create mode 100644 subscription/Grid/Accessibility/index.php create mode 100644 subscription/Grid/index.php create mode 100644 subscription/Handler/index.php create mode 100644 subscription/Install/index.php create mode 100644 subscription/Logger/index.php create mode 100644 subscription/Presenter/index.php create mode 100644 subscription/Provider/index.php create mode 100644 subscription/Repository/index.php create mode 100644 subscription/Utility/index.php create mode 100644 subscription/Validator/index.php create mode 100644 subscription/Verification/index.php create mode 100644 subscription/index.php create mode 100644 tests/Integration/Factory/index.php create mode 100644 tests/Integration/Infrastructure/Adapter/index.php create mode 100644 tests/Integration/Infrastructure/index.php create mode 100644 tests/Integration/Install/index.php create mode 100644 tests/Integration/Service/PaymentMethod/PaymentMethodRestrictionValidation/index.php create mode 100644 tests/Integration/Service/PaymentMethod/index.php create mode 100644 tests/Integration/Service/index.php create mode 100644 tests/Integration/Subscription/Action/index.php create mode 100644 tests/Integration/Subscription/Factory/index.php create mode 100644 tests/Integration/Subscription/Provider/index.php create mode 100644 tests/Integration/Subscription/Validator/index.php create mode 100644 tests/Integration/Subscription/index.php create mode 100644 tests/Integration/src/Action/index.php create mode 100644 tests/Integration/src/index.php create mode 100644 tests/Mollie/Tests/Unit/Utility/index.php create mode 100644 tests/Mollie/Tests/Unit/index.php create mode 100644 tests/Mollie/Tests/index.php create mode 100644 tests/Mollie/index.php create mode 100644 tests/Unit/Calculator/index.php create mode 100644 tests/Unit/Factory/index.php create mode 100644 tests/Unit/Handler/Order/index.php create mode 100644 tests/Unit/Subscription/Presenter/index.php create mode 100644 tests/Unit/Subscription/index.php create mode 100644 tests/seed/settings/defines.inc.php create mode 100644 tests/seed/settings/parameters.php create mode 100755 tests/seed/settings8/defines.inc.php create mode 100755 tests/seed/settings8/parameters.php create mode 100644 views/assets/compiled/index.php create mode 100644 views/assets/index.php create mode 100644 views/assets/js/index.php create mode 100644 views/css/front/subscription/index.php create mode 100644 views/js/front/subscription/index.php create mode 100644 views/templates/admin/Subscription/index.php create mode 100644 views/templates/front/subscription/index.php diff --git a/.htaccess b/.htaccess new file mode 100644 index 000000000..db12ecd28 --- /dev/null +++ b/.htaccess @@ -0,0 +1,15 @@ +# Apache 2.2 + + Order deny,allow + Deny from all + + Allow from all + + +# Apache 2.4 + + Require all denied + + Require all granted + + diff --git a/composer.json b/composer.json index 8d7b53375..cb2569150 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ }, "config": { "platform": { - "php": "7.2" + "php": "7.2" }, "prepend-autoloader": false, "allow-plugins": { diff --git a/controllers/admin/AdminMollieAjaxController.php b/controllers/admin/AdminMollieAjaxController.php index 7c806eab6..b6f75b3da 100644 --- a/controllers/admin/AdminMollieAjaxController.php +++ b/controllers/admin/AdminMollieAjaxController.php @@ -20,6 +20,10 @@ use Mollie\Utility\NumberUtility; use Mollie\Utility\TimeUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class AdminMollieAjaxController extends ModuleAdminController { /** @var Mollie */ diff --git a/controllers/admin/AdminMollieModuleController.php b/controllers/admin/AdminMollieModuleController.php index 13164c3cb..681ad1625 100644 --- a/controllers/admin/AdminMollieModuleController.php +++ b/controllers/admin/AdminMollieModuleController.php @@ -9,6 +9,10 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ +if (!defined('_PS_VERSION_')) { + exit; +} + class AdminMollieModuleController extends ModuleAdminController { public function init() diff --git a/controllers/admin/AdminMollieSettingsController.php b/controllers/admin/AdminMollieSettingsController.php index d1c08af60..b9cf243af 100644 --- a/controllers/admin/AdminMollieSettingsController.php +++ b/controllers/admin/AdminMollieSettingsController.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); +if (!defined('_PS_VERSION_')) { + exit; +} + class AdminMollieSettingsController extends ModuleAdminController { /** @var Mollie */ diff --git a/controllers/admin/AdminMollieSubscriptionFAQController.php b/controllers/admin/AdminMollieSubscriptionFAQController.php index 3e66232b7..316495ebd 100644 --- a/controllers/admin/AdminMollieSubscriptionFAQController.php +++ b/controllers/admin/AdminMollieSubscriptionFAQController.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); use Mollie\Subscription\Controller\AbstractAdminController; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * This controller is only used to create tab and redirect to SubscriptionFAQController */ diff --git a/controllers/admin/AdminMollieSubscriptionFAQParentController.php b/controllers/admin/AdminMollieSubscriptionFAQParentController.php index 14cb46718..f211fdf2e 100644 --- a/controllers/admin/AdminMollieSubscriptionFAQParentController.php +++ b/controllers/admin/AdminMollieSubscriptionFAQParentController.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); +if (!defined('_PS_VERSION_')) { + exit; +} + /** * This controller is only used to create tab in dashboard for subscription FAQ controller */ diff --git a/controllers/admin/AdminMollieSubscriptionOrdersController.php b/controllers/admin/AdminMollieSubscriptionOrdersController.php index 925dab557..289673cec 100644 --- a/controllers/admin/AdminMollieSubscriptionOrdersController.php +++ b/controllers/admin/AdminMollieSubscriptionOrdersController.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); use Mollie\Subscription\Controller\AbstractAdminController; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * This controller is only used to create tab and redirect to SubscriptionController */ diff --git a/controllers/admin/AdminMollieSubscriptionOrdersParentController.php b/controllers/admin/AdminMollieSubscriptionOrdersParentController.php index 1789a4cb2..277d3ef46 100644 --- a/controllers/admin/AdminMollieSubscriptionOrdersParentController.php +++ b/controllers/admin/AdminMollieSubscriptionOrdersParentController.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); use Mollie\Subscription\Controller\AbstractAdminController; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * This controller is only used to create tab in dashboard for subscription order controller */ diff --git a/controllers/admin/AdminMollieTabParentController.php b/controllers/admin/AdminMollieTabParentController.php index 3177e4cae..43bff5237 100644 --- a/controllers/admin/AdminMollieTabParentController.php +++ b/controllers/admin/AdminMollieTabParentController.php @@ -9,6 +9,10 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ +if (!defined('_PS_VERSION_')) { + exit; +} + class AdminMollieTabParentController extends ModuleAdminController { public function init() diff --git a/controllers/front/ajax.php b/controllers/front/ajax.php index 42a85cd38..1df5a79fd 100644 --- a/controllers/front/ajax.php +++ b/controllers/front/ajax.php @@ -20,6 +20,10 @@ use Mollie\Subscription\Validator\CanProductBeAddedToCartValidator; use Mollie\Utility\NumberUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieAjaxModuleFrontController extends AbstractMollieController { private const FILE_NAME = 'ajax'; diff --git a/controllers/front/applePayDirectAjax.php b/controllers/front/applePayDirectAjax.php index 49c081f44..d561f469a 100644 --- a/controllers/front/applePayDirectAjax.php +++ b/controllers/front/applePayDirectAjax.php @@ -22,6 +22,10 @@ use Mollie\Builder\ApplePayDirect\ApplePayProductBuilder; use Mollie\Utility\OrderRecoverUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieApplePayDirectAjaxModuleFrontController extends ModuleFrontController { /** @var Mollie */ diff --git a/controllers/front/bancontactAjax.php b/controllers/front/bancontactAjax.php index 1b43d1ecb..352c761a8 100644 --- a/controllers/front/bancontactAjax.php +++ b/controllers/front/bancontactAjax.php @@ -20,6 +20,10 @@ use Mollie\Utility\OrderNumberUtility; use Mollie\Utility\OrderRecoverUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieBancontactAjaxModuleFrontController extends ModuleFrontController { /** @var Mollie */ diff --git a/controllers/front/fail.php b/controllers/front/fail.php index 2798300bf..291bfd6d5 100644 --- a/controllers/front/fail.php +++ b/controllers/front/fail.php @@ -12,6 +12,10 @@ use PrestaShop\PrestaShop\Adapter\Order\OrderPresenter; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieFailModuleFrontController extends ModuleFrontController { /** diff --git a/controllers/front/payScreen.php b/controllers/front/payScreen.php index cde3c9c69..ec651118c 100644 --- a/controllers/front/payScreen.php +++ b/controllers/front/payScreen.php @@ -13,6 +13,10 @@ use Mollie\Api\Types\PaymentMethod; use Mollie\Provider\ProfileIdProviderInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class MolliePayScreenModuleFrontController extends ModuleFrontController { /** @var Mollie */ diff --git a/controllers/front/recurringOrderDetail.php b/controllers/front/recurringOrderDetail.php index 300f83372..41fcb8dbf 100644 --- a/controllers/front/recurringOrderDetail.php +++ b/controllers/front/recurringOrderDetail.php @@ -1,27 +1,13 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */ use Mollie\Controller\AbstractMollieController; @@ -31,6 +17,10 @@ use Mollie\Subscription\Presenter\RecurringOrderPresenter; use Mollie\Subscription\Repository\RecurringOrderRepositoryInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieRecurringOrderDetailModuleFrontController extends AbstractMollieController { private const FILE_NAME = 'recurringOrderDetail'; diff --git a/controllers/front/return.php b/controllers/front/return.php index 3d8fcc59b..0fb44e7f6 100644 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -27,6 +27,10 @@ require_once dirname(__FILE__) . '/../../mollie.php'; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieReturnModuleFrontController extends AbstractMollieController { /** @var Mollie */ diff --git a/controllers/front/subscriptions.php b/controllers/front/subscriptions.php index b0a9d81b2..3776aa0fe 100644 --- a/controllers/front/subscriptions.php +++ b/controllers/front/subscriptions.php @@ -1,9 +1,19 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Repository\MolCustomerRepository; use Mollie\Subscription\Presenter\RecurringOrdersPresenter; -/** +/* * 2007-2020 PrestaShop and Contributors * * NOTICE OF LICENSE @@ -21,6 +31,11 @@ * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) * International Registered Trademark & Property of PrestaShop SA */ + +if (!defined('_PS_VERSION_')) { + exit; +} + class mollieSubscriptionsModuleFrontController extends ModuleFrontController { /** diff --git a/mollie.php b/mollie.php index 6970d8a77..a066307bb 100755 --- a/mollie.php +++ b/mollie.php @@ -45,6 +45,10 @@ require_once __DIR__ . '/vendor/autoload.php'; +if (!defined('_PS_VERSION_')) { + exit; +} + class Mollie extends PaymentModule { const DISABLE_CACHE = true; @@ -100,7 +104,6 @@ public function __construct() /** * Gets service that is defined by module container. * - * @param string $serviceName * @returns mixed */ public function getService(string $serviceName) @@ -605,8 +608,6 @@ public function displayAjaxMollieOrderInfo() /** * actionOrderStatusUpdate hook. * - * @param array $params - * * @throws PrestaShopDatabaseException * @throws PrestaShopException * diff --git a/src/Action/CreateOrderPaymentFeeAction.php b/src/Action/CreateOrderPaymentFeeAction.php index 50f1fb3fb..38fadfa92 100644 --- a/src/Action/CreateOrderPaymentFeeAction.php +++ b/src/Action/CreateOrderPaymentFeeAction.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Action; @@ -7,6 +17,10 @@ use Mollie\Exception\CouldNotCreateOrderPaymentFee; use MolOrderPaymentFee; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateOrderPaymentFeeAction { /** diff --git a/src/Action/UpdateOrderTotalsAction.php b/src/Action/UpdateOrderTotalsAction.php index f8bf8eb52..dd7ace8ad 100644 --- a/src/Action/UpdateOrderTotalsAction.php +++ b/src/Action/UpdateOrderTotalsAction.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Action; @@ -9,6 +19,10 @@ use Mollie\Utility\NumberUtility; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class UpdateOrderTotalsAction { /** @var OrderRepositoryInterface */ diff --git a/src/Action/index.php b/src/Action/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/src/Action/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Adapter/API/CurlPSMollieHttpAdapter.php b/src/Adapter/API/CurlPSMollieHttpAdapter.php index 53aae65c3..22dd90118 100644 --- a/src/Adapter/API/CurlPSMollieHttpAdapter.php +++ b/src/Adapter/API/CurlPSMollieHttpAdapter.php @@ -18,6 +18,10 @@ use Mollie\Api\HttpAdapter\MollieHttpAdapterInterface; use Mollie\Api\MollieApiClient; +if (!defined('_PS_VERSION_')) { + exit; +} + final class CurlPSMollieHttpAdapter implements MollieHttpAdapterInterface { /** diff --git a/src/Adapter/CartAdapter.php b/src/Adapter/CartAdapter.php index 3ff5c21da..8911e3483 100644 --- a/src/Adapter/CartAdapter.php +++ b/src/Adapter/CartAdapter.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use Cart; use Context; +if (!defined('_PS_VERSION_')) { + exit; +} + class CartAdapter { public function getCart(): Cart diff --git a/src/Adapter/ConfigurationAdapter.php b/src/Adapter/ConfigurationAdapter.php index ecee7e379..73cd185a7 100644 --- a/src/Adapter/ConfigurationAdapter.php +++ b/src/Adapter/ConfigurationAdapter.php @@ -14,6 +14,10 @@ use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class ConfigurationAdapter { /** @var Context */ diff --git a/src/Adapter/Context.php b/src/Adapter/Context.php index 5aec66c47..a83249315 100644 --- a/src/Adapter/Context.php +++ b/src/Adapter/Context.php @@ -15,6 +15,10 @@ use Configuration as PrestashopConfiguration; use Context as PrestashopContext; +if (!defined('_PS_VERSION_')) { + exit; +} + class Context { public function getLanguageId(): int diff --git a/src/Adapter/Customer.php b/src/Adapter/Customer.php index 29a237389..d7d9f2061 100644 --- a/src/Adapter/Customer.php +++ b/src/Adapter/Customer.php @@ -12,6 +12,10 @@ namespace Mollie\Adapter; +if (!defined('_PS_VERSION_')) { + exit; +} + class Customer { public function getCustomer(): \Customer diff --git a/src/Adapter/Language.php b/src/Adapter/Language.php index 97b9e1f89..269f86967 100644 --- a/src/Adapter/Language.php +++ b/src/Adapter/Language.php @@ -12,6 +12,10 @@ namespace Mollie\Adapter; +if (!defined('_PS_VERSION_')) { + exit; +} + class Language { public function getDefaultLanguageId(): int diff --git a/src/Adapter/LegacyContext.php b/src/Adapter/LegacyContext.php index 8c774c577..8d95e91fc 100644 --- a/src/Adapter/LegacyContext.php +++ b/src/Adapter/LegacyContext.php @@ -38,6 +38,10 @@ use Context; +if (!defined('_PS_VERSION_')) { + exit; +} + class LegacyContext { public function getContext() diff --git a/src/Adapter/Link.php b/src/Adapter/Link.php index c4c535712..ab8a83a07 100644 --- a/src/Adapter/Link.php +++ b/src/Adapter/Link.php @@ -14,6 +14,10 @@ use Context as PrestashopContext; +if (!defined('_PS_VERSION_')) { + exit; +} + class Link { public function getAdminLink($controller, $withToken = true, $sfRouteParams = [], $params = []) diff --git a/src/Adapter/ProductAttributeAdapter.php b/src/Adapter/ProductAttributeAdapter.php index e20e11b2f..6ddc6cdcf 100644 --- a/src/Adapter/ProductAttributeAdapter.php +++ b/src/Adapter/ProductAttributeAdapter.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -6,6 +16,10 @@ use Mollie\Exception\MollieException; +if (!defined('_PS_VERSION_')) { + exit; +} + class ProductAttributeAdapter { /** diff --git a/src/Adapter/Shop.php b/src/Adapter/Shop.php index 9a6028605..c8ee4e7fa 100644 --- a/src/Adapter/Shop.php +++ b/src/Adapter/Shop.php @@ -12,6 +12,10 @@ namespace Mollie\Adapter; +if (!defined('_PS_VERSION_')) { + exit; +} + class Shop { public function getShop(): \Shop diff --git a/src/Adapter/Smarty.php b/src/Adapter/Smarty.php index e582cff77..ea2cd4b9b 100644 --- a/src/Adapter/Smarty.php +++ b/src/Adapter/Smarty.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Adapter; +if (!defined('_PS_VERSION_')) { + exit; +} + class Smarty { public function assign($tpl_var, $value = null, $nocache = false) diff --git a/src/Adapter/ToolsAdapter.php b/src/Adapter/ToolsAdapter.php index 8730cf9c4..436f5a315 100644 --- a/src/Adapter/ToolsAdapter.php +++ b/src/Adapter/ToolsAdapter.php @@ -14,6 +14,10 @@ use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class ToolsAdapter { public function strlen($str): string diff --git a/src/Application/Command/CreateApplePayOrder.php b/src/Application/Command/CreateApplePayOrder.php index 61aff332e..39e5d1539 100644 --- a/src/Application/Command/CreateApplePayOrder.php +++ b/src/Application/Command/CreateApplePayOrder.php @@ -14,6 +14,10 @@ use Mollie\DTO\ApplePay\Order; +if (!defined('_PS_VERSION_')) { + exit; +} + final class CreateApplePayOrder { /** diff --git a/src/Application/Command/RequestApplePayPaymentSession.php b/src/Application/Command/RequestApplePayPaymentSession.php index dbb19c45d..cfb606737 100644 --- a/src/Application/Command/RequestApplePayPaymentSession.php +++ b/src/Application/Command/RequestApplePayPaymentSession.php @@ -12,6 +12,10 @@ namespace Mollie\Application\Command; +if (!defined('_PS_VERSION_')) { + exit; +} + final class RequestApplePayPaymentSession { /** diff --git a/src/Application/Command/UpdateApplePayShippingContact.php b/src/Application/Command/UpdateApplePayShippingContact.php index ac523da7b..9ccf48e49 100644 --- a/src/Application/Command/UpdateApplePayShippingContact.php +++ b/src/Application/Command/UpdateApplePayShippingContact.php @@ -14,6 +14,10 @@ use Mollie\DTO\ApplePay\Product; +if (!defined('_PS_VERSION_')) { + exit; +} + final class UpdateApplePayShippingContact { /** diff --git a/src/Application/Command/UpdateApplePayShippingMethod.php b/src/Application/Command/UpdateApplePayShippingMethod.php index 576d125a4..4412e5c3c 100644 --- a/src/Application/Command/UpdateApplePayShippingMethod.php +++ b/src/Application/Command/UpdateApplePayShippingMethod.php @@ -12,6 +12,10 @@ namespace Mollie\Application\Command; +if (!defined('_PS_VERSION_')) { + exit; +} + final class UpdateApplePayShippingMethod { /** diff --git a/src/Application/CommandHandler/CreateApplePayOrderHandler.php b/src/Application/CommandHandler/CreateApplePayOrderHandler.php index 2429ddd72..62aa4770b 100644 --- a/src/Application/CommandHandler/CreateApplePayOrderHandler.php +++ b/src/Application/CommandHandler/CreateApplePayOrderHandler.php @@ -33,6 +33,10 @@ use Order; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + final class CreateApplePayOrderHandler { const FILE_NAME = 'CreateApplePayOrderHandler'; diff --git a/src/Application/CommandHandler/RequestApplePayPaymentSessionHandler.php b/src/Application/CommandHandler/RequestApplePayPaymentSessionHandler.php index 919bfd0e6..03502ee0f 100644 --- a/src/Application/CommandHandler/RequestApplePayPaymentSessionHandler.php +++ b/src/Application/CommandHandler/RequestApplePayPaymentSessionHandler.php @@ -19,6 +19,10 @@ use Mollie\Exception\MollieApiException; use Mollie\Service\ApiServiceInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + final class RequestApplePayPaymentSessionHandler { /** diff --git a/src/Application/CommandHandler/UpdateApplePayShippingContactHandler.php b/src/Application/CommandHandler/UpdateApplePayShippingContactHandler.php index 25c64c118..e51f41424 100644 --- a/src/Application/CommandHandler/UpdateApplePayShippingContactHandler.php +++ b/src/Application/CommandHandler/UpdateApplePayShippingContactHandler.php @@ -25,6 +25,10 @@ use Mollie\Utility\ApplePayDirect\ShippingMethodUtility; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + final class UpdateApplePayShippingContactHandler { /** diff --git a/src/Application/CommandHandler/UpdateApplePayShippingMethodHandler.php b/src/Application/CommandHandler/UpdateApplePayShippingMethodHandler.php index 38f7ab75b..8ea9297ee 100644 --- a/src/Application/CommandHandler/UpdateApplePayShippingMethodHandler.php +++ b/src/Application/CommandHandler/UpdateApplePayShippingMethodHandler.php @@ -17,6 +17,10 @@ use Mollie\Config\Config; use Mollie\Service\OrderPaymentFeeService; +if (!defined('_PS_VERSION_')) { + exit; +} + final class UpdateApplePayShippingMethodHandler { /** diff --git a/src/Builder/ApiTestFeedbackBuilder.php b/src/Builder/ApiTestFeedbackBuilder.php index 89ba3f55b..165bc5020 100644 --- a/src/Builder/ApiTestFeedbackBuilder.php +++ b/src/Builder/ApiTestFeedbackBuilder.php @@ -16,6 +16,10 @@ use Mollie\Api\Resources\MethodCollection; use Mollie\Service\ApiKeyService; +if (!defined('_PS_VERSION_')) { + exit; +} + class ApiTestFeedbackBuilder implements TemplateBuilderInterface { /** diff --git a/src/Builder/ApplePayDirect/ApplePayCarriersBuilder.php b/src/Builder/ApplePayDirect/ApplePayCarriersBuilder.php index 270720557..3ad410ae4 100644 --- a/src/Builder/ApplePayDirect/ApplePayCarriersBuilder.php +++ b/src/Builder/ApplePayDirect/ApplePayCarriersBuilder.php @@ -15,11 +15,13 @@ use Carrier; use Mollie\DTO\ApplePay\Carrier\Carrier as AppleCarrier; +if (!defined('_PS_VERSION_')) { + exit; +} + class ApplePayCarriersBuilder { /** - * @param array $carriers - * * @return AppleCarrier[] */ public function build(array $carriers, int $idZone): array diff --git a/src/Builder/ApplePayDirect/ApplePayOrderBuilder.php b/src/Builder/ApplePayDirect/ApplePayOrderBuilder.php index ab65257a6..b75360a6a 100644 --- a/src/Builder/ApplePayDirect/ApplePayOrderBuilder.php +++ b/src/Builder/ApplePayDirect/ApplePayOrderBuilder.php @@ -16,6 +16,10 @@ use Mollie\DTO\ApplePay\Product; use Mollie\DTO\ApplePay\ShippingContent; +if (!defined('_PS_VERSION_')) { + exit; +} + class ApplePayOrderBuilder { public function build(array $products, array $shippingContent, array $billingContent): Order diff --git a/src/Builder/ApplePayDirect/ApplePayProductBuilder.php b/src/Builder/ApplePayDirect/ApplePayProductBuilder.php index 012226d1f..6cf04380e 100644 --- a/src/Builder/ApplePayDirect/ApplePayProductBuilder.php +++ b/src/Builder/ApplePayDirect/ApplePayProductBuilder.php @@ -14,6 +14,10 @@ use Mollie\DTO\ApplePay\Product; +if (!defined('_PS_VERSION_')) { + exit; +} + class ApplePayProductBuilder { public function build(array $productParams): array diff --git a/src/Builder/Content/BaseInfoBlock.php b/src/Builder/Content/BaseInfoBlock.php index 4c5f878d6..59f36e1e8 100644 --- a/src/Builder/Content/BaseInfoBlock.php +++ b/src/Builder/Content/BaseInfoBlock.php @@ -17,6 +17,10 @@ use Mollie; use Mollie\Builder\TemplateBuilderInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class BaseInfoBlock implements TemplateBuilderInterface { /** diff --git a/src/Builder/Content/LogoInfoBlock.php b/src/Builder/Content/LogoInfoBlock.php index b26caaa57..0860f1674 100644 --- a/src/Builder/Content/LogoInfoBlock.php +++ b/src/Builder/Content/LogoInfoBlock.php @@ -15,6 +15,10 @@ use Mollie; use Mollie\Builder\TemplateBuilderInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class LogoInfoBlock implements TemplateBuilderInterface { /** diff --git a/src/Builder/Content/PaymentOption/IdealDropdownInfoBlock.php b/src/Builder/Content/PaymentOption/IdealDropdownInfoBlock.php index 2e688712f..318bbff0d 100644 --- a/src/Builder/Content/PaymentOption/IdealDropdownInfoBlock.php +++ b/src/Builder/Content/PaymentOption/IdealDropdownInfoBlock.php @@ -17,6 +17,10 @@ use Mollie\Builder\TemplateBuilderInterface; use Mollie\Service\IssuerService; +if (!defined('_PS_VERSION_')) { + exit; +} + class IdealDropdownInfoBlock implements TemplateBuilderInterface { /** diff --git a/src/Builder/Content/UpdateMessageInfoBlock.php b/src/Builder/Content/UpdateMessageInfoBlock.php index b31a53448..a4f1cee4f 100644 --- a/src/Builder/Content/UpdateMessageInfoBlock.php +++ b/src/Builder/Content/UpdateMessageInfoBlock.php @@ -18,6 +18,10 @@ use Mollie\Provider\UpdateMessageProviderInterface; use Mollie\Service\UpgradeNoticeService; +if (!defined('_PS_VERSION_')) { + exit; +} + class UpdateMessageInfoBlock implements TemplateBuilderInterface { /** diff --git a/src/Builder/FormBuilder.php b/src/Builder/FormBuilder.php index eacef51b6..40f555b71 100644 --- a/src/Builder/FormBuilder.php +++ b/src/Builder/FormBuilder.php @@ -34,6 +34,10 @@ use OrderStateCore as OrderState; use ToolsCore as Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class FormBuilder { const FILE_NAME = 'FormBuilder'; diff --git a/src/Builder/InvoicePdfTemplateBuilder.php b/src/Builder/InvoicePdfTemplateBuilder.php index b638e70a5..50a45dc60 100644 --- a/src/Builder/InvoicePdfTemplateBuilder.php +++ b/src/Builder/InvoicePdfTemplateBuilder.php @@ -19,6 +19,10 @@ use Order; use PrestaShop\PrestaShop\Core\Localization\Locale; +if (!defined('_PS_VERSION_')) { + exit; +} + final class InvoicePdfTemplateBuilder implements TemplateBuilderInterface { /** diff --git a/src/Builder/TemplateBuilderInterface.php b/src/Builder/TemplateBuilderInterface.php index 486e564b3..089be0e6e 100644 --- a/src/Builder/TemplateBuilderInterface.php +++ b/src/Builder/TemplateBuilderInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Builder; +if (!defined('_PS_VERSION_')) { + exit; +} + interface TemplateBuilderInterface { /** diff --git a/src/Calculator/PaymentFeeCalculator.php b/src/Calculator/PaymentFeeCalculator.php index 44b7ec448..22b7131cb 100644 --- a/src/Calculator/PaymentFeeCalculator.php +++ b/src/Calculator/PaymentFeeCalculator.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Calculator; @@ -7,6 +17,10 @@ use Mollie\Utility\NumberUtility; use TaxCalculator; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentFeeCalculator { private const MAX_PERCENTAGE = 100; diff --git a/src/Calculator/index.php b/src/Calculator/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/src/Calculator/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Collector/ApplePayDirect/OrderTotalCollector.php b/src/Collector/ApplePayDirect/OrderTotalCollector.php index 58375ed27..fdafd8ecd 100644 --- a/src/Collector/ApplePayDirect/OrderTotalCollector.php +++ b/src/Collector/ApplePayDirect/OrderTotalCollector.php @@ -17,6 +17,10 @@ use Mollie\DTO\ApplePay\Carrier\Carrier as AppleCarrier; use Mollie\Service\OrderPaymentFeeService; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderTotalCollector { /** @var OrderPaymentFeeService */ @@ -29,7 +33,6 @@ public function __construct(OrderPaymentFeeService $orderPaymentFeeService) /** * @param AppleCarrier[] $applePayCarriers - * @param Cart $cart * * @return array|array * diff --git a/src/Command/TranslationCsvFileGeneratorConsoleCommand.php b/src/Command/TranslationCsvFileGeneratorConsoleCommand.php index beadfa578..996fc4411 100644 --- a/src/Command/TranslationCsvFileGeneratorConsoleCommand.php +++ b/src/Command/TranslationCsvFileGeneratorConsoleCommand.php @@ -17,6 +17,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class TranslationCsvFileGeneratorConsoleCommand extends Command { /** diff --git a/src/Command/UpdateTranslationsConsoleCommand.php b/src/Command/UpdateTranslationsConsoleCommand.php index 8cb325840..82c1c3853 100644 --- a/src/Command/UpdateTranslationsConsoleCommand.php +++ b/src/Command/UpdateTranslationsConsoleCommand.php @@ -17,6 +17,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class UpdateTranslationsConsoleCommand extends Command { /** diff --git a/src/Command/UploadTranslationsFromCsvFileConsoleCommand.php b/src/Command/UploadTranslationsFromCsvFileConsoleCommand.php index ea07047b1..ee2276df1 100644 --- a/src/Command/UploadTranslationsFromCsvFileConsoleCommand.php +++ b/src/Command/UploadTranslationsFromCsvFileConsoleCommand.php @@ -17,6 +17,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class UploadTranslationsFromCsvFileConsoleCommand extends Command { const CSV_POSITION_ID = 0; diff --git a/src/Config/Config.php b/src/Config/Config.php index 6f348ef25..2ce23d4e1 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -19,6 +19,10 @@ use Mollie\Api\Types\RefundStatus; use Mollie\Utility\EnvironmentUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class Config { const SEGMENT_KEY = 'x8qDW8mWIlcY9SXbMhKLoH7xYQ1cSxF2'; diff --git a/src/Config/Env.php b/src/Config/Env.php index 779116764..74024c29e 100644 --- a/src/Config/Env.php +++ b/src/Config/Env.php @@ -12,6 +12,10 @@ namespace Mollie\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * This class allows to retrieve config data that can be overwritten by a .env file. * Otherwise it returns by default from the Config class. diff --git a/src/Controller/AbstractMollieController.php b/src/Controller/AbstractMollieController.php index 11f144842..d73234035 100644 --- a/src/Controller/AbstractMollieController.php +++ b/src/Controller/AbstractMollieController.php @@ -18,6 +18,10 @@ use Mollie\Infrastructure\Response\Response; use Mollie\Logger\PrestaLoggerInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class AbstractMollieController extends \ModuleFrontControllerCore { private const FILE_NAME = 'AbstractMollieController'; diff --git a/src/Controller/AdminMollieEmailController.php b/src/Controller/AdminMollieEmailController.php index 9b2ca92a8..3d87eab0d 100644 --- a/src/Controller/AdminMollieEmailController.php +++ b/src/Controller/AdminMollieEmailController.php @@ -17,6 +17,10 @@ use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; use Symfony\Component\HttpFoundation\Request; +if (!defined('_PS_VERSION_')) { + exit; +} + class AdminMollieEmailController extends FrameworkBundleAdminController { public function sendSecondChanceMessage($orderId, Request $request) diff --git a/src/DTO/ApplePay/Carrier/Carrier.php b/src/DTO/ApplePay/Carrier/Carrier.php index 20d32fac9..dfb6dad3f 100644 --- a/src/DTO/ApplePay/Carrier/Carrier.php +++ b/src/DTO/ApplePay/Carrier/Carrier.php @@ -13,6 +13,10 @@ use JsonSerializable; +if (!defined('_PS_VERSION_')) { + exit; +} + class Carrier implements JsonSerializable { /** diff --git a/src/DTO/ApplePay/Order.php b/src/DTO/ApplePay/Order.php index d9375cd66..d6d807311 100644 --- a/src/DTO/ApplePay/Order.php +++ b/src/DTO/ApplePay/Order.php @@ -11,6 +11,10 @@ namespace Mollie\DTO\ApplePay; +if (!defined('_PS_VERSION_')) { + exit; +} + class Order { /** diff --git a/src/DTO/ApplePay/Product.php b/src/DTO/ApplePay/Product.php index 0c3f2c8d9..cf1d998f1 100644 --- a/src/DTO/ApplePay/Product.php +++ b/src/DTO/ApplePay/Product.php @@ -11,6 +11,10 @@ namespace Mollie\DTO\ApplePay; +if (!defined('_PS_VERSION_')) { + exit; +} + class Product { /** diff --git a/src/DTO/ApplePay/ShippingContent.php b/src/DTO/ApplePay/ShippingContent.php index 287de5a3d..670b1a643 100644 --- a/src/DTO/ApplePay/ShippingContent.php +++ b/src/DTO/ApplePay/ShippingContent.php @@ -11,6 +11,10 @@ namespace Mollie\DTO\ApplePay; +if (!defined('_PS_VERSION_')) { + exit; +} + class ShippingContent { /** diff --git a/src/DTO/CreateOrderPaymentFeeActionData.php b/src/DTO/CreateOrderPaymentFeeActionData.php index 31fe58a43..b6a66b8e9 100644 --- a/src/DTO/CreateOrderPaymentFeeActionData.php +++ b/src/DTO/CreateOrderPaymentFeeActionData.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\DTO; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateOrderPaymentFeeActionData { /** @var int */ @@ -25,33 +39,21 @@ public function __construct( $this->paymentFeeTaxExcl = $paymentFeeTaxExcl; } - /** - * @return int - */ public function getOrderId(): int { return $this->orderId; } - /** - * @return int - */ public function getCartId(): int { return $this->cartId; } - /** - * @return float - */ public function getPaymentFeeTaxIncl(): float { return $this->paymentFeeTaxIncl; } - /** - * @return float - */ public function getPaymentFeeTaxExcl(): float { return $this->paymentFeeTaxExcl; diff --git a/src/DTO/Line.php b/src/DTO/Line.php index 2bea43493..da595d695 100644 --- a/src/DTO/Line.php +++ b/src/DTO/Line.php @@ -14,6 +14,10 @@ use JsonSerializable; use Mollie\DTO\Object\Amount; +if (!defined('_PS_VERSION_')) { + exit; +} + class Line implements JsonSerializable { /** diff --git a/src/DTO/Object/Amount.php b/src/DTO/Object/Amount.php index 69a6621c1..7421b5076 100644 --- a/src/DTO/Object/Amount.php +++ b/src/DTO/Object/Amount.php @@ -12,6 +12,10 @@ namespace Mollie\DTO\Object; +if (!defined('_PS_VERSION_')) { + exit; +} + class Amount { /** diff --git a/src/DTO/Object/Company.php b/src/DTO/Object/Company.php index 80a2ec05d..224d7627f 100644 --- a/src/DTO/Object/Company.php +++ b/src/DTO/Object/Company.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\DTO\Object; +if (!defined('_PS_VERSION_')) { + exit; +} + class Company implements \JsonSerializable { /** @var string */ @@ -9,17 +23,12 @@ class Company implements \JsonSerializable /** @var string */ private $registrationNumber; - /** - * @return string - */ public function getVatNumber(): string { return $this->vatNumber; } /** - * @param string $vatNumber - * * @maps vatNumber */ public function setVatNumber(string $vatNumber): void @@ -27,17 +36,12 @@ public function setVatNumber(string $vatNumber): void $this->vatNumber = $vatNumber; } - /** - * @return string - */ public function getRegistrationNumber(): string { return $this->registrationNumber; } /** - * @param string $registrationNumber - * * @maps registrationNumber */ public function setRegistrationNumber(string $registrationNumber): void diff --git a/src/DTO/Object/Payment.php b/src/DTO/Object/Payment.php index 127f0cfd2..a10e81d3f 100644 --- a/src/DTO/Object/Payment.php +++ b/src/DTO/Object/Payment.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\DTO\Object; +if (!defined('_PS_VERSION_')) { + exit; +} + class Payment implements \JsonSerializable { /** @var ?string */ @@ -26,8 +40,6 @@ public function getCardToken(): ?string } /** - * @param string $cardToken - * * @maps cardToken */ public function setCardToken(string $cardToken): void @@ -35,17 +47,12 @@ public function setCardToken(string $cardToken): void $this->cardToken = $cardToken; } - /** - * @return string - */ public function getWebhookUrl(): string { return $this->webhookUrl; } /** - * @param string $webhookUrl - * * @maps webhookUrl */ public function setWebhookUrl(string $webhookUrl): void @@ -62,8 +69,6 @@ public function getIssuer(): ?string } /** - * @param string $issuer - * * @maps issuer */ public function setIssuer(string $issuer): void @@ -80,8 +85,6 @@ public function getCustomerId(): ?string } /** - * @param string $customerId - * * @maps customerId */ public function setCustomerId(string $customerId): void @@ -98,8 +101,6 @@ public function getApplePayPaymentToken(): ?string } /** - * @param string $applePayPaymentToken - * * @maps applePayPaymentToken */ public function setApplePayPaymentToken(string $applePayPaymentToken): void diff --git a/src/DTO/OrderData.php b/src/DTO/OrderData.php index e50652f16..f1696cb50 100644 --- a/src/DTO/OrderData.php +++ b/src/DTO/OrderData.php @@ -18,6 +18,10 @@ use Mollie\DTO\Object\Amount; use Mollie\DTO\Object\Payment; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderData implements JsonSerializable { /** @@ -363,17 +367,12 @@ public function setLines($lines) $this->lines = $lines; } - /** - * @return Payment - */ public function getPayment(): Payment { return $this->payment; } /** - * @param \Mollie\DTO\Object\Payment $payment - * * @maps payment */ public function setPayment(Payment $payment): void @@ -386,9 +385,6 @@ public function getConsumerDateOfBirth(): ?string return $this->consumerDateOfBirth; } - /** - * @param string $consumerDateOfBirth - */ public function setConsumerDateOfBirth(string $consumerDateOfBirth): void { $this->consumerDateOfBirth = $consumerDateOfBirth; @@ -404,17 +400,11 @@ public function setSequenceType(string $sequenceType): void $this->sequenceType = $sequenceType; } - /** - * @return string|null - */ public function getTitle(): ?string { return $this->title; } - /** - * @param string|null $title - */ public function setTitle(?string $title): void { $this->title = $title; diff --git a/src/DTO/OrderStateData.php b/src/DTO/OrderStateData.php index 10fbebe7c..d442bf2bd 100644 --- a/src/DTO/OrderStateData.php +++ b/src/DTO/OrderStateData.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\DTO; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderStateData { /** @var string */ @@ -49,81 +63,51 @@ public function __construct( $this->pdfInvoice = $pdfInvoice; } - /** - * @return string - */ public function getName(): string { return $this->name; } - /** - * @return bool - */ public function isSendEmail(): bool { return $this->sendEmail; } - /** - * @return string - */ public function getColor(): string { return $this->color; } - /** - * @return bool - */ public function isLogable(): bool { return $this->logable; } - /** - * @return bool - */ public function isDelivery(): bool { return $this->delivery; } - /** - * @return bool - */ public function isInvoice(): bool { return $this->invoice; } - /** - * @return bool - */ public function isShipped(): bool { return $this->shipped; } - /** - * @return bool - */ public function isPaid(): bool { return $this->paid; } - /** - * @return string - */ public function getTemplate(): string { return $this->template; } - /** - * @return bool - */ public function isPdfInvoice(): bool { return $this->pdfInvoice; diff --git a/src/DTO/PaymentData.php b/src/DTO/PaymentData.php index b1a52b8a3..78a40dc7d 100644 --- a/src/DTO/PaymentData.php +++ b/src/DTO/PaymentData.php @@ -17,6 +17,10 @@ use JsonSerializable; use Mollie\DTO\Object\Amount; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentData implements JsonSerializable { /** @@ -346,17 +350,11 @@ public function setSequenceType(string $sequenceType): void $this->sequenceType = $sequenceType; } - /** - * @return bool - */ public function isSubscriptionOrder(): bool { return $this->subscriptionOrder; } - /** - * @param bool $subscriptionOrder - */ public function setSubscriptionOrder(bool $subscriptionOrder): void { $this->subscriptionOrder = $subscriptionOrder; diff --git a/src/DTO/PaymentFeeData.php b/src/DTO/PaymentFeeData.php index cd8cbe2b9..9708f8fb8 100644 --- a/src/DTO/PaymentFeeData.php +++ b/src/DTO/PaymentFeeData.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\DTO; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentFeeData { /** @var float */ @@ -25,33 +39,21 @@ public function __construct( $this->active = $active; } - /** - * @return float - */ public function getPaymentFeeTaxIncl(): float { return $this->paymentFeeTaxIncl; } - /** - * @return float - */ public function getPaymentFeeTaxExcl(): float { return $this->paymentFeeTaxExcl; } - /** - * @return float - */ public function getTaxRate(): float { return $this->taxRate; } - /** - * @return bool - */ public function isActive(): bool { return $this->active; diff --git a/src/DTO/UpdateOrderTotalsData.php b/src/DTO/UpdateOrderTotalsData.php index a0709fb9e..8c4ef3b3f 100644 --- a/src/DTO/UpdateOrderTotalsData.php +++ b/src/DTO/UpdateOrderTotalsData.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\DTO; +if (!defined('_PS_VERSION_')) { + exit; +} + class UpdateOrderTotalsData { /** @var int */ @@ -33,49 +47,31 @@ public function __construct( $this->originalCartAmountTaxExcl = $originalCartAmountTaxExcl; } - /** - * @return int - */ public function getOrderId(): int { return $this->orderId; } - /** - * @return float - */ public function getPaymentFeeTaxIncl(): float { return $this->paymentFeeTaxIncl; } - /** - * @return float - */ public function getPaymentFeeTaxExcl(): float { return $this->paymentFeeTaxExcl; } - /** - * @return float - */ public function getTransactionAmount(): float { return $this->transactionAmount; } - /** - * @return float - */ public function getOriginalCartAmountTaxIncl(): float { return $this->originalCartAmountTaxIncl; } - /** - * @return float - */ public function getOriginalCartAmountTaxExcl(): float { return $this->originalCartAmountTaxExcl; diff --git a/src/Entity/MolCarrierInformation.php b/src/Entity/MolCarrierInformation.php index 6d3483a6d..5b0462d26 100644 --- a/src/Entity/MolCarrierInformation.php +++ b/src/Entity/MolCarrierInformation.php @@ -9,6 +9,10 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ +if (!defined('_PS_VERSION_')) { + exit; +} + class MolCarrierInformation extends ObjectModel { /** diff --git a/src/Entity/MolCustomer.php b/src/Entity/MolCustomer.php index 12f76109b..3fd50a539 100644 --- a/src/Entity/MolCustomer.php +++ b/src/Entity/MolCustomer.php @@ -9,6 +9,10 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ +if (!defined('_PS_VERSION_')) { + exit; +} + class MolCustomer extends ObjectModel { /** diff --git a/src/Entity/MolOrderPaymentFee.php b/src/Entity/MolOrderPaymentFee.php index 703b316ba..8a99a5b6f 100644 --- a/src/Entity/MolOrderPaymentFee.php +++ b/src/Entity/MolOrderPaymentFee.php @@ -9,6 +9,10 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ +if (!defined('_PS_VERSION_')) { + exit; +} + class MolOrderPaymentFee extends ObjectModel { /** diff --git a/src/Entity/MolPaymentMethod.php b/src/Entity/MolPaymentMethod.php index f960ca063..104e56343 100644 --- a/src/Entity/MolPaymentMethod.php +++ b/src/Entity/MolPaymentMethod.php @@ -9,6 +9,10 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ +if (!defined('_PS_VERSION_')) { + exit; +} + class MolPaymentMethod extends ObjectModel { /** diff --git a/src/Entity/MolPaymentMethodIssuer.php b/src/Entity/MolPaymentMethodIssuer.php index 61e66e419..932acc12b 100644 --- a/src/Entity/MolPaymentMethodIssuer.php +++ b/src/Entity/MolPaymentMethodIssuer.php @@ -9,6 +9,10 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ +if (!defined('_PS_VERSION_')) { + exit; +} + class MolPaymentMethodIssuer extends ObjectModel { /** diff --git a/src/Entity/MolPendingOrderCart.php b/src/Entity/MolPendingOrderCart.php index f8e60f494..17b6ad04d 100644 --- a/src/Entity/MolPendingOrderCart.php +++ b/src/Entity/MolPendingOrderCart.php @@ -9,6 +9,9 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ +if (!defined('_PS_VERSION_')) { + exit; +} /** * Holds data for duplicated cart -> order id from which cart was duplicated. diff --git a/src/Entity/MolPendingOrderCartRule.php b/src/Entity/MolPendingOrderCartRule.php index 987245fd3..a7310029d 100644 --- a/src/Entity/MolPendingOrderCartRule.php +++ b/src/Entity/MolPendingOrderCartRule.php @@ -9,6 +9,10 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ +if (!defined('_PS_VERSION_')) { + exit; +} + class MolPendingOrderCartRule extends ObjectModel { /** diff --git a/src/Enum/EmailTemplate.php b/src/Enum/EmailTemplate.php index 40c556fc8..9638dc737 100644 --- a/src/Enum/EmailTemplate.php +++ b/src/Enum/EmailTemplate.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Enum; +if (!defined('_PS_VERSION_')) { + exit; +} + class EmailTemplate { public const PAYMENT = 'payment'; diff --git a/src/Enum/PaymentTypeEnum.php b/src/Enum/PaymentTypeEnum.php index ffddb1600..d9b46b6ed 100644 --- a/src/Enum/PaymentTypeEnum.php +++ b/src/Enum/PaymentTypeEnum.php @@ -12,6 +12,10 @@ namespace Mollie\Enum; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentTypeEnum { const PAYMENT_TYPE_PAYMENT = 0; diff --git a/src/Errors/Error.php b/src/Errors/Error.php index 164084247..6d2cc76cf 100644 --- a/src/Errors/Error.php +++ b/src/Errors/Error.php @@ -12,6 +12,10 @@ namespace Mollie\Errors; +if (!defined('_PS_VERSION_')) { + exit; +} + class Error implements \JsonSerializable { /** @var int|null */ diff --git a/src/Errors/Http/HttpStatusCode.php b/src/Errors/Http/HttpStatusCode.php index c23c867e9..33a06f320 100644 --- a/src/Errors/Http/HttpStatusCode.php +++ b/src/Errors/Http/HttpStatusCode.php @@ -12,6 +12,10 @@ namespace Mollie\Errors\Http; +if (!defined('_PS_VERSION_')) { + exit; +} + class HttpStatusCode { const HTTP_CONTINUE = 100; diff --git a/src/Exception/CancelPendingOrderException.php b/src/Exception/CancelPendingOrderException.php index 0b26e3359..9aa00f42c 100644 --- a/src/Exception/CancelPendingOrderException.php +++ b/src/Exception/CancelPendingOrderException.php @@ -12,6 +12,10 @@ namespace Mollie\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class CancelPendingOrderException extends MollieException { } diff --git a/src/Exception/Code/ExceptionCode.php b/src/Exception/Code/ExceptionCode.php index d7f21cef6..133a43ff1 100644 --- a/src/Exception/Code/ExceptionCode.php +++ b/src/Exception/Code/ExceptionCode.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Exception\Code; +if (!defined('_PS_VERSION_')) { + exit; +} + class ExceptionCode { // Infrastructure error codes starts from 1000 diff --git a/src/Exception/Code/index.php b/src/Exception/Code/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/src/Exception/Code/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Exception/CouldNotCreateOrderPaymentFee.php b/src/Exception/CouldNotCreateOrderPaymentFee.php index 0ac620f71..02a4f9a61 100644 --- a/src/Exception/CouldNotCreateOrderPaymentFee.php +++ b/src/Exception/CouldNotCreateOrderPaymentFee.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Exception; use Exception; use Mollie\Exception\Code\ExceptionCode; +if (!defined('_PS_VERSION_')) { + exit; +} + class CouldNotCreateOrderPaymentFee extends MollieException { public static function failedToInsertOrderPaymentFee(Exception $exception): self diff --git a/src/Exception/CouldNotInstallModule.php b/src/Exception/CouldNotInstallModule.php index c9fd4b06c..dab100039 100644 --- a/src/Exception/CouldNotInstallModule.php +++ b/src/Exception/CouldNotInstallModule.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Exception; use Mollie\Exception\Code\ExceptionCode; +if (!defined('_PS_VERSION_')) { + exit; +} + class CouldNotInstallModule extends MollieException { public static function failedToInstallOrderState(string $orderStateName, \Exception $exception): self diff --git a/src/Exception/CouldNotUpdateOrderTotals.php b/src/Exception/CouldNotUpdateOrderTotals.php index 69bda3404..ded831415 100644 --- a/src/Exception/CouldNotUpdateOrderTotals.php +++ b/src/Exception/CouldNotUpdateOrderTotals.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Exception; use Exception; use Mollie\Exception\Code\ExceptionCode; +if (!defined('_PS_VERSION_')) { + exit; +} + class CouldNotUpdateOrderTotals extends MollieException { public static function failedToUpdateOrderTotals(Exception $exception): self diff --git a/src/Exception/FailedToProvidePaymentFeeException.php b/src/Exception/FailedToProvidePaymentFeeException.php index b1c186480..f16f604a3 100644 --- a/src/Exception/FailedToProvidePaymentFeeException.php +++ b/src/Exception/FailedToProvidePaymentFeeException.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class FailedToProvidePaymentFeeException extends \Exception { } diff --git a/src/Exception/MollieApiException.php b/src/Exception/MollieApiException.php index 82afd30f4..93c7d86ec 100644 --- a/src/Exception/MollieApiException.php +++ b/src/Exception/MollieApiException.php @@ -12,6 +12,10 @@ namespace Mollie\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieApiException extends \Exception { const MOLLIE_API_IS_NULL = 1; diff --git a/src/Exception/MollieException.php b/src/Exception/MollieException.php index 10b883cf4..da7a13b6d 100644 --- a/src/Exception/MollieException.php +++ b/src/Exception/MollieException.php @@ -15,6 +15,10 @@ use Mollie\Exception\Code\ExceptionCode; use Throwable; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieException extends \Exception { const CUSTOMER_EXCEPTION = 1; diff --git a/src/Exception/NotImplementedException.php b/src/Exception/NotImplementedException.php index 3bbbe091e..e72e4fd6d 100644 --- a/src/Exception/NotImplementedException.php +++ b/src/Exception/NotImplementedException.php @@ -12,6 +12,10 @@ namespace Mollie\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class NotImplementedException extends MollieException { } diff --git a/src/Exception/OrderCreationException.php b/src/Exception/OrderCreationException.php index 16be340a9..56740ed16 100644 --- a/src/Exception/OrderCreationException.php +++ b/src/Exception/OrderCreationException.php @@ -12,6 +12,10 @@ namespace Mollie\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderCreationException extends \Exception { const DEFAULT_ORDER_CREATION_EXCEPTION = 1; diff --git a/src/Exception/RetryOverException.php b/src/Exception/RetryOverException.php index 1eddac6a8..3e988ec5a 100644 --- a/src/Exception/RetryOverException.php +++ b/src/Exception/RetryOverException.php @@ -12,6 +12,10 @@ namespace Mollie\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class RetryOverException extends \Exception { } diff --git a/src/Exception/ShipmentCannotBeSentException.php b/src/Exception/ShipmentCannotBeSentException.php index 914af3d32..acd1d0dfe 100644 --- a/src/Exception/ShipmentCannotBeSentException.php +++ b/src/Exception/ShipmentCannotBeSentException.php @@ -14,6 +14,10 @@ use Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class ShipmentCannotBeSentException extends Exception { public const NO_SHIPPING_INFORMATION = 1; diff --git a/src/Exception/TransactionException.php b/src/Exception/TransactionException.php index 91e5e89e8..28bf7ceb3 100644 --- a/src/Exception/TransactionException.php +++ b/src/Exception/TransactionException.php @@ -12,6 +12,10 @@ namespace Mollie\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class TransactionException extends MollieException { } diff --git a/src/Factory/ContextFactory.php b/src/Factory/ContextFactory.php index 588d8888f..1cc1c1e73 100644 --- a/src/Factory/ContextFactory.php +++ b/src/Factory/ContextFactory.php @@ -14,6 +14,10 @@ use Context; +if (!defined('_PS_VERSION_')) { + exit; +} + class ContextFactory { public static function getContext(): Context diff --git a/src/Factory/CustomerFactory.php b/src/Factory/CustomerFactory.php index 0f39cce95..119c841e1 100644 --- a/src/Factory/CustomerFactory.php +++ b/src/Factory/CustomerFactory.php @@ -15,6 +15,10 @@ use Customer; use Mollie\Utility\ContextUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class CustomerFactory { public function recreateFromRequest($customerId, $customerSecureKey, $context) diff --git a/src/Factory/ModuleFactory.php b/src/Factory/ModuleFactory.php index 113c96dba..55e422596 100644 --- a/src/Factory/ModuleFactory.php +++ b/src/Factory/ModuleFactory.php @@ -15,6 +15,10 @@ use Module; use Mollie; +if (!defined('_PS_VERSION_')) { + exit; +} + class ModuleFactory { public function getModuleVersion(): ?string diff --git a/src/Grid/Action/Type/SecondChanceRowAction.php b/src/Grid/Action/Type/SecondChanceRowAction.php index ccf01e738..148bef3d0 100644 --- a/src/Grid/Action/Type/SecondChanceRowAction.php +++ b/src/Grid/Action/Type/SecondChanceRowAction.php @@ -16,6 +16,10 @@ use PrestaShop\PrestaShop\Core\Grid\Action\Row\AccessibilityChecker\AccessibilityCheckerInterface; use Symfony\Component\OptionsResolver\OptionsResolver; +if (!defined('_PS_VERSION_')) { + exit; +} + final class SecondChanceRowAction extends AbstractRowAction { /** diff --git a/src/Grid/Definition/Modifier/GridDefinitionModifierInterface.php b/src/Grid/Definition/Modifier/GridDefinitionModifierInterface.php index 7880d2a18..018fe188b 100644 --- a/src/Grid/Definition/Modifier/GridDefinitionModifierInterface.php +++ b/src/Grid/Definition/Modifier/GridDefinitionModifierInterface.php @@ -14,12 +14,14 @@ use PrestaShop\PrestaShop\Core\Grid\Definition\GridDefinitionInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + interface GridDefinitionModifierInterface { /** * Used to modify Grid Definition. - * - * @param GridDefinitionInterface $gridDefinition */ public function modify(GridDefinitionInterface $gridDefinition); } diff --git a/src/Grid/Definition/Modifier/OrderGridDefinitionModifier.php b/src/Grid/Definition/Modifier/OrderGridDefinitionModifier.php index 0d48d4546..33324245e 100644 --- a/src/Grid/Definition/Modifier/OrderGridDefinitionModifier.php +++ b/src/Grid/Definition/Modifier/OrderGridDefinitionModifier.php @@ -19,6 +19,10 @@ use PrestaShop\PrestaShop\Core\Grid\Column\Type\Common\ActionColumn; use PrestaShop\PrestaShop\Core\Grid\Definition\GridDefinitionInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderGridDefinitionModifier implements GridDefinitionModifierInterface { private $module; diff --git a/src/Grid/Query/Modifier/GridQueryModifierInterface.php b/src/Grid/Query/Modifier/GridQueryModifierInterface.php index 5706f3709..41d1718ad 100644 --- a/src/Grid/Query/Modifier/GridQueryModifierInterface.php +++ b/src/Grid/Query/Modifier/GridQueryModifierInterface.php @@ -14,12 +14,14 @@ use Doctrine\DBAL\Query\QueryBuilder; +if (!defined('_PS_VERSION_')) { + exit; +} + interface GridQueryModifierInterface { /** * Used to modify Grid Query Builder. - * - * @param QueryBuilder $queryBuilder */ public function modify(QueryBuilder $queryBuilder); } diff --git a/src/Grid/Query/Modifier/OrderGridQueryModifier.php b/src/Grid/Query/Modifier/OrderGridQueryModifier.php index e144733ef..0bd9a3f94 100644 --- a/src/Grid/Query/Modifier/OrderGridQueryModifier.php +++ b/src/Grid/Query/Modifier/OrderGridQueryModifier.php @@ -14,6 +14,10 @@ use Doctrine\DBAL\Query\QueryBuilder; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderGridQueryModifier implements GridQueryModifierInterface { /** diff --git a/src/Grid/Row/AccessibilityChecker/SecondChanceAccessibilityChecker.php b/src/Grid/Row/AccessibilityChecker/SecondChanceAccessibilityChecker.php index 21b22df51..522cc4b4f 100644 --- a/src/Grid/Row/AccessibilityChecker/SecondChanceAccessibilityChecker.php +++ b/src/Grid/Row/AccessibilityChecker/SecondChanceAccessibilityChecker.php @@ -14,6 +14,10 @@ use Mollie\Repository\PaymentMethodRepositoryInterface; use PrestaShop\PrestaShop\Core\Grid\Action\Row\AccessibilityChecker\AccessibilityCheckerInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * Checks if second chance email option can be visible in order list. */ diff --git a/src/Handler/Api/OrderEndpointPaymentTypeHandler.php b/src/Handler/Api/OrderEndpointPaymentTypeHandler.php index 04b9d6c36..df8f24f6d 100644 --- a/src/Handler/Api/OrderEndpointPaymentTypeHandler.php +++ b/src/Handler/Api/OrderEndpointPaymentTypeHandler.php @@ -15,6 +15,10 @@ use Mollie\Enum\PaymentTypeEnum; use Mollie\Verification\PaymentType\PaymentTypeVerificationInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderEndpointPaymentTypeHandler implements OrderEndpointPaymentTypeHandlerInterface { /** diff --git a/src/Handler/Api/OrderEndpointPaymentTypeHandlerInterface.php b/src/Handler/Api/OrderEndpointPaymentTypeHandlerInterface.php index 8bf657d52..839f1ad7b 100644 --- a/src/Handler/Api/OrderEndpointPaymentTypeHandlerInterface.php +++ b/src/Handler/Api/OrderEndpointPaymentTypeHandlerInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Handler\Api; +if (!defined('_PS_VERSION_')) { + exit; +} + interface OrderEndpointPaymentTypeHandlerInterface { /** diff --git a/src/Handler/CartRule/CartRuleQuantityChangeHandler.php b/src/Handler/CartRule/CartRuleQuantityChangeHandler.php index 1bf1fc1a9..36d33a311 100644 --- a/src/Handler/CartRule/CartRuleQuantityChangeHandler.php +++ b/src/Handler/CartRule/CartRuleQuantityChangeHandler.php @@ -20,6 +20,10 @@ use MolPendingOrderCartRule; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class CartRuleQuantityChangeHandler implements CartRuleQuantityChangeHandlerInterface { /** @@ -84,8 +88,6 @@ public function handle(Cart $cart, $cartRules = []) } /** - * @param Order $order - * @param CartRule $cartRule * @param MolPendingOrderCartRule $pendingOrderCartRule * * @throws \PrestaShopDatabaseException @@ -98,8 +100,6 @@ private function setQuantities(Order $order, CartRule $cartRule, $pendingOrderCa } /** - * @param CartRule $cartRule - * * @throws \PrestaShopDatabaseException * @throws \PrestaShopException */ @@ -109,11 +109,6 @@ private function decreaseAvailableCartRuleQuantity(CartRule $cartRule) $cartRule->update(); } - /** - * @param Order $order - * @param CartRule $cartRule - * @param MolPendingOrderCartRule $pendingOrderCartRule - */ private function increaseCustomerUsedCartRuleQuantity(Order $order, CartRule $cartRule, MolPendingOrderCartRule $pendingOrderCartRule) { $this->pendingOrderCartRuleRepository->usePendingOrderCartRule($order, $pendingOrderCartRule); diff --git a/src/Handler/CartRule/CartRuleQuantityChangeHandlerInterface.php b/src/Handler/CartRule/CartRuleQuantityChangeHandlerInterface.php index 87edf85ca..9b92b6428 100644 --- a/src/Handler/CartRule/CartRuleQuantityChangeHandlerInterface.php +++ b/src/Handler/CartRule/CartRuleQuantityChangeHandlerInterface.php @@ -14,10 +14,13 @@ use Cart; +if (!defined('_PS_VERSION_')) { + exit; +} + interface CartRuleQuantityChangeHandlerInterface { /** - * @param Cart $cart * @param array $cartRules */ public function handle(Cart $cart, $cartRules = []); diff --git a/src/Handler/CartRule/CartRuleQuantityResetHandler.php b/src/Handler/CartRule/CartRuleQuantityResetHandler.php index ec47078ea..7e96b5d87 100644 --- a/src/Handler/CartRule/CartRuleQuantityResetHandler.php +++ b/src/Handler/CartRule/CartRuleQuantityResetHandler.php @@ -21,6 +21,10 @@ use Order; use OrderCartRule; +if (!defined('_PS_VERSION_')) { + exit; +} + class CartRuleQuantityResetHandler implements CartRuleQuantityResetHandlerInterface { /** @@ -94,8 +98,6 @@ public function handle(Cart $cart, $cartRules = [], $paymentSuccessful = false) /** * @param int $orderId - * @param CartRule $cartRule - * @param OrderCartRule $orderCartRule * * @throws \PrestaShopDatabaseException * @throws \PrestaShopException @@ -108,8 +110,6 @@ private function resetQuantities($orderId, CartRule $cartRule, OrderCartRule $or /** * @param int $orderId - * @param CartRule $cartRule - * @param OrderCartRule $orderCartRule * * @throws \PrestaShopDatabaseException * @throws \PrestaShopException @@ -122,8 +122,6 @@ private function decreaseCustomerUsedCartRuleQuantity($orderId, CartRule $cartRu } /** - * @param CartRule $cartRule - * * @throws \PrestaShopDatabaseException * @throws \PrestaShopException */ diff --git a/src/Handler/CartRule/CartRuleQuantityResetHandlerInterface.php b/src/Handler/CartRule/CartRuleQuantityResetHandlerInterface.php index 8a5ac65a4..76ec97151 100644 --- a/src/Handler/CartRule/CartRuleQuantityResetHandlerInterface.php +++ b/src/Handler/CartRule/CartRuleQuantityResetHandlerInterface.php @@ -14,10 +14,13 @@ use Cart; +if (!defined('_PS_VERSION_')) { + exit; +} + interface CartRuleQuantityResetHandlerInterface { /** - * @param Cart $cart * @param array $cartRules */ public function handle(Cart $cart, $cartRules = []); diff --git a/src/Handler/Certificate/CertificateHandlerInterface.php b/src/Handler/Certificate/CertificateHandlerInterface.php index ba9af16f9..a95bd1d5c 100644 --- a/src/Handler/Certificate/CertificateHandlerInterface.php +++ b/src/Handler/Certificate/CertificateHandlerInterface.php @@ -14,6 +14,10 @@ use Mollie\Handler\Certificate\Exception\CertificationException; +if (!defined('_PS_VERSION_')) { + exit; +} + interface CertificateHandlerInterface { /** diff --git a/src/Handler/Certificate/Exception/CertificationException.php b/src/Handler/Certificate/Exception/CertificationException.php index b0b9c10b6..1ea00a0ce 100644 --- a/src/Handler/Certificate/Exception/CertificationException.php +++ b/src/Handler/Certificate/Exception/CertificationException.php @@ -14,6 +14,10 @@ use Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class CertificationException extends Exception { const FILE_COPY_EXCEPTON = 0; diff --git a/src/Handler/ErrorHandler/ErrorHandler.php b/src/Handler/ErrorHandler/ErrorHandler.php index e5c51bd69..a8b1b8e0f 100644 --- a/src/Handler/ErrorHandler/ErrorHandler.php +++ b/src/Handler/ErrorHandler/ErrorHandler.php @@ -23,6 +23,10 @@ use Sentry\State\Scope; use Sentry\UserDataBag; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * Handle Error. */ diff --git a/src/Handler/Exception/CouldNotHandleOrderPaymentFee.php b/src/Handler/Exception/CouldNotHandleOrderPaymentFee.php index 077c1f55a..e184b6714 100644 --- a/src/Handler/Exception/CouldNotHandleOrderPaymentFee.php +++ b/src/Handler/Exception/CouldNotHandleOrderPaymentFee.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Handler\Exception; @@ -6,6 +16,10 @@ use Mollie\Exception\MollieException; use Throwable; +if (!defined('_PS_VERSION_')) { + exit; +} + class CouldNotHandleOrderPaymentFee extends MollieException { public static function failedToRetrievePaymentMethod(Throwable $exception): self diff --git a/src/Handler/Exception/ExceptionHandlerInterface.php b/src/Handler/Exception/ExceptionHandlerInterface.php index 19ac6a8b8..c33e83eb1 100644 --- a/src/Handler/Exception/ExceptionHandlerInterface.php +++ b/src/Handler/Exception/ExceptionHandlerInterface.php @@ -14,6 +14,10 @@ use Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + interface ExceptionHandlerInterface { public function handle(Exception $e); diff --git a/src/Handler/Order/OrderCreationHandler.php b/src/Handler/Order/OrderCreationHandler.php index 7a3316cf4..39ba1fb53 100644 --- a/src/Handler/Order/OrderCreationHandler.php +++ b/src/Handler/Order/OrderCreationHandler.php @@ -62,6 +62,10 @@ use Order; use PrestaShop\Decimal\Number; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderCreationHandler { /** @@ -113,10 +117,6 @@ public function __construct( /** * @param MollieOrderAlias|MolliePaymentAlias $apiPayment - * @param int $cartId - * @param bool $isAuthorizablePayment - * - * @return int * * @throws FailedToProvidePaymentFeeException * @throws ApiException @@ -212,7 +212,6 @@ public function createOrder($apiPayment, int $cartId, bool $isAuthorizablePaymen /** * @param PaymentData|OrderData $paymentData - * @param Cart $cart * * @return OrderData|PaymentData */ diff --git a/src/Handler/Order/OrderPaymentFeeHandler.php b/src/Handler/Order/OrderPaymentFeeHandler.php index e50205733..bb3d30367 100644 --- a/src/Handler/Order/OrderPaymentFeeHandler.php +++ b/src/Handler/Order/OrderPaymentFeeHandler.php @@ -55,6 +55,10 @@ use Mollie\Service\PaymentMethodService; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderPaymentFeeHandler { /** @var PaymentMethodService */ diff --git a/src/Handler/PaymentOption/PaymentOptionHandler.php b/src/Handler/PaymentOption/PaymentOptionHandler.php index 028f8cf5b..1fe2ab067 100644 --- a/src/Handler/PaymentOption/PaymentOptionHandler.php +++ b/src/Handler/PaymentOption/PaymentOptionHandler.php @@ -47,6 +47,10 @@ use Mollie\Provider\PaymentOption\IdealPaymentOptionProvider; use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentOptionHandler implements PaymentOptionHandlerInterface { /** @@ -113,8 +117,6 @@ public function handle(MolPaymentMethod $paymentMethod) } /** - * @param MolPaymentMethod $paymentMethod - * * @return bool */ private function isIdealPaymentMethod(MolPaymentMethod $paymentMethod) @@ -130,21 +132,11 @@ private function isIdealPaymentMethod(MolPaymentMethod $paymentMethod) return true; } - /** - * @param MolPaymentMethod $paymentMethod - * - * @return bool - */ private function isCreditCardPaymentMethod(MolPaymentMethod $paymentMethod): bool { return PaymentMethod::CREDITCARD === $paymentMethod->getPaymentMethodName(); } - /** - * @param MolPaymentMethod $paymentMethod - * - * @return bool - */ private function isBancontactWithQRCodePaymentMethod(MolPaymentMethod $paymentMethod): bool { $isBancontactMethod = PaymentMethod::BANCONTACT === $paymentMethod->getPaymentMethodName(); diff --git a/src/Handler/PaymentOption/PaymentOptionHandlerInterface.php b/src/Handler/PaymentOption/PaymentOptionHandlerInterface.php index cf40ca2a6..001af25c5 100644 --- a/src/Handler/PaymentOption/PaymentOptionHandlerInterface.php +++ b/src/Handler/PaymentOption/PaymentOptionHandlerInterface.php @@ -39,11 +39,13 @@ use MolPaymentMethod; use PrestaShop\PrestaShop\Core\Payment\PaymentOption; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PaymentOptionHandlerInterface { /** - * @param MolPaymentMethod $paymentMethod - * * @return PaymentOption */ public function handle(MolPaymentMethod $paymentMethod); diff --git a/src/Handler/RetryHandler.php b/src/Handler/RetryHandler.php index 2ca03d860..150e61985 100644 --- a/src/Handler/RetryHandler.php +++ b/src/Handler/RetryHandler.php @@ -14,6 +14,10 @@ use Mollie\Exception\RetryOverException; +if (!defined('_PS_VERSION_')) { + exit; +} + class RetryHandler implements RetryHandlerInterface { private const DEFAULT_MAX_RETRY = 3; diff --git a/src/Handler/Settings/PaymentMethodPositionHandler.php b/src/Handler/Settings/PaymentMethodPositionHandler.php index 64262761e..c89a02104 100644 --- a/src/Handler/Settings/PaymentMethodPositionHandler.php +++ b/src/Handler/Settings/PaymentMethodPositionHandler.php @@ -14,6 +14,10 @@ use Mollie\Repository\PaymentMethodRepositoryInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + final class PaymentMethodPositionHandler implements PaymentMethodPositionHandlerInterface { private $paymentMethodRepository; diff --git a/src/Handler/Shipment/ShipmentSenderHandler.php b/src/Handler/Shipment/ShipmentSenderHandler.php index 2999e80d7..2ec901cca 100644 --- a/src/Handler/Shipment/ShipmentSenderHandler.php +++ b/src/Handler/Shipment/ShipmentSenderHandler.php @@ -20,6 +20,10 @@ use Order; use OrderState; +if (!defined('_PS_VERSION_')) { + exit; +} + class ShipmentSenderHandler implements ShipmentSenderHandlerInterface { /** diff --git a/src/Infrastructure/Adapter/Lock.php b/src/Infrastructure/Adapter/Lock.php index 8c3978734..f9e8bd1b8 100644 --- a/src/Infrastructure/Adapter/Lock.php +++ b/src/Infrastructure/Adapter/Lock.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Infrastructure\Adapter; @@ -9,6 +19,10 @@ use Symfony\Component\Lock\LockInterface; use Symfony\Component\Lock\Store\FlockStore; +if (!defined('_PS_VERSION_')) { + exit; +} + class Lock { private $lockFactory; diff --git a/src/Infrastructure/Adapter/index.php b/src/Infrastructure/Adapter/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/src/Infrastructure/Adapter/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Infrastructure/Exception/CouldNotHandleLocking.php b/src/Infrastructure/Exception/CouldNotHandleLocking.php index c6c23fe58..226b42e9a 100644 --- a/src/Infrastructure/Exception/CouldNotHandleLocking.php +++ b/src/Infrastructure/Exception/CouldNotHandleLocking.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Infrastructure\Exception; use Mollie\Exception\Code\ExceptionCode; use Mollie\Exception\MollieException; +if (!defined('_PS_VERSION_')) { + exit; +} + class CouldNotHandleLocking extends MollieException { public static function lockExists(): self diff --git a/src/Infrastructure/Exception/index.php b/src/Infrastructure/Exception/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/src/Infrastructure/Exception/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Infrastructure/Response/JsonResponse.php b/src/Infrastructure/Response/JsonResponse.php index f568dcebf..3b229b688 100644 --- a/src/Infrastructure/Response/JsonResponse.php +++ b/src/Infrastructure/Response/JsonResponse.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Infrastructure\Response; use Symfony\Component\HttpFoundation\JsonResponse as BaseJsonResponse; +if (!defined('_PS_VERSION_')) { + exit; +} + class JsonResponse extends BaseJsonResponse { /** diff --git a/src/Infrastructure/Response/Response.php b/src/Infrastructure/Response/Response.php index a97cbbfdb..75b951b75 100644 --- a/src/Infrastructure/Response/Response.php +++ b/src/Infrastructure/Response/Response.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Infrastructure\Response; use Symfony\Component\HttpFoundation\Response as BaseResponse; +if (!defined('_PS_VERSION_')) { + exit; +} + class Response extends BaseResponse { /** diff --git a/src/Infrastructure/Response/index.php b/src/Infrastructure/Response/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/src/Infrastructure/Response/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Infrastructure/index.php b/src/Infrastructure/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/src/Infrastructure/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Install/DatabaseTableInstaller.php b/src/Install/DatabaseTableInstaller.php index 7815d683d..b931e2b5c 100644 --- a/src/Install/DatabaseTableInstaller.php +++ b/src/Install/DatabaseTableInstaller.php @@ -14,6 +14,10 @@ use Db; +if (!defined('_PS_VERSION_')) { + exit; +} + final class DatabaseTableInstaller implements InstallerInterface { public function install() diff --git a/src/Install/Installer.php b/src/Install/Installer.php index 72a3eb6d8..49fabbf5d 100644 --- a/src/Install/Installer.php +++ b/src/Install/Installer.php @@ -32,6 +32,10 @@ use Tools; use Validate; +if (!defined('_PS_VERSION_')) { + exit; +} + class Installer implements InstallerInterface { const FILE_NAME = 'Installer'; diff --git a/src/Install/InstallerInterface.php b/src/Install/InstallerInterface.php index 0bba15f92..1d773e9ff 100644 --- a/src/Install/InstallerInterface.php +++ b/src/Install/InstallerInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Install; +if (!defined('_PS_VERSION_')) { + exit; +} + interface InstallerInterface { /** diff --git a/src/Install/OrderStateInstaller.php b/src/Install/OrderStateInstaller.php index 1d1d92325..5dd1e4c0a 100644 --- a/src/Install/OrderStateInstaller.php +++ b/src/Install/OrderStateInstaller.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Install; @@ -11,6 +21,10 @@ use Mollie\Service\OrderStateImageService; use OrderState; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderStateInstaller implements InstallerInterface { /** @var ModuleFactory */ diff --git a/src/Install/Uninstall.php b/src/Install/Uninstall.php index c89dd7073..10b8c2566 100644 --- a/src/Install/Uninstall.php +++ b/src/Install/Uninstall.php @@ -17,6 +17,10 @@ use Mollie\Tracker\Segment; use Tab; +if (!defined('_PS_VERSION_')) { + exit; +} + class Uninstall { /** diff --git a/src/Install/UninstallerInterface.php b/src/Install/UninstallerInterface.php index c36fecfc2..98647c27a 100644 --- a/src/Install/UninstallerInterface.php +++ b/src/Install/UninstallerInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Install; +if (!defined('_PS_VERSION_')) { + exit; +} + interface UninstallerInterface { /** diff --git a/src/Logger/PrestaLoggerInterface.php b/src/Logger/PrestaLoggerInterface.php index 5d55bd00f..7f0c448ed 100644 --- a/src/Logger/PrestaLoggerInterface.php +++ b/src/Logger/PrestaLoggerInterface.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Logger; use Psr\Log\LoggerInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PrestaLoggerInterface extends LoggerInterface { } diff --git a/src/Presenter/OrderListActionBuilder.php b/src/Presenter/OrderListActionBuilder.php index 50c6291ef..25b062dda 100644 --- a/src/Presenter/OrderListActionBuilder.php +++ b/src/Presenter/OrderListActionBuilder.php @@ -15,6 +15,10 @@ use Mollie; use Mollie\Adapter\Smarty; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderListActionBuilder { const FILE_NAME = 'OrderListActionBuilder'; diff --git a/src/Provider/AbstractCustomLogoProvider.php b/src/Provider/AbstractCustomLogoProvider.php index 5c9976e7a..e26f6450c 100644 --- a/src/Provider/AbstractCustomLogoProvider.php +++ b/src/Provider/AbstractCustomLogoProvider.php @@ -12,6 +12,10 @@ namespace Mollie\Provider; +if (!defined('_PS_VERSION_')) { + exit; +} + abstract class AbstractCustomLogoProvider implements CustomLogoProviderInterface { /** diff --git a/src/Provider/CreditCardLogoProvider.php b/src/Provider/CreditCardLogoProvider.php index 808ecfe03..bc1dee093 100644 --- a/src/Provider/CreditCardLogoProvider.php +++ b/src/Provider/CreditCardLogoProvider.php @@ -19,6 +19,10 @@ use Mollie\Utility\ImageUtility; use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + final class CreditCardLogoProvider extends AbstractCustomLogoProvider { /** diff --git a/src/Provider/EnvironmentVersionProvider.php b/src/Provider/EnvironmentVersionProvider.php index 259519a5e..36ba3ac19 100644 --- a/src/Provider/EnvironmentVersionProvider.php +++ b/src/Provider/EnvironmentVersionProvider.php @@ -12,6 +12,10 @@ namespace Mollie\Provider; +if (!defined('_PS_VERSION_')) { + exit; +} + class EnvironmentVersionProvider implements EnvironmentVersionProviderInterface { /** diff --git a/src/Provider/OrderTotal/OrderTotalProvider.php b/src/Provider/OrderTotal/OrderTotalProvider.php index b2c52a4f8..4219b4ee4 100644 --- a/src/Provider/OrderTotal/OrderTotalProvider.php +++ b/src/Provider/OrderTotal/OrderTotalProvider.php @@ -39,6 +39,10 @@ use Exception; use Mollie\Adapter\LegacyContext; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderTotalProvider implements OrderTotalProviderInterface { /** @@ -52,8 +56,6 @@ public function __construct(LegacyContext $context) } /** - * @return float - * * @throws Exception */ public function getOrderTotal(): float diff --git a/src/Provider/PaymentFeeProvider.php b/src/Provider/PaymentFeeProvider.php index 10c55e689..e6d0b9706 100644 --- a/src/Provider/PaymentFeeProvider.php +++ b/src/Provider/PaymentFeeProvider.php @@ -46,6 +46,10 @@ use Mollie\Repository\AddressRepositoryInterface; use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentFeeProvider implements PaymentFeeProviderInterface { /** @var Context */ diff --git a/src/Provider/PaymentFeeProviderInterface.php b/src/Provider/PaymentFeeProviderInterface.php index 756795c6f..878fdb837 100644 --- a/src/Provider/PaymentFeeProviderInterface.php +++ b/src/Provider/PaymentFeeProviderInterface.php @@ -40,6 +40,10 @@ use Mollie\Exception\FailedToProvidePaymentFeeException; use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PaymentFeeProviderInterface { /** diff --git a/src/Provider/PaymentOption/BancontactPaymentOptionProvider.php b/src/Provider/PaymentOption/BancontactPaymentOptionProvider.php index a8ea23fdd..9c4a0ddd2 100644 --- a/src/Provider/PaymentOption/BancontactPaymentOptionProvider.php +++ b/src/Provider/PaymentOption/BancontactPaymentOptionProvider.php @@ -47,6 +47,10 @@ use PrestaShop\PrestaShop\Core\Payment\PaymentOption; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class BancontactPaymentOptionProvider implements PaymentOptionProviderInterface { const FILE_NAME = 'BancontactPaymentOptionProvider'; diff --git a/src/Provider/PaymentOption/BasePaymentOptionProvider.php b/src/Provider/PaymentOption/BasePaymentOptionProvider.php index 33580b119..4e5dcd064 100644 --- a/src/Provider/PaymentOption/BasePaymentOptionProvider.php +++ b/src/Provider/PaymentOption/BasePaymentOptionProvider.php @@ -46,6 +46,10 @@ use PrestaShop\PrestaShop\Core\Payment\PaymentOption; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class BasePaymentOptionProvider implements PaymentOptionProviderInterface { const FILE_NAME = 'BasePaymentOptionProvider'; diff --git a/src/Provider/PaymentOption/CreditCardPaymentOptionProvider.php b/src/Provider/PaymentOption/CreditCardPaymentOptionProvider.php index cfe183703..e43a7d299 100644 --- a/src/Provider/PaymentOption/CreditCardPaymentOptionProvider.php +++ b/src/Provider/PaymentOption/CreditCardPaymentOptionProvider.php @@ -52,6 +52,10 @@ use PrestaShop\PrestaShop\Core\Payment\PaymentOption; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreditCardPaymentOptionProvider implements PaymentOptionProviderInterface { const FILE_NAME = 'CreditCardPaymentOptionProvider'; diff --git a/src/Provider/PaymentOption/CreditCardSingleClickPaymentOptionProvider.php b/src/Provider/PaymentOption/CreditCardSingleClickPaymentOptionProvider.php index 4739aa2d1..b3163165d 100644 --- a/src/Provider/PaymentOption/CreditCardSingleClickPaymentOptionProvider.php +++ b/src/Provider/PaymentOption/CreditCardSingleClickPaymentOptionProvider.php @@ -51,6 +51,10 @@ use PrestaShop\PrestaShop\Core\Payment\PaymentOption; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreditCardSingleClickPaymentOptionProvider implements PaymentOptionProviderInterface { const FILE_NAME = 'CreditCardSingleClickPaymentOptionProvider'; diff --git a/src/Provider/PaymentOption/IdealPaymentOptionProvider.php b/src/Provider/PaymentOption/IdealPaymentOptionProvider.php index d089700d8..dbf78324c 100644 --- a/src/Provider/PaymentOption/IdealPaymentOptionProvider.php +++ b/src/Provider/PaymentOption/IdealPaymentOptionProvider.php @@ -48,6 +48,10 @@ use PrestaShop\PrestaShop\Core\Payment\PaymentOption; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class IdealPaymentOptionProvider implements PaymentOptionProviderInterface { const FILE_NAME = 'IdealPaymentOptionProvider'; diff --git a/src/Provider/PaymentOption/PaymentOptionProviderInterface.php b/src/Provider/PaymentOption/PaymentOptionProviderInterface.php index 8d463f0c8..1d12c51ac 100644 --- a/src/Provider/PaymentOption/PaymentOptionProviderInterface.php +++ b/src/Provider/PaymentOption/PaymentOptionProviderInterface.php @@ -39,12 +39,11 @@ use MolPaymentMethod; use PrestaShop\PrestaShop\Core\Payment\PaymentOption; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PaymentOptionProviderInterface { - /** - * @param MolPaymentMethod $paymentMethod - * - * @return PaymentOption - */ public function getPaymentOption(MolPaymentMethod $paymentMethod): PaymentOption; } diff --git a/src/Provider/PaymentType/PaymentTypeIdentificationProviderInterface.php b/src/Provider/PaymentType/PaymentTypeIdentificationProviderInterface.php index 776ba19dd..c3efeebee 100644 --- a/src/Provider/PaymentType/PaymentTypeIdentificationProviderInterface.php +++ b/src/Provider/PaymentType/PaymentTypeIdentificationProviderInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Provider\PaymentType; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PaymentTypeIdentificationProviderInterface { /** diff --git a/src/Provider/PaymentType/RegularInterfacePaymentTypeIdentification.php b/src/Provider/PaymentType/RegularInterfacePaymentTypeIdentification.php index 7544d3b2c..eb5995c62 100644 --- a/src/Provider/PaymentType/RegularInterfacePaymentTypeIdentification.php +++ b/src/Provider/PaymentType/RegularInterfacePaymentTypeIdentification.php @@ -14,6 +14,10 @@ use Mollie\Api\Endpoints\OrderEndpoint; +if (!defined('_PS_VERSION_')) { + exit; +} + class RegularInterfacePaymentTypeIdentification implements PaymentTypeIdentificationProviderInterface { /** diff --git a/src/Provider/PhoneNumberProvider.php b/src/Provider/PhoneNumberProvider.php index 11e5e5c5c..022d144a5 100644 --- a/src/Provider/PhoneNumberProvider.php +++ b/src/Provider/PhoneNumberProvider.php @@ -14,6 +14,10 @@ use Address; +if (!defined('_PS_VERSION_')) { + exit; +} + final class PhoneNumberProvider implements PhoneNumberProviderInterface { public function getFromAddress(Address $address) diff --git a/src/Provider/PhoneNumberProviderInterface.php b/src/Provider/PhoneNumberProviderInterface.php index d16bc073f..624ef4b1f 100644 --- a/src/Provider/PhoneNumberProviderInterface.php +++ b/src/Provider/PhoneNumberProviderInterface.php @@ -14,6 +14,10 @@ use Address; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PhoneNumberProviderInterface { /** diff --git a/src/Provider/ProfileIdProvider.php b/src/Provider/ProfileIdProvider.php index 962b42abe..de2eb09e1 100644 --- a/src/Provider/ProfileIdProvider.php +++ b/src/Provider/ProfileIdProvider.php @@ -15,6 +15,10 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\MollieApiClient; +if (!defined('_PS_VERSION_')) { + exit; +} + class ProfileIdProvider implements ProfileIdProviderInterface { public function getProfileId(MollieApiClient $apiClient): string diff --git a/src/Provider/ProfileIdProviderInterface.php b/src/Provider/ProfileIdProviderInterface.php index d01674502..3f6fa3116 100644 --- a/src/Provider/ProfileIdProviderInterface.php +++ b/src/Provider/ProfileIdProviderInterface.php @@ -14,6 +14,10 @@ use Mollie\Api\MollieApiClient; +if (!defined('_PS_VERSION_')) { + exit; +} + interface ProfileIdProviderInterface { public function getProfileId(MollieApiClient $apiClient): string; diff --git a/src/Provider/Shipment/AutomaticShipmentSenderStatusesProvider.php b/src/Provider/Shipment/AutomaticShipmentSenderStatusesProvider.php index e23cd1132..9aa7d4d5c 100644 --- a/src/Provider/Shipment/AutomaticShipmentSenderStatusesProvider.php +++ b/src/Provider/Shipment/AutomaticShipmentSenderStatusesProvider.php @@ -16,6 +16,10 @@ use Mollie\Config\Config; use Mollie\Utility\Decoder\DecoderInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class AutomaticShipmentSenderStatusesProvider implements AutomaticShipmentSenderStatusesProviderInterface { /** diff --git a/src/Provider/TaxCalculatorProvider.php b/src/Provider/TaxCalculatorProvider.php index d26388972..d7a001ad8 100644 --- a/src/Provider/TaxCalculatorProvider.php +++ b/src/Provider/TaxCalculatorProvider.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Provider; @@ -7,6 +17,10 @@ use Tax; use TaxCalculator; +if (!defined('_PS_VERSION_')) { + exit; +} + class TaxCalculatorProvider { /** @var TaxRuleRepositoryInterface */ @@ -22,13 +36,6 @@ public function __construct( $this->taxRepository = $taxRepository; } - /** - * @param int $taxRulesGroupId - * @param int $countryId - * @param int $stateId - * - * @return TaxCalculator - */ public function getTaxCalculator(int $taxRulesGroupId, int $countryId, int $stateId): TaxCalculator { $taxRules = $this->taxRuleRepository->getTaxRule( diff --git a/src/Repository/AbstractRepository.php b/src/Repository/AbstractRepository.php index 7cb4dae31..547156bec 100644 --- a/src/Repository/AbstractRepository.php +++ b/src/Repository/AbstractRepository.php @@ -16,6 +16,10 @@ use PrestaShopCollection; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + class AbstractRepository implements ReadOnlyRepositoryInterface { /** @@ -42,8 +46,6 @@ public function findAll() } /** - * @param array $keyValueCriteria - * * @return ObjectModel|null * * @throws PrestaShopException @@ -63,8 +65,6 @@ public function findOneBy(array $keyValueCriteria) } /** - * @param array $keyValueCriteria - * * @return PrestaShopCollection|null * * @throws PrestaShopException diff --git a/src/Repository/AddressFormatRepository.php b/src/Repository/AddressFormatRepository.php index de9cad0a6..cb419c13c 100644 --- a/src/Repository/AddressFormatRepository.php +++ b/src/Repository/AddressFormatRepository.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class AddressFormatRepository extends AbstractRepository implements AddressFormatRepositoryInterface { public function __construct() diff --git a/src/Repository/AddressFormatRepositoryInterface.php b/src/Repository/AddressFormatRepositoryInterface.php index 68729d151..f7ec691c6 100644 --- a/src/Repository/AddressFormatRepositoryInterface.php +++ b/src/Repository/AddressFormatRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface AddressFormatRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/src/Repository/AddressRepository.php b/src/Repository/AddressRepository.php index 06696a498..55d30605a 100644 --- a/src/Repository/AddressRepository.php +++ b/src/Repository/AddressRepository.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class AddressRepository extends AbstractRepository implements AddressRepositoryInterface { public function __construct() diff --git a/src/Repository/AddressRepositoryInterface.php b/src/Repository/AddressRepositoryInterface.php index cab93f85f..d18a807af 100644 --- a/src/Repository/AddressRepositoryInterface.php +++ b/src/Repository/AddressRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface AddressRepositoryInterface extends ReadOnlyRepositoryInterface { public function getZoneById(int $id_address_delivery): int; diff --git a/src/Repository/AttributeRepository.php b/src/Repository/AttributeRepository.php index 4940e83ad..70b9fb0a2 100644 --- a/src/Repository/AttributeRepository.php +++ b/src/Repository/AttributeRepository.php @@ -15,6 +15,10 @@ use Db; use DbQuery; +if (!defined('_PS_VERSION_')) { + exit; +} + class AttributeRepository { public function hasAttributeInCombination($attrCombinationId, $attributeId) diff --git a/src/Repository/CarrierRepository.php b/src/Repository/CarrierRepository.php index 6dc12293d..2131dbe21 100644 --- a/src/Repository/CarrierRepository.php +++ b/src/Repository/CarrierRepository.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class CarrierRepository extends AbstractRepository implements CarrierRepositoryInterface { public function __construct() diff --git a/src/Repository/CarrierRepositoryInterface.php b/src/Repository/CarrierRepositoryInterface.php index a53daf595..fb38a9f44 100644 --- a/src/Repository/CarrierRepositoryInterface.php +++ b/src/Repository/CarrierRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface CarrierRepositoryInterface extends ReadOnlyRepositoryInterface { public function getCarriersForOrder(int $id_zone, array $groups = null, \Cart $cart = null, &$error = []): array; diff --git a/src/Repository/CartRepository.php b/src/Repository/CartRepository.php index bdc1db6af..da4e538b9 100644 --- a/src/Repository/CartRepository.php +++ b/src/Repository/CartRepository.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; use Cart; +if (!defined('_PS_VERSION_')) { + exit; +} + class CartRepository extends AbstractRepository implements CartRepositoryInterface { public function __construct() diff --git a/src/Repository/CartRepositoryInterface.php b/src/Repository/CartRepositoryInterface.php index 9db417d98..c2afd896b 100644 --- a/src/Repository/CartRepositoryInterface.php +++ b/src/Repository/CartRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface CartRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/src/Repository/CartRuleRepository.php b/src/Repository/CartRuleRepository.php index 5d1ffa966..21566ca07 100644 --- a/src/Repository/CartRuleRepository.php +++ b/src/Repository/CartRuleRepository.php @@ -14,6 +14,10 @@ use CartRule; +if (!defined('_PS_VERSION_')) { + exit; +} + final class CartRuleRepository extends AbstractRepository implements CartRuleRepositoryInterface { public function __construct() diff --git a/src/Repository/CartRuleRepositoryInterface.php b/src/Repository/CartRuleRepositoryInterface.php index c09c805d8..aad9a5914 100644 --- a/src/Repository/CartRuleRepositoryInterface.php +++ b/src/Repository/CartRuleRepositoryInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface CartRuleRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/src/Repository/CountryRepository.php b/src/Repository/CountryRepository.php index bf6313d8b..69fdd3396 100644 --- a/src/Repository/CountryRepository.php +++ b/src/Repository/CountryRepository.php @@ -15,6 +15,10 @@ use Country; use Db; +if (!defined('_PS_VERSION_')) { + exit; +} + final class CountryRepository extends AbstractRepository implements CountryRepositoryInterface { public function __construct() diff --git a/src/Repository/CountryRepositoryInterface.php b/src/Repository/CountryRepositoryInterface.php index 446b142a6..3f9f5f13f 100644 --- a/src/Repository/CountryRepositoryInterface.php +++ b/src/Repository/CountryRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface CountryRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/src/Repository/CurrencyRepository.php b/src/Repository/CurrencyRepository.php index 9a3529907..440b55379 100644 --- a/src/Repository/CurrencyRepository.php +++ b/src/Repository/CurrencyRepository.php @@ -38,6 +38,10 @@ use Currency; +if (!defined('_PS_VERSION_')) { + exit; +} + class CurrencyRepository extends AbstractRepository implements CurrencyRepositoryInterface { public function __construct() diff --git a/src/Repository/CurrencyRepositoryInterface.php b/src/Repository/CurrencyRepositoryInterface.php index b7a98c617..891e93609 100644 --- a/src/Repository/CurrencyRepositoryInterface.php +++ b/src/Repository/CurrencyRepositoryInterface.php @@ -36,6 +36,10 @@ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface CurrencyRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/src/Repository/CustomerRepository.php b/src/Repository/CustomerRepository.php index 75841fb3d..178230bc5 100644 --- a/src/Repository/CustomerRepository.php +++ b/src/Repository/CustomerRepository.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class CustomerRepository extends AbstractRepository implements CustomerRepositoryInterface { public function __construct() diff --git a/src/Repository/CustomerRepositoryInterface.php b/src/Repository/CustomerRepositoryInterface.php index 50be48312..eee2e18e4 100644 --- a/src/Repository/CustomerRepositoryInterface.php +++ b/src/Repository/CustomerRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface CustomerRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/src/Repository/GenderRepository.php b/src/Repository/GenderRepository.php index beb9b3832..807dc21bc 100644 --- a/src/Repository/GenderRepository.php +++ b/src/Repository/GenderRepository.php @@ -36,6 +36,10 @@ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class GenderRepository extends AbstractRepository implements GenderRepositoryInterface { public function __construct() diff --git a/src/Repository/GenderRepositoryInterface.php b/src/Repository/GenderRepositoryInterface.php index f98a21a00..40e4e7ecc 100644 --- a/src/Repository/GenderRepositoryInterface.php +++ b/src/Repository/GenderRepositoryInterface.php @@ -36,6 +36,10 @@ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface GenderRepositoryInterface extends \Mollie\Repository\ReadOnlyRepositoryInterface { } diff --git a/src/Repository/MethodCountryRepository.php b/src/Repository/MethodCountryRepository.php index cd0eadb8b..3913ba7eb 100644 --- a/src/Repository/MethodCountryRepository.php +++ b/src/Repository/MethodCountryRepository.php @@ -15,6 +15,10 @@ use Db; use DbQuery; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * Repository related with payment methods country. */ diff --git a/src/Repository/ModuleRepository.php b/src/Repository/ModuleRepository.php index a97fe8dea..36fbc9d10 100644 --- a/src/Repository/ModuleRepository.php +++ b/src/Repository/ModuleRepository.php @@ -15,6 +15,10 @@ use Db; use DbQuery; +if (!defined('_PS_VERSION_')) { + exit; +} + class ModuleRepository { public function getModuleDatabaseVersion($moduleName) diff --git a/src/Repository/MolCarrierInformationRepository.php b/src/Repository/MolCarrierInformationRepository.php index 6b0938575..63b123838 100644 --- a/src/Repository/MolCarrierInformationRepository.php +++ b/src/Repository/MolCarrierInformationRepository.php @@ -15,6 +15,10 @@ use Db; use DbQuery; +if (!defined('_PS_VERSION_')) { + exit; +} + class MolCarrierInformationRepository { public function getMollieCarrierInformationIdByCarrierId($carrierId) diff --git a/src/Repository/MolCustomerRepository.php b/src/Repository/MolCustomerRepository.php index ccd42ef21..af6088392 100644 --- a/src/Repository/MolCustomerRepository.php +++ b/src/Repository/MolCustomerRepository.php @@ -14,6 +14,10 @@ use MolCustomer; +if (!defined('_PS_VERSION_')) { + exit; +} + class MolCustomerRepository extends AbstractRepository { public function findOneBy(array $keyValueCriteria): ?MolCustomer diff --git a/src/Repository/MolOrderPaymentFeeRepository.php b/src/Repository/MolOrderPaymentFeeRepository.php index b9694d710..4cca4fdf7 100644 --- a/src/Repository/MolOrderPaymentFeeRepository.php +++ b/src/Repository/MolOrderPaymentFeeRepository.php @@ -14,6 +14,10 @@ use MolOrderPaymentFee; +if (!defined('_PS_VERSION_')) { + exit; +} + class MolOrderPaymentFeeRepository extends AbstractRepository implements MolOrderPaymentFeeRepositoryInterface { public function __construct() diff --git a/src/Repository/MolOrderPaymentFeeRepositoryInterface.php b/src/Repository/MolOrderPaymentFeeRepositoryInterface.php index 390e2a0d7..9d39dec27 100644 --- a/src/Repository/MolOrderPaymentFeeRepositoryInterface.php +++ b/src/Repository/MolOrderPaymentFeeRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface MolOrderPaymentFeeRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/src/Repository/OrderCartRuleRepository.php b/src/Repository/OrderCartRuleRepository.php index 186b9ec97..b0f71d435 100644 --- a/src/Repository/OrderCartRuleRepository.php +++ b/src/Repository/OrderCartRuleRepository.php @@ -15,6 +15,10 @@ use Db; use OrderCartRule; +if (!defined('_PS_VERSION_')) { + exit; +} + final class OrderCartRuleRepository extends AbstractRepository implements OrderCartRuleRepositoryInterface { public function __construct() diff --git a/src/Repository/OrderCartRuleRepositoryInterface.php b/src/Repository/OrderCartRuleRepositoryInterface.php index 8e769a826..d7c4d73d5 100644 --- a/src/Repository/OrderCartRuleRepositoryInterface.php +++ b/src/Repository/OrderCartRuleRepositoryInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface OrderCartRuleRepositoryInterface extends ReadOnlyRepositoryInterface { /** diff --git a/src/Repository/OrderRepository.php b/src/Repository/OrderRepository.php index ee1f5b0a7..82d43d1f4 100644 --- a/src/Repository/OrderRepository.php +++ b/src/Repository/OrderRepository.php @@ -14,6 +14,10 @@ use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + final class OrderRepository extends AbstractRepository implements OrderRepositoryInterface { public function __construct() diff --git a/src/Repository/OrderRepositoryInterface.php b/src/Repository/OrderRepositoryInterface.php index 418c2b939..b4ede2e80 100644 --- a/src/Repository/OrderRepositoryInterface.php +++ b/src/Repository/OrderRepositoryInterface.php @@ -14,6 +14,10 @@ use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + interface OrderRepositoryInterface extends ReadOnlyRepositoryInterface { /** diff --git a/src/Repository/OrderShipmentRepository.php b/src/Repository/OrderShipmentRepository.php index 207581cb7..902418129 100644 --- a/src/Repository/OrderShipmentRepository.php +++ b/src/Repository/OrderShipmentRepository.php @@ -15,6 +15,10 @@ use Db; use DbQuery; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderShipmentRepository { public function getShipmentInformation($table, $orderId) diff --git a/src/Repository/OrderStateRepository.php b/src/Repository/OrderStateRepository.php index 76f8838d6..4971cd423 100644 --- a/src/Repository/OrderStateRepository.php +++ b/src/Repository/OrderStateRepository.php @@ -15,6 +15,10 @@ use Db; use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderStateRepository { public function deleteStatuses() diff --git a/src/Repository/PaymentMethodRepository.php b/src/Repository/PaymentMethodRepository.php index 8c7b66f94..555d6256e 100644 --- a/src/Repository/PaymentMethodRepository.php +++ b/src/Repository/PaymentMethodRepository.php @@ -22,6 +22,10 @@ use PDOStatement; use PrestaShopDatabaseException; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * @deprecated - outside code must always use interface. Use PaymentMethodRepositoryInterface instead. * In Containers use PaymentMethodRepositoryInterface::class @@ -58,9 +62,7 @@ public function deletePaymentMethodIssuersByPaymentMethodId($paymentMethodId) } /** - * @param array $savedPaymentMethods * @param int $environment - * @param int $shopId * * @return bool */ @@ -88,7 +90,7 @@ public function getPaymentMethodIdByMethodId($paymentMethodId, $environment, $sh } $sql = 'SELECT id_payment_method FROM `' . _DB_PREFIX_ . 'mol_payment_method` - WHERE id_method = "' . pSQL($paymentMethodId) . '" AND live_environment = "' . (int) $environment . '" + WHERE id_method = "' . pSQL($paymentMethodId) . '" AND live_environment = "' . (int) $environment . '" AND id_shop = ' . (int) $shopId; return Db::getInstance()->getValue($sql); diff --git a/src/Repository/PaymentMethodRepositoryInterface.php b/src/Repository/PaymentMethodRepositoryInterface.php index 1106e7440..7725fa546 100644 --- a/src/Repository/PaymentMethodRepositoryInterface.php +++ b/src/Repository/PaymentMethodRepositoryInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PaymentMethodRepositoryInterface extends ReadOnlyRepositoryInterface { public function getPaymentMethodIssuersByPaymentMethodId($paymentMethodId); diff --git a/src/Repository/PendingOrderCartRepository.php b/src/Repository/PendingOrderCartRepository.php index 2b9aa54b1..8af8e5045 100644 --- a/src/Repository/PendingOrderCartRepository.php +++ b/src/Repository/PendingOrderCartRepository.php @@ -12,6 +12,10 @@ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + final class PendingOrderCartRepository extends AbstractRepository { } diff --git a/src/Repository/PendingOrderCartRuleRepository.php b/src/Repository/PendingOrderCartRuleRepository.php index 4b4ce3510..7ae87c8ae 100644 --- a/src/Repository/PendingOrderCartRuleRepository.php +++ b/src/Repository/PendingOrderCartRuleRepository.php @@ -17,6 +17,10 @@ use Order; use OrderCartRule; +if (!defined('_PS_VERSION_')) { + exit; +} + final class PendingOrderCartRuleRepository extends AbstractRepository implements PendingOrderCartRuleRepositoryInterface { public function __construct() diff --git a/src/Repository/PendingOrderCartRuleRepositoryInterface.php b/src/Repository/PendingOrderCartRuleRepositoryInterface.php index bf7f5f3c2..179522094 100644 --- a/src/Repository/PendingOrderCartRuleRepositoryInterface.php +++ b/src/Repository/PendingOrderCartRuleRepositoryInterface.php @@ -16,6 +16,10 @@ use Order; use OrderCartRule; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PendingOrderCartRuleRepositoryInterface extends ReadOnlyRepositoryInterface { /** @@ -29,15 +33,11 @@ public function removePreviousPendingOrderCartRule($orderId, $cartRuleId); * * @param int $orderId * @param int $cartRuleId - * @param OrderCartRule $orderCartRule */ public function createPendingOrderCartRule($orderId, $cartRuleId, OrderCartRule $orderCartRule); /** * Used to create OrderCartRule from MolPendingOrderCartRule - * - * @param Order $order - * @param MolPendingOrderCartRule $pendingOrderCartRule */ public function usePendingOrderCartRule(Order $order, MolPendingOrderCartRule $pendingOrderCartRule); } diff --git a/src/Repository/ProductRepository.php b/src/Repository/ProductRepository.php index dafa55496..90e17b9a8 100644 --- a/src/Repository/ProductRepository.php +++ b/src/Repository/ProductRepository.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class ProductRepository extends AbstractRepository implements ProductRepositoryInterface { public function __construct() diff --git a/src/Repository/ProductRepositoryInterface.php b/src/Repository/ProductRepositoryInterface.php index c02b57d08..fd9cecfd5 100644 --- a/src/Repository/ProductRepositoryInterface.php +++ b/src/Repository/ProductRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface ProductRepositoryInterface extends ReadOnlyRepositoryInterface { public function getCombinationImageById(int $productAttributeId, int $langId): ?array; diff --git a/src/Repository/ReadOnlyRepositoryInterface.php b/src/Repository/ReadOnlyRepositoryInterface.php index f7d5fe12e..783717dc7 100644 --- a/src/Repository/ReadOnlyRepositoryInterface.php +++ b/src/Repository/ReadOnlyRepositoryInterface.php @@ -15,6 +15,10 @@ use ObjectModel; use PrestaShopCollection; +if (!defined('_PS_VERSION_')) { + exit; +} + interface ReadOnlyRepositoryInterface { /** diff --git a/src/Repository/TaxRepository.php b/src/Repository/TaxRepository.php index e317edb82..446177045 100644 --- a/src/Repository/TaxRepository.php +++ b/src/Repository/TaxRepository.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class TaxRepository extends AbstractRepository implements TaxRepositoryInterface { public function __construct() diff --git a/src/Repository/TaxRepositoryInterface.php b/src/Repository/TaxRepositoryInterface.php index 046cb9532..04c602b56 100644 --- a/src/Repository/TaxRepositoryInterface.php +++ b/src/Repository/TaxRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface TaxRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/src/Repository/TaxRuleRepository.php b/src/Repository/TaxRuleRepository.php index 293d37bf4..759c22276 100644 --- a/src/Repository/TaxRuleRepository.php +++ b/src/Repository/TaxRuleRepository.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; use Db; use DbQuery; +if (!defined('_PS_VERSION_')) { + exit; +} + class TaxRuleRepository extends AbstractRepository implements TaxRuleRepositoryInterface { public function __construct() diff --git a/src/Repository/TaxRuleRepositoryInterface.php b/src/Repository/TaxRuleRepositoryInterface.php index 34338c709..269478abf 100644 --- a/src/Repository/TaxRuleRepositoryInterface.php +++ b/src/Repository/TaxRuleRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface TaxRuleRepositoryInterface extends ReadOnlyRepositoryInterface { public function getTaxRule(int $taxRulesGroupId, int $countryId, int $stateId): array; diff --git a/src/Repository/TaxRulesGroupRepository.php b/src/Repository/TaxRulesGroupRepository.php index 45d5fe81f..5899bd576 100644 --- a/src/Repository/TaxRulesGroupRepository.php +++ b/src/Repository/TaxRulesGroupRepository.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; use Db; use DbQuery; +if (!defined('_PS_VERSION_')) { + exit; +} + class TaxRulesGroupRepository extends AbstractRepository implements TaxRulesGroupRepositoryInterface { public function __construct() diff --git a/src/Repository/TaxRulesGroupRepositoryInterface.php b/src/Repository/TaxRulesGroupRepositoryInterface.php index f88334d94..4666ea9c1 100644 --- a/src/Repository/TaxRulesGroupRepositoryInterface.php +++ b/src/Repository/TaxRulesGroupRepositoryInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + interface TaxRulesGroupRepositoryInterface extends ReadOnlyRepositoryInterface { public function getTaxRulesGroups(int $shopId): array; diff --git a/src/Service/ApiKeyService.php b/src/Service/ApiKeyService.php index 487ace524..28bac6a09 100644 --- a/src/Service/ApiKeyService.php +++ b/src/Service/ApiKeyService.php @@ -18,6 +18,10 @@ use Mollie\Api\MollieApiClient; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class ApiKeyService { /** diff --git a/src/Service/ApiService.php b/src/Service/ApiService.php index 5af028622..ce72e8e42 100644 --- a/src/Service/ApiService.php +++ b/src/Service/ApiService.php @@ -34,6 +34,10 @@ use PrestaShopDatabaseException; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + class ApiService implements ApiServiceInterface { private $errors = []; @@ -101,8 +105,6 @@ public function __construct( /** * Get payment methods to show on the configuration page. * - * @param MollieApiClient $api - * * @return array * * @since 3.0.0 @@ -399,11 +401,6 @@ public function getFilteredApiOrder($api, $transactionId) } /** - * @param MollieApiClient|null $api - * @param string $validationUrl - * - * @return string - * * @throws ApiException * @throws MollieApiException */ diff --git a/src/Service/ApiServiceInterface.php b/src/Service/ApiServiceInterface.php index f6231e13f..a98f5cd94 100644 --- a/src/Service/ApiServiceInterface.php +++ b/src/Service/ApiServiceInterface.php @@ -16,14 +16,13 @@ use Mollie\Api\MollieApiClient; use Mollie\Exception\MollieApiException; +if (!defined('_PS_VERSION_')) { + exit; +} + interface ApiServiceInterface { /** - * @param MollieApiClient|null $api - * @param string $validationUrl - * - * @return string - * * @throws ApiException * @throws MollieApiException */ diff --git a/src/Service/CancelService.php b/src/Service/CancelService.php index 7aac0f23f..e506187be 100644 --- a/src/Service/CancelService.php +++ b/src/Service/CancelService.php @@ -18,6 +18,10 @@ use PrestaShopDatabaseException; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + class CancelService { const FILE_NAME = 'CancelService'; diff --git a/src/Service/CarrierService.php b/src/Service/CarrierService.php index 021b6cc4e..07768877c 100644 --- a/src/Service/CarrierService.php +++ b/src/Service/CarrierService.php @@ -17,6 +17,10 @@ use Context; use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class CarrierService { /** diff --git a/src/Service/CartLinesService.php b/src/Service/CartLinesService.php index cbb6ef3ad..0312ed108 100644 --- a/src/Service/CartLinesService.php +++ b/src/Service/CartLinesService.php @@ -24,6 +24,10 @@ use Mollie\Utility\NumberUtility; use Mollie\Utility\TextFormatUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class CartLinesService { /** @@ -159,10 +163,8 @@ public static function spreadCartLineGroup($cartLineGroup, $newTotal) } /** - * @param array $cartItems * @param int $apiRoundingPrecision * @param array $giftProducts - * @param array $orderLines * @param string $selectedVoucherCategory * @param float $remaining * @@ -299,7 +301,6 @@ private function compositeRoundingInaccuracies($remaining, $apiRoundingPrecision } /** - * @param array $orderLines * @param int $apiRoundingPrecision * @param int $vatRatePrecision * @@ -362,7 +363,6 @@ private function fillProductLinesWithRemainingData(array $orderLines, $apiRoundi * @param float $roundedShippingCost * @param array $cartSummary * @param int $apiRoundingPrecision - * @param array $orderLines * * @return array */ @@ -388,10 +388,8 @@ private function addShippingLine($roundedShippingCost, $cartSummary, $apiRoundin /** * @param float $wrappingPrice - * @param array $cartSummary * @param int $vatRatePrecision * @param int $apiRoundingPrecision - * @param array $orderLines * * @return array */ @@ -424,7 +422,6 @@ private function addWrappingLine($wrappingPrice, array $cartSummary, $vatRatePre /** * @param PaymentFeeData $paymentFeeData * @param int $apiRoundingPrecision - * @param array $orderLines * * @return array */ @@ -450,8 +447,6 @@ private function addPaymentFeeLine($paymentFeeData, $apiRoundingPrecision, array } /** - * @param array $orderLines - * * @return array */ private function ungroupLines(array $orderLines) @@ -467,7 +462,6 @@ private function ungroupLines(array $orderLines) } /** - * @param array $newItems * @param string $currencyIsoCode * @param int $apiRoundingPrecision * diff --git a/src/Service/ConfigFieldService.php b/src/Service/ConfigFieldService.php index 490f3a34a..74c275bd0 100644 --- a/src/Service/ConfigFieldService.php +++ b/src/Service/ConfigFieldService.php @@ -18,6 +18,10 @@ use Mollie\Repository\CountryRepository; use Mollie\Utility\EnvironmentUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class ConfigFieldService { /** diff --git a/src/Service/Content/SmartyTemplateParser.php b/src/Service/Content/SmartyTemplateParser.php index 9538315fb..f010e2d0a 100644 --- a/src/Service/Content/SmartyTemplateParser.php +++ b/src/Service/Content/SmartyTemplateParser.php @@ -15,11 +15,13 @@ use Mollie\Builder\TemplateBuilderInterface; use Smarty; +if (!defined('_PS_VERSION_')) { + exit; +} + class SmartyTemplateParser implements TemplateParserInterface { /** - * @param Smarty $smarty - * @param TemplateBuilderInterface $templateBuilder * @param string $templatePath * * @return string diff --git a/src/Service/Content/TemplateParserInterface.php b/src/Service/Content/TemplateParserInterface.php index 85c3fba26..a27d2bff7 100644 --- a/src/Service/Content/TemplateParserInterface.php +++ b/src/Service/Content/TemplateParserInterface.php @@ -15,11 +15,13 @@ use Mollie\Builder\TemplateBuilderInterface; use Smarty; +if (!defined('_PS_VERSION_')) { + exit; +} + interface TemplateParserInterface { /** - * @param Smarty $smarty - * @param TemplateBuilderInterface $templateBuilder * @param string $templatePath * * @return string diff --git a/src/Service/CountryService.php b/src/Service/CountryService.php index af9f41fd1..ca63fc3e7 100644 --- a/src/Service/CountryService.php +++ b/src/Service/CountryService.php @@ -16,6 +16,10 @@ use Country; use Mollie; +if (!defined('_PS_VERSION_')) { + exit; +} + class CountryService { const FILE_NAME = 'CountryService'; diff --git a/src/Service/CustomerService.php b/src/Service/CustomerService.php index 789907af9..4d2cd0176 100644 --- a/src/Service/CustomerService.php +++ b/src/Service/CustomerService.php @@ -18,6 +18,10 @@ use Mollie\Repository\MolCustomerRepository; use Mollie\Utility\CustomerUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class CustomerService { /** diff --git a/src/Service/EntityManager/EntityManagerInterface.php b/src/Service/EntityManager/EntityManagerInterface.php index 849e4610e..cb4877180 100644 --- a/src/Service/EntityManager/EntityManagerInterface.php +++ b/src/Service/EntityManager/EntityManagerInterface.php @@ -15,11 +15,13 @@ use ObjectModel; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + interface EntityManagerInterface { /** - * @param ObjectModel $model - * * @throws PrestaShopException */ public function flush(ObjectModel $model); diff --git a/src/Service/EntityManager/ObjectModelManager.php b/src/Service/EntityManager/ObjectModelManager.php index 55e0a8b30..62b1c4e64 100644 --- a/src/Service/EntityManager/ObjectModelManager.php +++ b/src/Service/EntityManager/ObjectModelManager.php @@ -14,11 +14,13 @@ use ObjectModel; +if (!defined('_PS_VERSION_')) { + exit; +} + class ObjectModelManager implements EntityManagerInterface { /** - * @param ObjectModel $model - * * @throws \PrestaShopException */ public function flush(ObjectModel $model) diff --git a/src/Service/ErrorDisplayService.php b/src/Service/ErrorDisplayService.php index b037cd644..cd4963f55 100644 --- a/src/Service/ErrorDisplayService.php +++ b/src/Service/ErrorDisplayService.php @@ -14,6 +14,10 @@ use Context; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class ErrorDisplayService { public function showCookieError($id) diff --git a/src/Service/ExceptionService.php b/src/Service/ExceptionService.php index 2c1acedf8..417d5eef8 100644 --- a/src/Service/ExceptionService.php +++ b/src/Service/ExceptionService.php @@ -16,6 +16,10 @@ use Mollie\Exception\OrderCreationException; use Mollie\Exception\ShipmentCannotBeSentException; +if (!defined('_PS_VERSION_')) { + exit; +} + class ExceptionService { const FILE_NAME = 'ExceptionService'; diff --git a/src/Service/IssuerService.php b/src/Service/IssuerService.php index 7ef2fc50f..bfe0c5400 100644 --- a/src/Service/IssuerService.php +++ b/src/Service/IssuerService.php @@ -18,6 +18,10 @@ use Mollie\Api\Types\PaymentMethod; use Mollie\Repository\PaymentMethodRepository; +if (!defined('_PS_VERSION_')) { + exit; +} + class IssuerService { /** diff --git a/src/Service/LanguageService.php b/src/Service/LanguageService.php index 729d21cdd..c967f2fe1 100644 --- a/src/Service/LanguageService.php +++ b/src/Service/LanguageService.php @@ -18,6 +18,10 @@ use Mollie\Api\Types\RefundStatus; use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class LanguageService { const FILE_NAME = 'LanguageService'; diff --git a/src/Service/MailService.php b/src/Service/MailService.php index 3b0d812d7..67599c2bb 100644 --- a/src/Service/MailService.php +++ b/src/Service/MailService.php @@ -38,6 +38,10 @@ use State; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class MailService { const FILE_NAME = 'MailService'; @@ -100,7 +104,6 @@ public function sendSecondChanceMail(Customer $customer, $checkoutUrl, $methodNa } /** - * @param Order $order * @param int $orderStateId * * @throws \PrestaShopDatabaseException @@ -208,7 +211,6 @@ private function getSubscriptionCancellationWarningMailData( } /** - * @param Order $order * @param int $orderStateId * * @return array diff --git a/src/Service/MolCarrierInformationService.php b/src/Service/MolCarrierInformationService.php index d0524ee91..3868acc2b 100644 --- a/src/Service/MolCarrierInformationService.php +++ b/src/Service/MolCarrierInformationService.php @@ -18,6 +18,10 @@ use Mollie\Config\Config; use Mollie\Repository\MolCarrierInformationRepository; +if (!defined('_PS_VERSION_')) { + exit; +} + class MolCarrierInformationService { /** diff --git a/src/Service/MollieOrderCreationService.php b/src/Service/MollieOrderCreationService.php index 7c6a9a711..092ccb278 100644 --- a/src/Service/MollieOrderCreationService.php +++ b/src/Service/MollieOrderCreationService.php @@ -27,6 +27,10 @@ use MolPaymentMethod; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieOrderCreationService { /** @@ -98,12 +102,8 @@ public function createMollieApplePayDirectOrder($data, MolPaymentMethod $payment /** * @param MolliePaymentAlias|MollieOrderAlias $apiPayment - * @param int $cartId - * @param string $orderReference * @param ?int $orderId * - * @return void - * * @throws \PrestaShopDatabaseException */ public function createMolliePayment($apiPayment, int $cartId, string $orderReference, ?int $orderId = null, string $status = PaymentStatus::STATUS_OPEN): void diff --git a/src/Service/MollieOrderInfoService.php b/src/Service/MollieOrderInfoService.php index 168196e07..d09323abc 100644 --- a/src/Service/MollieOrderInfoService.php +++ b/src/Service/MollieOrderInfoService.php @@ -18,6 +18,10 @@ use Order; use PrestaShopLogger; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieOrderInfoService { /** diff --git a/src/Service/MolliePaymentMailService.php b/src/Service/MolliePaymentMailService.php index 30a28977a..3e87c362f 100644 --- a/src/Service/MolliePaymentMailService.php +++ b/src/Service/MolliePaymentMailService.php @@ -25,6 +25,10 @@ use Mollie\Utility\TransactionUtility; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class MolliePaymentMailService { const FILE_NAME = 'MolliePaymentMailService'; diff --git a/src/Service/OrderPaymentFeeService.php b/src/Service/OrderPaymentFeeService.php index 1eaec0045..202f2cf3b 100644 --- a/src/Service/OrderPaymentFeeService.php +++ b/src/Service/OrderPaymentFeeService.php @@ -20,6 +20,10 @@ use MolPaymentMethod; use Shop; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderPaymentFeeService { /** diff --git a/src/Service/OrderStateImageService.php b/src/Service/OrderStateImageService.php index a497b0f6b..5f11f0d40 100644 --- a/src/Service/OrderStateImageService.php +++ b/src/Service/OrderStateImageService.php @@ -11,6 +11,10 @@ namespace Mollie\Service; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderStateImageService { /** diff --git a/src/Service/OrderStatusService.php b/src/Service/OrderStatusService.php index 33c1ea8d1..bfa1dab0a 100644 --- a/src/Service/OrderStatusService.php +++ b/src/Service/OrderStatusService.php @@ -25,6 +25,10 @@ use Tools; use Validate; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderStatusService { /** diff --git a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation.php b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation.php index cb4763d87..f93a10cd3 100644 --- a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation.php +++ b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation.php @@ -42,6 +42,10 @@ use MolPaymentMethod; use PrestaShopLogger; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentMethodRestrictionValidation implements PaymentMethodRestrictionValidationInterface { /** @@ -56,10 +60,6 @@ public function __construct(array $paymentRestrictionValidators) /** * At least one payment restriction validator is present at all times (BasePaymentRestrictionValidation) - * - * @param MolPaymentMethod $paymentMethod - * - * @return bool */ public function isPaymentMethodValid(MolPaymentMethod $paymentMethod): bool { diff --git a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/AmountPaymentMethodRestrictionValidator.php b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/AmountPaymentMethodRestrictionValidator.php index 3e886fe57..6d2d71ff2 100644 --- a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/AmountPaymentMethodRestrictionValidator.php +++ b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/AmountPaymentMethodRestrictionValidator.php @@ -40,6 +40,10 @@ use MolPaymentMethod; use PrestaShop\Decimal\Number; +if (!defined('_PS_VERSION_')) { + exit; +} + /** Validator to check if cart total is valid for amount restrictions */ class AmountPaymentMethodRestrictionValidator implements PaymentMethodRestrictionValidatorInterface { diff --git a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/ApplePayPaymentMethodRestrictionValidator.php b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/ApplePayPaymentMethodRestrictionValidator.php index 531fcea49..6421ecfd0 100644 --- a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/ApplePayPaymentMethodRestrictionValidator.php +++ b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/ApplePayPaymentMethodRestrictionValidator.php @@ -40,6 +40,10 @@ use Mollie\Api\Types\PaymentMethod; use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + class ApplePayPaymentMethodRestrictionValidator implements PaymentMethodRestrictionValidatorInterface { /** @@ -76,17 +80,11 @@ public function supports(MolPaymentMethod $paymentMethod): bool return $paymentMethod->getPaymentMethodName() === PaymentMethod::APPLEPAY; } - /** - * @return bool - */ private function isSslEnabledEverywhere(): bool { return (bool) $this->configurationAdapter->get('PS_SSL_ENABLED_EVERYWHERE'); } - /** - * @return bool - */ private function isPaymentMethodInCookie(): bool { if (!isset($_COOKIE['isApplePayMethod'])) { diff --git a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/B2bPaymentMethodRestrictionValidator.php b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/B2bPaymentMethodRestrictionValidator.php index 89801c594..049bab609 100644 --- a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/B2bPaymentMethodRestrictionValidator.php +++ b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/B2bPaymentMethodRestrictionValidator.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Service\PaymentMethod\PaymentMethodRestrictionValidation; @@ -10,6 +20,10 @@ use Mollie\Repository\CustomerRepositoryInterface; use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + class B2bPaymentMethodRestrictionValidator implements PaymentMethodRestrictionValidatorInterface { /** @var Context */ diff --git a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/BasePaymentMethodRestrictionValidator.php b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/BasePaymentMethodRestrictionValidator.php index ff7895b12..016232c50 100644 --- a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/BasePaymentMethodRestrictionValidator.php +++ b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/BasePaymentMethodRestrictionValidator.php @@ -38,6 +38,10 @@ use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + /** Validator to check all cases for every payment method */ class BasePaymentMethodRestrictionValidator implements PaymentMethodRestrictionValidatorInterface { diff --git a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/EnvironmentVersionSpecificPaymentMethodRestrictionValidator.php b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/EnvironmentVersionSpecificPaymentMethodRestrictionValidator.php index 744f4117c..ae7ed95e3 100644 --- a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/EnvironmentVersionSpecificPaymentMethodRestrictionValidator.php +++ b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/EnvironmentVersionSpecificPaymentMethodRestrictionValidator.php @@ -40,6 +40,10 @@ use Mollie\Repository\MethodCountryRepository; use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + /** Validator to check specific cases by environment version for every payment method */ class EnvironmentVersionSpecificPaymentMethodRestrictionValidator implements PaymentMethodRestrictionValidatorInterface { diff --git a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/PaymentMethodRestrictionValidatorInterface.php b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/PaymentMethodRestrictionValidatorInterface.php index e07558ce5..1da3bd72c 100644 --- a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/PaymentMethodRestrictionValidatorInterface.php +++ b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/PaymentMethodRestrictionValidatorInterface.php @@ -38,23 +38,19 @@ use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PaymentMethodRestrictionValidatorInterface { /** * Returns if payment is valid - * - * @param MolPaymentMethod $paymentMethod - * - * @return bool */ public function isValid(MolPaymentMethod $paymentMethod): bool; /** * Returns if payment restriction validator is supported by payment name - * - * @param MolPaymentMethod $paymentMethod - * - * @return bool */ public function supports(MolPaymentMethod $paymentMethod): bool; } diff --git a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/VoucherPaymentMethodRestrictionValidator.php b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/VoucherPaymentMethodRestrictionValidator.php index a1696c386..ac8ee2c8f 100644 --- a/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/VoucherPaymentMethodRestrictionValidator.php +++ b/src/Service/PaymentMethod/PaymentMethodRestrictionValidation/VoucherPaymentMethodRestrictionValidator.php @@ -41,6 +41,10 @@ use Mollie\Validator\VoucherValidator; use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + class VoucherPaymentMethodRestrictionValidator implements PaymentMethodRestrictionValidatorInterface { /** diff --git a/src/Service/PaymentMethod/PaymentMethodRestrictionValidationInterface.php b/src/Service/PaymentMethod/PaymentMethodRestrictionValidationInterface.php index 4a3479b97..81727ff33 100644 --- a/src/Service/PaymentMethod/PaymentMethodRestrictionValidationInterface.php +++ b/src/Service/PaymentMethod/PaymentMethodRestrictionValidationInterface.php @@ -38,11 +38,13 @@ use MolPaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PaymentMethodRestrictionValidationInterface { /** - * @param MolPaymentMethod $paymentMethod - * * @return bool */ public function isPaymentMethodValid(MolPaymentMethod $paymentMethod); diff --git a/src/Service/PaymentMethod/PaymentMethodSortProvider.php b/src/Service/PaymentMethod/PaymentMethodSortProvider.php index a073ccdbe..57ec2b792 100644 --- a/src/Service/PaymentMethod/PaymentMethodSortProvider.php +++ b/src/Service/PaymentMethod/PaymentMethodSortProvider.php @@ -12,6 +12,10 @@ namespace Mollie\Service\PaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + final class PaymentMethodSortProvider implements PaymentMethodSortProviderInterface { public function getSortedInAscendingWayForCheckout(array $paymentMethods) diff --git a/src/Service/PaymentMethod/PaymentMethodSortProviderInterface.php b/src/Service/PaymentMethod/PaymentMethodSortProviderInterface.php index 3ca77efdd..7c7d7941c 100644 --- a/src/Service/PaymentMethod/PaymentMethodSortProviderInterface.php +++ b/src/Service/PaymentMethod/PaymentMethodSortProviderInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Service\PaymentMethod; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * Payment methods are being retrieved both from api and the ones stored in database. The ones that are stored * can be dragged in admin so this service can be used to call anywhere and sort payment options accordingly. diff --git a/src/Service/PaymentMethodService.php b/src/Service/PaymentMethodService.php index 9c105278b..f5f6cd9bf 100644 --- a/src/Service/PaymentMethodService.php +++ b/src/Service/PaymentMethodService.php @@ -54,6 +54,10 @@ use PrestaShopException; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentMethodService { /** @@ -255,7 +259,6 @@ public function getMethodsForCheckout() * @param string|null $issuer * @param int|Cart $cartId * @param string $secureKey - * @param MolPaymentMethod $molPaymentMethod * @param string $orderReference * @param string $cardToken * @@ -546,9 +549,6 @@ private function getSupportedMollieMethods(?string $sequenceType = null): array return $methods->getArrayCopy(); } - /** - * @return MolCustomer|null - */ public function handleCustomerInfo(int $customerId, bool $saveCard, bool $useSavedCard): ?MolCustomer { $isSingleClickPaymentEnabled = (bool) (int) $this->configurationAdapter->get(Config::MOLLIE_SINGLE_CLICK_PAYMENT); diff --git a/src/Service/PaymentReturnService.php b/src/Service/PaymentReturnService.php index 8a7bf1688..dca30f8fa 100644 --- a/src/Service/PaymentReturnService.php +++ b/src/Service/PaymentReturnService.php @@ -20,6 +20,10 @@ use Mollie\Repository\PaymentMethodRepository; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentReturnService { const PENDING = 1; diff --git a/src/Service/PaymentsTranslationService.php b/src/Service/PaymentsTranslationService.php index 81e36dc74..4fe31e854 100644 --- a/src/Service/PaymentsTranslationService.php +++ b/src/Service/PaymentsTranslationService.php @@ -12,6 +12,10 @@ namespace Mollie\Service; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentsTranslationService { /** diff --git a/src/Service/RefundService.php b/src/Service/RefundService.php index ed222fef2..574d1bb8b 100644 --- a/src/Service/RefundService.php +++ b/src/Service/RefundService.php @@ -22,6 +22,10 @@ use PrestaShopDatabaseException; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + class RefundService { const FILE_NAME = 'RefundService'; diff --git a/src/Service/RepeatOrderLinkFactory.php b/src/Service/RepeatOrderLinkFactory.php index 1a3ca5d7e..4289e3ad6 100644 --- a/src/Service/RepeatOrderLinkFactory.php +++ b/src/Service/RepeatOrderLinkFactory.php @@ -12,6 +12,10 @@ namespace Mollie\Service; +if (!defined('_PS_VERSION_')) { + exit; +} + class RepeatOrderLinkFactory { public function getLink() diff --git a/src/Service/SettingsSaveService.php b/src/Service/SettingsSaveService.php index 53cb5e89a..13a3eea50 100644 --- a/src/Service/SettingsSaveService.php +++ b/src/Service/SettingsSaveService.php @@ -33,6 +33,10 @@ use PrestaShopDatabaseException; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + class SettingsSaveService { const FILE_NAME = 'SettingsSaveService'; diff --git a/src/Service/ShipService.php b/src/Service/ShipService.php index 333139a12..b7f2d8165 100644 --- a/src/Service/ShipService.php +++ b/src/Service/ShipService.php @@ -16,6 +16,10 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Resources\Order as MollieOrderAlias; +if (!defined('_PS_VERSION_')) { + exit; +} + class ShipService { const FILE_NAME = 'ShipService'; diff --git a/src/Service/Shipment/ShipmentInformationSender.php b/src/Service/Shipment/ShipmentInformationSender.php index 85111e1e1..cab9ec990 100644 --- a/src/Service/Shipment/ShipmentInformationSender.php +++ b/src/Service/Shipment/ShipmentInformationSender.php @@ -18,6 +18,10 @@ use Mollie\Service\ShipmentServiceInterface; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class ShipmentInformationSender implements ShipmentInformationSenderInterface { /** @@ -62,11 +66,6 @@ public function sendShipmentInformation(?MollieApiClient $apiGateway, Order $ord $apiOrder->shipAll($this->shipmentService->getShipmentInformation($order->reference)); } - /** - * @param ApiOrder $apiOrder - * - * @return bool - */ private function hasShippableItems(ApiOrder $apiOrder): bool { $shippableItems = 0; diff --git a/src/Service/Shipment/ShipmentInformationSenderInterface.php b/src/Service/Shipment/ShipmentInformationSenderInterface.php index a8f0432eb..986d091a9 100644 --- a/src/Service/Shipment/ShipmentInformationSenderInterface.php +++ b/src/Service/Shipment/ShipmentInformationSenderInterface.php @@ -16,6 +16,10 @@ use Mollie\Api\MollieApiClient; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + interface ShipmentInformationSenderInterface { /** diff --git a/src/Service/ShipmentService.php b/src/Service/ShipmentService.php index cb2248f7e..c2a51327a 100644 --- a/src/Service/ShipmentService.php +++ b/src/Service/ShipmentService.php @@ -29,6 +29,10 @@ use Tools; use Validate; +if (!defined('_PS_VERSION_')) { + exit; +} + class ShipmentService implements ShipmentServiceInterface { /** diff --git a/src/Service/ShipmentServiceInterface.php b/src/Service/ShipmentServiceInterface.php index 091121842..dd44128c4 100644 --- a/src/Service/ShipmentServiceInterface.php +++ b/src/Service/ShipmentServiceInterface.php @@ -15,6 +15,10 @@ use PrestaShopDatabaseException; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + interface ShipmentServiceInterface { /** diff --git a/src/Service/TransactionService.php b/src/Service/TransactionService.php index 6ea8e0bbc..d34a154e0 100644 --- a/src/Service/TransactionService.php +++ b/src/Service/TransactionService.php @@ -45,6 +45,10 @@ use PrestaShopException; use PrestaShopLogger; +if (!defined('_PS_VERSION_')) { + exit; +} + class TransactionService { /** diff --git a/src/Service/UpgradeNoticeService.php b/src/Service/UpgradeNoticeService.php index c86e3b755..f9a95762e 100644 --- a/src/Service/UpgradeNoticeService.php +++ b/src/Service/UpgradeNoticeService.php @@ -15,6 +15,10 @@ use Mollie\Config\Config; use Mollie\Utility\TimeUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class UpgradeNoticeService { /** diff --git a/src/Service/VoucherService.php b/src/Service/VoucherService.php index 07acd6341..5c6c6e980 100644 --- a/src/Service/VoucherService.php +++ b/src/Service/VoucherService.php @@ -15,6 +15,10 @@ use Mollie\Adapter\ConfigurationAdapter; use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class VoucherService { /** diff --git a/src/ServiceProvider/BaseServiceProvider.php b/src/ServiceProvider/BaseServiceProvider.php index 44f50e108..c36483ae9 100644 --- a/src/ServiceProvider/BaseServiceProvider.php +++ b/src/ServiceProvider/BaseServiceProvider.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -118,6 +128,10 @@ use Mollie\Verification\Shipment\ShipmentVerificationInterface; use PrestaShop\PrestaShop\Core\Grid\Action\Row\AccessibilityChecker\AccessibilityCheckerInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * Load base services here which are usually required */ diff --git a/src/ServiceProvider/LeagueServiceContainerProvider.php b/src/ServiceProvider/LeagueServiceContainerProvider.php index dffa02814..d5486fe82 100644 --- a/src/ServiceProvider/LeagueServiceContainerProvider.php +++ b/src/ServiceProvider/LeagueServiceContainerProvider.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use League\Container\Container; use League\Container\ReflectionContainer; +if (!defined('_PS_VERSION_')) { + exit; +} + class LeagueServiceContainerProvider implements ServiceContainerProviderInterface { private $extendedServices = []; diff --git a/src/ServiceProvider/PrestashopContainer.php b/src/ServiceProvider/PrestashopContainer.php index f4e03b2f8..87b0c62bb 100644 --- a/src/ServiceProvider/PrestashopContainer.php +++ b/src/ServiceProvider/PrestashopContainer.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use PrestaShop\PrestaShop\Adapter\SymfonyContainer; use Symfony\Component\DependencyInjection\ContainerInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class PrestashopContainer implements InteropContainerInterface { /** @var SymfonyContainer|ContainerInterface|null */ diff --git a/src/ServiceProvider/ServiceContainerProviderInterface.php b/src/ServiceProvider/ServiceContainerProviderInterface.php index c294dc6b4..03088667a 100644 --- a/src/ServiceProvider/ServiceContainerProviderInterface.php +++ b/src/ServiceProvider/ServiceContainerProviderInterface.php @@ -1,24 +1,33 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\ServiceProvider; -use League\Container\Container; +if (!defined('_PS_VERSION_')) { + exit; +} interface ServiceContainerProviderInterface { /** * Gets service that is defined by module container. - * - * @param string $serviceName */ public function getService(string $serviceName); /** * Extending the service. Useful for tests to dynamically change the implementations * - * @param string $id * @param ?string $concrete - a class name * * @return mixed diff --git a/src/ServiceProvider/index.php b/src/ServiceProvider/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/src/ServiceProvider/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Tracker/Segment.php b/src/Tracker/Segment.php index 2d25bb383..8612aff15 100644 --- a/src/Tracker/Segment.php +++ b/src/Tracker/Segment.php @@ -43,6 +43,10 @@ use Mollie\Config\Config; use Mollie\Config\Env; +if (!defined('_PS_VERSION_')) { + exit; +} + class Segment implements TrackerInterface { /** diff --git a/src/Tracker/TrackerInterface.php b/src/Tracker/TrackerInterface.php index e4710e39b..aa4e7631d 100644 --- a/src/Tracker/TrackerInterface.php +++ b/src/Tracker/TrackerInterface.php @@ -36,6 +36,10 @@ namespace Mollie\Tracker; +if (!defined('_PS_VERSION_')) { + exit; +} + interface TrackerInterface { /** diff --git a/src/Utility/ApplePayDirect/ShippingMethodUtility.php b/src/Utility/ApplePayDirect/ShippingMethodUtility.php index b89aafbed..4d73a8898 100644 --- a/src/Utility/ApplePayDirect/ShippingMethodUtility.php +++ b/src/Utility/ApplePayDirect/ShippingMethodUtility.php @@ -15,11 +15,14 @@ use Cart; use Mollie\DTO\ApplePay\Carrier\Carrier as AppleCarrier; +if (!defined('_PS_VERSION_')) { + exit; +} + class ShippingMethodUtility { /** * @param AppleCarrier[] $carriers - * @param Cart $cart * * @return array|array * diff --git a/src/Utility/ArrayUtility.php b/src/Utility/ArrayUtility.php index d3ac4b69a..e769dd2ba 100644 --- a/src/Utility/ArrayUtility.php +++ b/src/Utility/ArrayUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class ArrayUtility { public static function getLastElement($array) diff --git a/src/Utility/AssortUtility.php b/src/Utility/AssortUtility.php index 949ed03b4..8b357369d 100644 --- a/src/Utility/AssortUtility.php +++ b/src/Utility/AssortUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class AssortUtility { /** diff --git a/src/Utility/CalculationUtility.php b/src/Utility/CalculationUtility.php index b015d7241..67a5269c6 100644 --- a/src/Utility/CalculationUtility.php +++ b/src/Utility/CalculationUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class CalculationUtility { /** diff --git a/src/Utility/CartPriceUtility.php b/src/Utility/CartPriceUtility.php index d24b170fe..7fff1afa0 100644 --- a/src/Utility/CartPriceUtility.php +++ b/src/Utility/CartPriceUtility.php @@ -15,6 +15,10 @@ use Mollie\Config\Config; use PrestaShop\Decimal\Number; +if (!defined('_PS_VERSION_')) { + exit; +} + class CartPriceUtility { /** diff --git a/src/Utility/ContextUtility.php b/src/Utility/ContextUtility.php index e05c64daa..34b0eb5bb 100644 --- a/src/Utility/ContextUtility.php +++ b/src/Utility/ContextUtility.php @@ -15,6 +15,10 @@ use Context; use Customer; +if (!defined('_PS_VERSION_')) { + exit; +} + class ContextUtility { public static function setCustomerToContext(Context $context, Customer $customer) diff --git a/src/Utility/CustomLogoUtility.php b/src/Utility/CustomLogoUtility.php index 5b18c3cf1..7acbdded8 100644 --- a/src/Utility/CustomLogoUtility.php +++ b/src/Utility/CustomLogoUtility.php @@ -15,6 +15,10 @@ use Configuration; use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class CustomLogoUtility { /** diff --git a/src/Utility/CustomerUtility.php b/src/Utility/CustomerUtility.php index 6143de4b2..e27253f9b 100644 --- a/src/Utility/CustomerUtility.php +++ b/src/Utility/CustomerUtility.php @@ -15,6 +15,10 @@ use Customer; use Validate; +if (!defined('_PS_VERSION_')) { + exit; +} + class CustomerUtility { /** diff --git a/src/Utility/Decoder/DecoderInterface.php b/src/Utility/Decoder/DecoderInterface.php index 4c2848dbf..c9909584f 100644 --- a/src/Utility/Decoder/DecoderInterface.php +++ b/src/Utility/Decoder/DecoderInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Utility\Decoder; +if (!defined('_PS_VERSION_')) { + exit; +} + interface DecoderInterface { /** diff --git a/src/Utility/Decoder/JsonDecoder.php b/src/Utility/Decoder/JsonDecoder.php index 8917f45cf..c1ca53f6b 100644 --- a/src/Utility/Decoder/JsonDecoder.php +++ b/src/Utility/Decoder/JsonDecoder.php @@ -12,6 +12,10 @@ namespace Mollie\Utility\Decoder; +if (!defined('_PS_VERSION_')) { + exit; +} + class JsonDecoder implements DecoderInterface { /** diff --git a/src/Utility/EnvironmentUtility.php b/src/Utility/EnvironmentUtility.php index 9d8d9cd79..e24a36ba9 100644 --- a/src/Utility/EnvironmentUtility.php +++ b/src/Utility/EnvironmentUtility.php @@ -15,6 +15,10 @@ use Configuration; use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class EnvironmentUtility { public static function getApiKey() diff --git a/src/Utility/FileUtility.php b/src/Utility/FileUtility.php index 6a82c090a..4a96609f3 100644 --- a/src/Utility/FileUtility.php +++ b/src/Utility/FileUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class FileUtility { public static function isWritable(string $folderUrl): bool diff --git a/src/Utility/HashUtility.php b/src/Utility/HashUtility.php index 2538147c1..2130e2cc9 100644 --- a/src/Utility/HashUtility.php +++ b/src/Utility/HashUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class HashUtility { /** diff --git a/src/Utility/ImageUtility.php b/src/Utility/ImageUtility.php index e250353f4..1753d66b1 100644 --- a/src/Utility/ImageUtility.php +++ b/src/Utility/ImageUtility.php @@ -14,6 +14,10 @@ use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class ImageUtility { public static function setOptionImage($image, $imageConfig) diff --git a/src/Utility/LocaleUtility.php b/src/Utility/LocaleUtility.php index 55edb8d65..060da98cd 100644 --- a/src/Utility/LocaleUtility.php +++ b/src/Utility/LocaleUtility.php @@ -17,6 +17,10 @@ use Language; use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class LocaleUtility { /** diff --git a/src/Utility/MenuLocationUtility.php b/src/Utility/MenuLocationUtility.php index 84c41181c..cd3c19213 100644 --- a/src/Utility/MenuLocationUtility.php +++ b/src/Utility/MenuLocationUtility.php @@ -18,6 +18,10 @@ use Tab; use Validate; +if (!defined('_PS_VERSION_')) { + exit; +} + class MenuLocationUtility { /** diff --git a/src/Utility/MollieStatusUtility.php b/src/Utility/MollieStatusUtility.php index 119161323..efbf246f0 100644 --- a/src/Utility/MollieStatusUtility.php +++ b/src/Utility/MollieStatusUtility.php @@ -16,6 +16,10 @@ use Mollie\Api\Types\PaymentStatus; use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieStatusUtility { public static function isPaymentFinished($paymentStatus) diff --git a/src/Utility/MultiLangUtility.php b/src/Utility/MultiLangUtility.php index e5f7fdf84..93d85ff8c 100644 --- a/src/Utility/MultiLangUtility.php +++ b/src/Utility/MultiLangUtility.php @@ -14,6 +14,10 @@ use Language; +if (!defined('_PS_VERSION_')) { + exit; +} + class MultiLangUtility { public static function createMultiLangField($field, $languageIds = null) diff --git a/src/Utility/NumberUtility.php b/src/Utility/NumberUtility.php index f7c4f5977..ca4babd47 100644 --- a/src/Utility/NumberUtility.php +++ b/src/Utility/NumberUtility.php @@ -16,6 +16,10 @@ use PrestaShop\Decimal\Number; use PrestaShop\Decimal\Operation\Rounding; +if (!defined('_PS_VERSION_')) { + exit; +} + class NumberUtility { public const DECIMAL_PRECISION = 2; @@ -163,8 +167,6 @@ public static function plus($a, $b) } /** - * @param float $number - * * @return Number|DecimalNumber */ private static function getNumber(float $number) diff --git a/src/Utility/OrderNumberUtility.php b/src/Utility/OrderNumberUtility.php index 76acab6f0..bd26c0805 100644 --- a/src/Utility/OrderNumberUtility.php +++ b/src/Utility/OrderNumberUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderNumberUtility { const ORDER_NUMBER_PREFIX = 'mol_'; diff --git a/src/Utility/OrderRecoverUtility.php b/src/Utility/OrderRecoverUtility.php index 1bbab6c57..9f9916ab6 100644 --- a/src/Utility/OrderRecoverUtility.php +++ b/src/Utility/OrderRecoverUtility.php @@ -14,6 +14,10 @@ use Customer; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderRecoverUtility { public static function recoverCreatedOrder($context, int $customerId) diff --git a/src/Utility/OrderStatusUtility.php b/src/Utility/OrderStatusUtility.php index 2ac6fd999..daabf3883 100644 --- a/src/Utility/OrderStatusUtility.php +++ b/src/Utility/OrderStatusUtility.php @@ -19,6 +19,10 @@ use Mollie\Api\Types\RefundStatus; use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderStatusUtility { /** diff --git a/src/Utility/PaymentMethodUtility.php b/src/Utility/PaymentMethodUtility.php index b295b04bb..6e95100b7 100644 --- a/src/Utility/PaymentMethodUtility.php +++ b/src/Utility/PaymentMethodUtility.php @@ -14,6 +14,10 @@ use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentMethodUtility { public static function getPaymentMethodName($method) diff --git a/src/Utility/PsVersionUtility.php b/src/Utility/PsVersionUtility.php index e268c4d12..f2fc42d87 100644 --- a/src/Utility/PsVersionUtility.php +++ b/src/Utility/PsVersionUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class PsVersionUtility { public static function isPsVersionGreaterOrEqualTo(string $psVersion, string $targetVersion) diff --git a/src/Utility/RefundUtility.php b/src/Utility/RefundUtility.php index 37403c209..cc10bb408 100644 --- a/src/Utility/RefundUtility.php +++ b/src/Utility/RefundUtility.php @@ -14,6 +14,10 @@ use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class RefundUtility { public static function getRefundLines(array $lines) diff --git a/src/Utility/SecureKeyUtility.php b/src/Utility/SecureKeyUtility.php index 36a4bae19..2eab43bd2 100644 --- a/src/Utility/SecureKeyUtility.php +++ b/src/Utility/SecureKeyUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class SecureKeyUtility { public static function generateReturnKey($customerId, $cartId, $moduleName) diff --git a/src/Utility/TagsUtility.php b/src/Utility/TagsUtility.php index 216f3c46e..27aa89022 100644 --- a/src/Utility/TagsUtility.php +++ b/src/Utility/TagsUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class TagsUtility { /** diff --git a/src/Utility/TextFormatUtility.php b/src/Utility/TextFormatUtility.php index 013d5ea8d..975f657a5 100644 --- a/src/Utility/TextFormatUtility.php +++ b/src/Utility/TextFormatUtility.php @@ -11,6 +11,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class TextFormatUtility { public static function formatNumber($unitPrice, $apiRoundingPrecision, $docPoint = '.', $thousandSep = '') diff --git a/src/Utility/TextGeneratorUtility.php b/src/Utility/TextGeneratorUtility.php index 5565decc7..0cded2162 100644 --- a/src/Utility/TextGeneratorUtility.php +++ b/src/Utility/TextGeneratorUtility.php @@ -19,6 +19,10 @@ use Customer; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class TextGeneratorUtility { /** diff --git a/src/Utility/TimeUtility.php b/src/Utility/TimeUtility.php index e23e9b8f1..35522d172 100644 --- a/src/Utility/TimeUtility.php +++ b/src/Utility/TimeUtility.php @@ -14,6 +14,10 @@ use DateTime; +if (!defined('_PS_VERSION_')) { + exit; +} + class TimeUtility { const HOURS_IN_DAY = 24; diff --git a/src/Utility/TransactionUtility.php b/src/Utility/TransactionUtility.php index 19520667b..3f6e6b6b6 100644 --- a/src/Utility/TransactionUtility.php +++ b/src/Utility/TransactionUtility.php @@ -14,6 +14,10 @@ use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class TransactionUtility { public static function isOrderTransaction($transactionId) diff --git a/src/Utility/UrlPathUtility.php b/src/Utility/UrlPathUtility.php index 5435dd0c5..58b5ce9d9 100644 --- a/src/Utility/UrlPathUtility.php +++ b/src/Utility/UrlPathUtility.php @@ -14,6 +14,10 @@ use Tools; +if (!defined('_PS_VERSION_')) { + exit; +} + class UrlPathUtility { /** diff --git a/src/Validator/MailValidatorInterface.php b/src/Validator/MailValidatorInterface.php index 0a2c814a6..5f98b0a5d 100644 --- a/src/Validator/MailValidatorInterface.php +++ b/src/Validator/MailValidatorInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Validator; +if (!defined('_PS_VERSION_')) { + exit; +} + interface MailValidatorInterface { /** diff --git a/src/Validator/OrderCallBackValidator.php b/src/Validator/OrderCallBackValidator.php index 8cd1e6aa1..1ee8a29d2 100644 --- a/src/Validator/OrderCallBackValidator.php +++ b/src/Validator/OrderCallBackValidator.php @@ -16,6 +16,10 @@ use Mollie\Adapter\Customer; use Mollie\Utility\SecureKeyUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderCallBackValidator { /** diff --git a/src/Validator/OrderConfMailValidator.php b/src/Validator/OrderConfMailValidator.php index 3823dce05..e02a5e7ce 100644 --- a/src/Validator/OrderConfMailValidator.php +++ b/src/Validator/OrderConfMailValidator.php @@ -15,6 +15,10 @@ use Mollie\Adapter\ConfigurationAdapter; use Mollie\Config\Config; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderConfMailValidator implements MailValidatorInterface { /** diff --git a/src/Validator/VoucherValidator.php b/src/Validator/VoucherValidator.php index 36fd54715..7e64dd007 100644 --- a/src/Validator/VoucherValidator.php +++ b/src/Validator/VoucherValidator.php @@ -16,6 +16,10 @@ use Mollie\Config\Config; use Mollie\Service\VoucherService; +if (!defined('_PS_VERSION_')) { + exit; +} + class VoucherValidator { /** diff --git a/src/Verification/IsPaymentInformationAvailable.php b/src/Verification/IsPaymentInformationAvailable.php index 652bc73e1..8bfa5c36c 100644 --- a/src/Verification/IsPaymentInformationAvailable.php +++ b/src/Verification/IsPaymentInformationAvailable.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Verification; use Mollie\Repository\PaymentMethodRepositoryInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class IsPaymentInformationAvailable { /** @var PaymentMethodRepositoryInterface */ diff --git a/src/Verification/PaymentType/CanBeRegularPaymentType.php b/src/Verification/PaymentType/CanBeRegularPaymentType.php index b1372a951..65f80d70b 100644 --- a/src/Verification/PaymentType/CanBeRegularPaymentType.php +++ b/src/Verification/PaymentType/CanBeRegularPaymentType.php @@ -15,6 +15,10 @@ use Mollie\Adapter\ToolsAdapter; use Mollie\Provider\PaymentType\PaymentTypeIdentificationProviderInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class CanBeRegularPaymentType implements PaymentTypeVerificationInterface { /** diff --git a/src/Verification/PaymentType/PaymentTypeVerificationInterface.php b/src/Verification/PaymentType/PaymentTypeVerificationInterface.php index 0dccbfb4d..7ebe011b0 100644 --- a/src/Verification/PaymentType/PaymentTypeVerificationInterface.php +++ b/src/Verification/PaymentType/PaymentTypeVerificationInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Verification\PaymentType; +if (!defined('_PS_VERSION_')) { + exit; +} + interface PaymentTypeVerificationInterface { /** diff --git a/src/Verification/Shipment/CanSendShipment.php b/src/Verification/Shipment/CanSendShipment.php index 6393a25e3..d97777e98 100644 --- a/src/Verification/Shipment/CanSendShipment.php +++ b/src/Verification/Shipment/CanSendShipment.php @@ -26,6 +26,10 @@ use OrderState; use PrestaShopLogger; +if (!defined('_PS_VERSION_')) { + exit; +} + class CanSendShipment implements ShipmentVerificationInterface { /** @@ -96,11 +100,6 @@ public function verify(Order $order, OrderState $orderState): bool return true; } - /** - * @param int $orderId - * - * @return bool - */ private function isRegularPayment(int $orderId): bool { $payment = $this->paymentMethodRepository->getPaymentBy('order_id', (int) $orderId); @@ -114,11 +113,6 @@ private function isRegularPayment(int $orderId): bool return (int) $paymentType === PaymentTypeEnum::PAYMENT_TYPE_ORDER; } - /** - * @param int $orderStateId - * - * @return bool - */ private function isAutomaticShipmentAvailable(int $orderStateId): bool { if (!$this->isAutomaticShipmentInformationSenderEnabled()) { @@ -132,11 +126,6 @@ private function isAutomaticShipmentAvailable(int $orderStateId): bool return true; } - /** - * @param string $orderReference - * - * @return bool - */ private function hasShipmentInformation(string $orderReference): bool { try { @@ -148,19 +137,11 @@ private function hasShipmentInformation(string $orderReference): bool } } - /** - * @return bool - */ private function isAutomaticShipmentInformationSenderEnabled(): bool { return (bool) $this->configurationAdapter->get(Config::MOLLIE_AUTO_SHIP_MAIN); } - /** - * @param int $orderStateId - * - * @return bool - */ private function isOrderStateInAutomaticShipmentSenderOrderStateList(int $orderStateId): bool { return in_array( diff --git a/src/Verification/Shipment/ShipmentVerificationInterface.php b/src/Verification/Shipment/ShipmentVerificationInterface.php index d2b5165eb..586f8d4b3 100644 --- a/src/Verification/Shipment/ShipmentVerificationInterface.php +++ b/src/Verification/Shipment/ShipmentVerificationInterface.php @@ -16,12 +16,13 @@ use Order; use OrderState; +if (!defined('_PS_VERSION_')) { + exit; +} + interface ShipmentVerificationInterface { /** - * @param Order $order - * @param OrderState $orderState - * * @returns bool * * @throws ShipmentCannotBeSentException diff --git a/subscription/Action/CreateSpecificPriceAction.php b/subscription/Action/CreateSpecificPriceAction.php index fde4e0a9a..8eefcfca0 100644 --- a/subscription/Action/CreateSpecificPriceAction.php +++ b/subscription/Action/CreateSpecificPriceAction.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Action; use Mollie\Subscription\DTO\CreateSpecificPriceData; use Mollie\Subscription\Repository\SpecificPriceRepositoryInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateSpecificPriceAction { /** @var SpecificPriceRepositoryInterface */ diff --git a/subscription/Action/index.php b/subscription/Action/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Action/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Api/MandateApi.php b/subscription/Api/MandateApi.php index ff5424744..9aec3fff9 100644 --- a/subscription/Api/MandateApi.php +++ b/subscription/Api/MandateApi.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -10,6 +20,10 @@ use Mollie\Subscription\DTO\CreateMandateData; use Mollie\Subscription\Factory\MollieApiFactory; +if (!defined('_PS_VERSION_')) { + exit; +} + class MandateApi { /** @var MollieApiClient */ diff --git a/subscription/Api/MethodApi.php b/subscription/Api/MethodApi.php index 2a64fa686..2ffb1ea1b 100644 --- a/subscription/Api/MethodApi.php +++ b/subscription/Api/MethodApi.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use Mollie\Api\MollieApiClient; use Mollie\Subscription\Factory\MollieApiFactory; +if (!defined('_PS_VERSION_')) { + exit; +} + class MethodApi { /** @var MollieApiClient */ diff --git a/subscription/Api/PaymentApi.php b/subscription/Api/PaymentApi.php index 5d4019c2e..8bc032bb2 100644 --- a/subscription/Api/PaymentApi.php +++ b/subscription/Api/PaymentApi.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use Mollie\Subscription\DTO\CreateFreeOrderData; use Mollie\Subscription\Factory\MollieApiFactory; +if (!defined('_PS_VERSION_')) { + exit; +} + class PaymentApi { /** @var MollieApiClient */ diff --git a/subscription/Api/SubscriptionApi.php b/subscription/Api/SubscriptionApi.php index 3c6fcbd1a..eba2bf760 100644 --- a/subscription/Api/SubscriptionApi.php +++ b/subscription/Api/SubscriptionApi.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -14,6 +24,10 @@ use Mollie\Subscription\Exception\SubscriptionApiException; use Mollie\Subscription\Factory\MollieApiFactory; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionApi { /** @var MollieApiClient */ diff --git a/subscription/Api/index.php b/subscription/Api/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Api/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Config/Config.php b/subscription/Config/Config.php index 688b7cd93..bf7b9b5a9 100644 --- a/subscription/Config/Config.php +++ b/subscription/Config/Config.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use Mollie\Subscription\Constants\IntervalConstant; use Mollie\Subscription\DTO\Object\Interval; +if (!defined('_PS_VERSION_')) { + exit; +} + class Config { public const MOLLIE_MODULE_NAME = 'mollie'; diff --git a/subscription/Config/index.php b/subscription/Config/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Config/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Constants/IntervalConstant.php b/subscription/Constants/IntervalConstant.php index c2d1f5824..9732fc29d 100644 --- a/subscription/Constants/IntervalConstant.php +++ b/subscription/Constants/IntervalConstant.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Constants; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * possible values for subscription intervals */ diff --git a/subscription/Constants/SubscriptionAvailableMethodConstant.php b/subscription/Constants/SubscriptionAvailableMethodConstant.php index 101f62384..09b35b6a3 100644 --- a/subscription/Constants/SubscriptionAvailableMethodConstant.php +++ b/subscription/Constants/SubscriptionAvailableMethodConstant.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Constants; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionAvailableMethodConstant { public const CREDIT_CARD = 'creditcard'; diff --git a/subscription/Constants/index.php b/subscription/Constants/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Constants/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Controller/AbstractAdminController.php b/subscription/Controller/AbstractAdminController.php index db46796e8..4bb727ec8 100644 --- a/subscription/Controller/AbstractAdminController.php +++ b/subscription/Controller/AbstractAdminController.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Controller; use ModuleAdminController; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * Class AbstractAdminController - an abstraction for all admin module controllers */ diff --git a/subscription/Controller/Symfony/AbstractSymfonyController.php b/subscription/Controller/Symfony/AbstractSymfonyController.php index 2ea50f1d3..ceb1c6d7d 100644 --- a/subscription/Controller/Symfony/AbstractSymfonyController.php +++ b/subscription/Controller/Symfony/AbstractSymfonyController.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Controller\Symfony; @@ -6,6 +16,10 @@ use Mollie; use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * Class AbstractAdminController - an abstraction for all admin module controllers */ diff --git a/subscription/Controller/Symfony/SubscriptionController.php b/subscription/Controller/Symfony/SubscriptionController.php index 29dea1fcb..8adfac607 100644 --- a/subscription/Controller/Symfony/SubscriptionController.php +++ b/subscription/Controller/Symfony/SubscriptionController.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -18,6 +28,10 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionController extends AbstractSymfonyController { private const FILE_NAME = 'SubscriptionController'; @@ -25,8 +39,6 @@ class SubscriptionController extends AbstractSymfonyController /** * @AdminSecurity("is_granted('read', request.get('_legacy_controller'))") * - * @param SubscriptionFilters $filters - * * @return Response */ public function indexAction(SubscriptionFilters $filters, Request $request) @@ -61,10 +73,6 @@ public function indexAction(SubscriptionFilters $filters, Request $request) /** * @AdminSecurity("is_granted('create', request.get('_legacy_controller'))") - * - * @param Request $request - * - * @return RedirectResponse */ public function submitOptionsAction(Request $request): RedirectResponse { @@ -102,10 +110,6 @@ public function submitOptionsAction(Request $request): RedirectResponse * Provides filters functionality. * * @AdminSecurity("is_granted('read', request.get('_legacy_controller'))") - * - * @param Request $request - * - * @return RedirectResponse */ public function searchAction(Request $request): RedirectResponse { @@ -121,10 +125,6 @@ public function searchAction(Request $request): RedirectResponse /** * @AdminSecurity("is_granted('delete', request.get('_legacy_controller'))", redirectRoute="admin_subscription_index") - * - * @param int $subscriptionId - * - * @return RedirectResponse */ public function cancelAction(int $subscriptionId): RedirectResponse { diff --git a/subscription/Controller/Symfony/SubscriptionFAQController.php b/subscription/Controller/Symfony/SubscriptionFAQController.php index 44654a77e..8e6fb579e 100644 --- a/subscription/Controller/Symfony/SubscriptionFAQController.php +++ b/subscription/Controller/Symfony/SubscriptionFAQController.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use PrestaShopBundle\Security\Annotation\AdminSecurity; use Symfony\Component\HttpFoundation\Response; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionFAQController extends AbstractSymfonyController { private const FILE_NAME = 'SubscriptionFAQController'; diff --git a/subscription/Controller/Symfony/index.php b/subscription/Controller/Symfony/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Controller/Symfony/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Controller/index.php b/subscription/Controller/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Controller/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/DTO/CancelSubscriptionData.php b/subscription/DTO/CancelSubscriptionData.php index a7e023ea5..7219e693c 100644 --- a/subscription/DTO/CancelSubscriptionData.php +++ b/subscription/DTO/CancelSubscriptionData.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -6,6 +16,10 @@ use JsonSerializable; +if (!defined('_PS_VERSION_')) { + exit; +} + class CancelSubscriptionData implements JsonSerializable { /** @var string */ @@ -14,10 +28,6 @@ class CancelSubscriptionData implements JsonSerializable /** @var string */ private $subscriptionId; - /** - * @param string $customerId - * @param string $subscriptionId - */ public function __construct(string $customerId, string $subscriptionId) { $this->customerId = $customerId; diff --git a/subscription/DTO/CreateFreeOrderData.php b/subscription/DTO/CreateFreeOrderData.php index f14143621..42b0ae93a 100644 --- a/subscription/DTO/CreateFreeOrderData.php +++ b/subscription/DTO/CreateFreeOrderData.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use JsonSerializable; use Mollie\Api\Types\SequenceType; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateFreeOrderData implements JsonSerializable { /** @var string */ diff --git a/subscription/DTO/CreateMandateData.php b/subscription/DTO/CreateMandateData.php index 7e668df98..3c0f4e78c 100644 --- a/subscription/DTO/CreateMandateData.php +++ b/subscription/DTO/CreateMandateData.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use Mollie\Subscription\Config\Config; use Webmozart\Assert\Assert; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateMandateData implements JsonSerializable { /** diff --git a/subscription/DTO/CreateSpecificPriceData.php b/subscription/DTO/CreateSpecificPriceData.php index 03574251f..4d156e839 100644 --- a/subscription/DTO/CreateSpecificPriceData.php +++ b/subscription/DTO/CreateSpecificPriceData.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\DTO; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateSpecificPriceData { /** @var int */ @@ -37,57 +51,36 @@ public function __construct( $this->currencyId = $currencyId; } - /** - * @return int - */ public function getProductId(): int { return $this->productId; } - /** - * @return int - */ public function getProductAttributeId(): int { return $this->productAttributeId; } - /** - * @return float - */ public function getPrice(): float { return $this->price; } - /** - * @return int - */ public function getCustomerId(): int { return $this->customerId; } - /** - * @return int - */ public function getShopId(): int { return $this->shopId; } - /** - * @return int - */ public function getShopGroupId(): int { return $this->shopGroupId; } - /** - * @return int - */ public function getCurrencyId(): int { return $this->currencyId; diff --git a/subscription/DTO/CreateSubscriptionData.php b/subscription/DTO/CreateSubscriptionData.php index 540adeb37..62c4a1ead 100644 --- a/subscription/DTO/CreateSubscriptionData.php +++ b/subscription/DTO/CreateSubscriptionData.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use Mollie\Subscription\DTO\Object\Amount; use Mollie\Subscription\DTO\Object\Interval; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateSubscriptionData implements JsonSerializable { /** @var string */ diff --git a/subscription/DTO/GetSubscriptionData.php b/subscription/DTO/GetSubscriptionData.php index 570b3d5d6..75feeecb5 100644 --- a/subscription/DTO/GetSubscriptionData.php +++ b/subscription/DTO/GetSubscriptionData.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -6,6 +16,10 @@ use JsonSerializable; +if (!defined('_PS_VERSION_')) { + exit; +} + class GetSubscriptionData implements JsonSerializable { /** @var string */ @@ -14,10 +28,6 @@ class GetSubscriptionData implements JsonSerializable /** @var string */ private $subscriptionId; - /** - * @param string $customerId - * @param string $subscriptionId - */ public function __construct(string $customerId, string $subscriptionId) { $this->customerId = $customerId; diff --git a/subscription/DTO/Object/Amount.php b/subscription/DTO/Object/Amount.php index fa2094b13..e4c004070 100644 --- a/subscription/DTO/Object/Amount.php +++ b/subscription/DTO/Object/Amount.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use JsonSerializable; use Webmozart\Assert\Assert; +if (!defined('_PS_VERSION_')) { + exit; +} + class Amount implements JsonSerializable { /** @var float */ @@ -17,10 +31,6 @@ class Amount implements JsonSerializable */ private $currency; - /** - * @param float $value - * @param string $currency - */ public function __construct(float $value, string $currency) { Assert::greaterThanEq($value, 0, 'Amount Value cannot be negative'); diff --git a/subscription/DTO/Object/Interval.php b/subscription/DTO/Object/Interval.php index 9185a14f6..2be832e2e 100644 --- a/subscription/DTO/Object/Interval.php +++ b/subscription/DTO/Object/Interval.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use Mollie\Subscription\Constants\IntervalConstant; use Webmozart\Assert\Assert; +if (!defined('_PS_VERSION_')) { + exit; +} + class Interval implements JsonSerializable { /** @var int */ @@ -20,10 +34,6 @@ class Interval implements JsonSerializable */ private $intervalValue; - /** - * @param int $amount - * @param string $intervalValue - */ public function __construct(int $amount, string $intervalValue) { Assert::greaterThanEq($amount, 0, 'Interval amount cannot be negative'); diff --git a/subscription/DTO/Object/index.php b/subscription/DTO/Object/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/DTO/Object/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/DTO/UpdateSubscriptionData.php b/subscription/DTO/UpdateSubscriptionData.php index 25d3b4d68..eccceaf13 100644 --- a/subscription/DTO/UpdateSubscriptionData.php +++ b/subscription/DTO/UpdateSubscriptionData.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -6,6 +16,10 @@ use JsonSerializable; +if (!defined('_PS_VERSION_')) { + exit; +} + class UpdateSubscriptionData implements JsonSerializable { /** @var string */ @@ -17,10 +31,6 @@ class UpdateSubscriptionData implements JsonSerializable /** @var string */ private $mandateId; - /** - * @param string $customerId - * @param string $subscriptionId - */ public function __construct(string $customerId, string $subscriptionId, string $mandateId) { $this->customerId = $customerId; diff --git a/subscription/DTO/index.php b/subscription/DTO/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/DTO/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Entity/MolRecurringOrder.php b/subscription/Entity/MolRecurringOrder.php index 07adcee47..1d266a039 100644 --- a/subscription/Entity/MolRecurringOrder.php +++ b/subscription/Entity/MolRecurringOrder.php @@ -1,4 +1,17 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +if (!defined('_PS_VERSION_')) { + exit; +} class MolRecurringOrder extends ObjectModel { diff --git a/subscription/Entity/MolRecurringOrdersProduct.php b/subscription/Entity/MolRecurringOrdersProduct.php index 5867a836f..9a301a264 100644 --- a/subscription/Entity/MolRecurringOrdersProduct.php +++ b/subscription/Entity/MolRecurringOrdersProduct.php @@ -1,4 +1,17 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +if (!defined('_PS_VERSION_')) { + exit; +} class MolRecurringOrdersProduct extends ObjectModel { diff --git a/subscription/Entity/index.php b/subscription/Entity/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Entity/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Exception/CouldNotHandleRecurringOrder.php b/subscription/Exception/CouldNotHandleRecurringOrder.php index a8aa3f9d5..64533dd68 100644 --- a/subscription/Exception/CouldNotHandleRecurringOrder.php +++ b/subscription/Exception/CouldNotHandleRecurringOrder.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class CouldNotHandleRecurringOrder extends MollieSubscriptionException { public static function failedToFindSelectedCarrier(): self diff --git a/subscription/Exception/CouldNotPresentOrderDetail.php b/subscription/Exception/CouldNotPresentOrderDetail.php index 8ed1c4c34..9146d1ac2 100644 --- a/subscription/Exception/CouldNotPresentOrderDetail.php +++ b/subscription/Exception/CouldNotPresentOrderDetail.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class CouldNotPresentOrderDetail extends MollieSubscriptionException { public static function failedToFindOrder(): self diff --git a/subscription/Exception/CouldNotProvideSubscriptionCarrierDeliveryPrice.php b/subscription/Exception/CouldNotProvideSubscriptionCarrierDeliveryPrice.php index 9d2f5fafb..72fbdae54 100644 --- a/subscription/Exception/CouldNotProvideSubscriptionCarrierDeliveryPrice.php +++ b/subscription/Exception/CouldNotProvideSubscriptionCarrierDeliveryPrice.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class CouldNotProvideSubscriptionCarrierDeliveryPrice extends MollieSubscriptionException { public static function failedToFindSelectedCarrier(): self diff --git a/subscription/Exception/ExceptionCode.php b/subscription/Exception/ExceptionCode.php index 1d2710b49..43432ad4d 100644 --- a/subscription/Exception/ExceptionCode.php +++ b/subscription/Exception/ExceptionCode.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class ExceptionCode { //Order error codes starts from 1000 diff --git a/subscription/Exception/MollieModuleNotFoundException.php b/subscription/Exception/MollieModuleNotFoundException.php index 25e99dda0..cf59fed6d 100644 --- a/subscription/Exception/MollieModuleNotFoundException.php +++ b/subscription/Exception/MollieModuleNotFoundException.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieModuleNotFoundException extends MollieSubscriptionException { } diff --git a/subscription/Exception/MollieSubscriptionException.php b/subscription/Exception/MollieSubscriptionException.php index fad6a5e42..59b721c62 100644 --- a/subscription/Exception/MollieSubscriptionException.php +++ b/subscription/Exception/MollieSubscriptionException.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -6,6 +16,10 @@ use Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieSubscriptionException extends Exception { } diff --git a/subscription/Exception/NotImplementedException.php b/subscription/Exception/NotImplementedException.php index 322280d7d..36e2bc637 100644 --- a/subscription/Exception/NotImplementedException.php +++ b/subscription/Exception/NotImplementedException.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class NotImplementedException extends MollieSubscriptionException { } diff --git a/subscription/Exception/SubscriptionApiException.php b/subscription/Exception/SubscriptionApiException.php index a5ca9169b..1c417ed33 100644 --- a/subscription/Exception/SubscriptionApiException.php +++ b/subscription/Exception/SubscriptionApiException.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionApiException extends MollieSubscriptionException { public const CREATION_FAILED = 0; diff --git a/subscription/Exception/SubscriptionIntervalException.php b/subscription/Exception/SubscriptionIntervalException.php index 6d22bd688..f2db408a3 100644 --- a/subscription/Exception/SubscriptionIntervalException.php +++ b/subscription/Exception/SubscriptionIntervalException.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionIntervalException extends MollieSubscriptionException { } diff --git a/subscription/Exception/SubscriptionProductValidationException.php b/subscription/Exception/SubscriptionProductValidationException.php index 98a9806fb..439ef2c3e 100644 --- a/subscription/Exception/SubscriptionProductValidationException.php +++ b/subscription/Exception/SubscriptionProductValidationException.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Exception; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionProductValidationException extends MollieSubscriptionException { } diff --git a/subscription/Exception/index.php b/subscription/Exception/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Exception/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Factory/CancelSubscriptionDataFactory.php b/subscription/Factory/CancelSubscriptionDataFactory.php index 13729d47e..3e3adbfa2 100644 --- a/subscription/Factory/CancelSubscriptionDataFactory.php +++ b/subscription/Factory/CancelSubscriptionDataFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use Mollie\Subscription\DTO\CancelSubscriptionData as CancelSubscriptionDataDTO; use Mollie\Subscription\Repository\RecurringOrderRepositoryInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class CancelSubscriptionDataFactory { /** @var RecurringOrderRepositoryInterface */ diff --git a/subscription/Factory/CreateFreeOrderDataFactory.php b/subscription/Factory/CreateFreeOrderDataFactory.php index 0fc37f838..c0779d9e4 100644 --- a/subscription/Factory/CreateFreeOrderDataFactory.php +++ b/subscription/Factory/CreateFreeOrderDataFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use Mollie\Subscription\DTO\CreateFreeOrderData; use MolRecurringOrder; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateFreeOrderDataFactory { /** @var Link */ diff --git a/subscription/Factory/CreateMandateDataFactory.php b/subscription/Factory/CreateMandateDataFactory.php index a3872ba76..c63c8ed82 100644 --- a/subscription/Factory/CreateMandateDataFactory.php +++ b/subscription/Factory/CreateMandateDataFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -9,6 +19,10 @@ use Mollie\Subscription\DTO\CreateMandateData as CreateMandateDataDTO; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateMandateDataFactory { /** @var MolCustomerRepository */ diff --git a/subscription/Factory/CreateSubscriptionDataFactory.php b/subscription/Factory/CreateSubscriptionDataFactory.php index fbf63adb7..c3deca151 100644 --- a/subscription/Factory/CreateSubscriptionDataFactory.php +++ b/subscription/Factory/CreateSubscriptionDataFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -20,6 +30,10 @@ use Mollie\Utility\SecureKeyUtility; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class CreateSubscriptionDataFactory { /** @var MolCustomerRepository */ diff --git a/subscription/Factory/GetSubscriptionDataFactory.php b/subscription/Factory/GetSubscriptionDataFactory.php index a2eb4e0ae..003928147 100644 --- a/subscription/Factory/GetSubscriptionDataFactory.php +++ b/subscription/Factory/GetSubscriptionDataFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use Mollie\Subscription\DTO\GetSubscriptionData as GetSubscriptionDataDTO; use Mollie\Subscription\Repository\RecurringOrderRepositoryInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class GetSubscriptionDataFactory { /** @var RecurringOrderRepositoryInterface */ diff --git a/subscription/Factory/MollieApiFactory.php b/subscription/Factory/MollieApiFactory.php index 238403f7f..f138d2688 100644 --- a/subscription/Factory/MollieApiFactory.php +++ b/subscription/Factory/MollieApiFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -10,6 +20,10 @@ use Mollie\Subscription\Config\Config; use Mollie\Subscription\Exception\MollieModuleNotFoundException; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieApiFactory { public function getMollieClient(): ?MollieApiClient diff --git a/subscription/Factory/UpdateSubscriptionDataFactory.php b/subscription/Factory/UpdateSubscriptionDataFactory.php index 87f9bce25..e0586ff5e 100644 --- a/subscription/Factory/UpdateSubscriptionDataFactory.php +++ b/subscription/Factory/UpdateSubscriptionDataFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use Mollie\Subscription\DTO\UpdateSubscriptionData; use MolRecurringOrder; +if (!defined('_PS_VERSION_')) { + exit; +} + class UpdateSubscriptionDataFactory { public function build(MolRecurringOrder $subscription, string $mandateId): UpdateSubscriptionData diff --git a/subscription/Factory/index.php b/subscription/Factory/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Factory/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Filters/SubscriptionFilters.php b/subscription/Filters/SubscriptionFilters.php index 11de81977..1b9c7196c 100644 --- a/subscription/Filters/SubscriptionFilters.php +++ b/subscription/Filters/SubscriptionFilters.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Filters; use Mollie\Subscription\Grid\SubscriptionGridDefinitionFactory; use PrestaShop\PrestaShop\Core\Search\Filters; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionFilters extends Filters { /** @var string */ diff --git a/subscription/Filters/index.php b/subscription/Filters/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Filters/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Form/ChoiceProvider/CarrierOptionsProvider.php b/subscription/Form/ChoiceProvider/CarrierOptionsProvider.php index 17c45a00a..220d7cc4c 100644 --- a/subscription/Form/ChoiceProvider/CarrierOptionsProvider.php +++ b/subscription/Form/ChoiceProvider/CarrierOptionsProvider.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Form\ChoiceProvider; use Mollie\Repository\CarrierRepositoryInterface; use PrestaShop\PrestaShop\Core\Form\FormChoiceProviderInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class CarrierOptionsProvider implements FormChoiceProviderInterface { /** @var CarrierRepositoryInterface */ diff --git a/subscription/Form/ChoiceProvider/index.php b/subscription/Form/ChoiceProvider/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Form/ChoiceProvider/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Form/Options/SubscriptionOptionsConfiguration.php b/subscription/Form/Options/SubscriptionOptionsConfiguration.php index e3cb1ee5a..dbd78b5ed 100644 --- a/subscription/Form/Options/SubscriptionOptionsConfiguration.php +++ b/subscription/Form/Options/SubscriptionOptionsConfiguration.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Form\Options; @@ -6,6 +16,10 @@ use PrestaShop\PrestaShop\Adapter\Configuration; use PrestaShop\PrestaShop\Core\Configuration\DataConfigurationInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + final class SubscriptionOptionsConfiguration implements DataConfigurationInterface { /** @@ -13,9 +27,6 @@ final class SubscriptionOptionsConfiguration implements DataConfigurationInterfa */ private $configuration; - /** - * @param Configuration $configuration - */ public function __construct(Configuration $configuration) { $this->configuration = $configuration; diff --git a/subscription/Form/Options/SubscriptionOptionsDataProvider.php b/subscription/Form/Options/SubscriptionOptionsDataProvider.php index 2d534613c..dafed2660 100644 --- a/subscription/Form/Options/SubscriptionOptionsDataProvider.php +++ b/subscription/Form/Options/SubscriptionOptionsDataProvider.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Form\Options; @@ -6,6 +16,10 @@ use PrestaShop\PrestaShop\Core\Configuration\DataConfigurationInterface; use PrestaShop\PrestaShop\Core\Form\FormDataProviderInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + final class SubscriptionOptionsDataProvider implements FormDataProviderInterface { /** @var DataConfigurationInterface */ diff --git a/subscription/Form/Options/SubscriptionOptionsType.php b/subscription/Form/Options/SubscriptionOptionsType.php index 22de3db2e..fefa5ef2e 100644 --- a/subscription/Form/Options/SubscriptionOptionsType.php +++ b/subscription/Form/Options/SubscriptionOptionsType.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Form\Options; @@ -9,6 +19,10 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Translation\TranslatorInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionOptionsType extends TranslatorAwareType { /** @var FormChoiceProviderInterface */ diff --git a/subscription/Form/Options/index.php b/subscription/Form/Options/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Form/Options/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Form/index.php b/subscription/Form/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Form/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Grid/Accessibility/SubscriptionCancelAccessibility.php b/subscription/Grid/Accessibility/SubscriptionCancelAccessibility.php index cfffdcff6..238d5a316 100644 --- a/subscription/Grid/Accessibility/SubscriptionCancelAccessibility.php +++ b/subscription/Grid/Accessibility/SubscriptionCancelAccessibility.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use MolRecurringOrder; use PrestaShop\PrestaShop\Core\Grid\Action\Row\AccessibilityChecker\AccessibilityCheckerInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionCancelAccessibility implements AccessibilityCheckerInterface { public function isGranted(array $record): bool diff --git a/subscription/Grid/Accessibility/index.php b/subscription/Grid/Accessibility/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Grid/Accessibility/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Grid/SubscriptionGridDefinitionFactory.php b/subscription/Grid/SubscriptionGridDefinitionFactory.php index 876d18058..ee0f79afa 100644 --- a/subscription/Grid/SubscriptionGridDefinitionFactory.php +++ b/subscription/Grid/SubscriptionGridDefinitionFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -19,6 +29,10 @@ use Symfony\Component\Form\Extension\Core\Type\MoneyType; use Symfony\Component\Form\Extension\Core\Type\TextType; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionGridDefinitionFactory extends AbstractGridDefinitionFactory { private const FILE_NAME = 'SubscriptionGridDefinitionFactory'; diff --git a/subscription/Grid/SubscriptionGridQueryBuilder.php b/subscription/Grid/SubscriptionGridQueryBuilder.php index 307d27150..a305b8b43 100644 --- a/subscription/Grid/SubscriptionGridQueryBuilder.php +++ b/subscription/Grid/SubscriptionGridQueryBuilder.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -11,6 +21,10 @@ use PrestaShop\PrestaShop\Core\Grid\Query\DoctrineSearchCriteriaApplicatorInterface; use PrestaShop\PrestaShop\Core\Grid\Search\SearchCriteriaInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + /** * Provides sql for subscription list */ @@ -21,11 +35,6 @@ class SubscriptionGridQueryBuilder extends AbstractDoctrineQueryBuilder */ private $searchCriteriaApplicator; - /** - * @param Connection $connection - * @param string $dbPrefix - * @param DoctrineSearchCriteriaApplicatorInterface $searchCriteriaApplicator - */ public function __construct( Connection $connection, string $dbPrefix, @@ -37,10 +46,6 @@ public function __construct( /** * Get query that searches grid rows. - * - * @param SearchCriteriaInterface $searchCriteria - * - * @return QueryBuilder */ public function getSearchQueryBuilder(SearchCriteriaInterface $searchCriteria): QueryBuilder { @@ -60,10 +65,6 @@ public function getSearchQueryBuilder(SearchCriteriaInterface $searchCriteria): /** * Get query that counts grid rows. - * - * @param SearchCriteriaInterface $searchCriteria - * - * @return QueryBuilder */ public function getCountQueryBuilder(SearchCriteriaInterface $searchCriteria): QueryBuilder { @@ -75,8 +76,6 @@ public function getCountQueryBuilder(SearchCriteriaInterface $searchCriteria): Q /** * @param array $filters - * - * @return QueryBuilder */ private function getQueryBuilder(array $filters): QueryBuilder { @@ -95,7 +94,6 @@ private function getQueryBuilder(array $filters): QueryBuilder /** * @param array $filters - * @param QueryBuilder $qb */ private function applyFilters(array $filters, QueryBuilder $qb): void { diff --git a/subscription/Grid/index.php b/subscription/Grid/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Grid/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Handler/CustomerAddressUpdateHandler.php b/subscription/Handler/CustomerAddressUpdateHandler.php index 857031927..d6bbc36af 100644 --- a/subscription/Handler/CustomerAddressUpdateHandler.php +++ b/subscription/Handler/CustomerAddressUpdateHandler.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Handler; use Mollie\Subscription\Utility\ClockInterface; use MolRecurringOrder; +if (!defined('_PS_VERSION_')) { + exit; +} + class CustomerAddressUpdateHandler { /** @var ClockInterface */ @@ -17,10 +31,6 @@ public function __construct(ClockInterface $clock) /** * @param MolRecurringOrder[] $orders - * @param int $newAddressId - * @param int $oldAddressId - * - * @return void * * @throws \PrestaShopDatabaseException * @throws \PrestaShopException diff --git a/subscription/Handler/FreeOrderCreationHandler.php b/subscription/Handler/FreeOrderCreationHandler.php index 7fab68dd7..35e7968ca 100644 --- a/subscription/Handler/FreeOrderCreationHandler.php +++ b/subscription/Handler/FreeOrderCreationHandler.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use Mollie\Subscription\Factory\CreateFreeOrderDataFactory; use Mollie\Subscription\Repository\RecurringOrderRepositoryInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class FreeOrderCreationHandler { /** @var RecurringOrderRepositoryInterface */ diff --git a/subscription/Handler/RecurringOrderHandler.php b/subscription/Handler/RecurringOrderHandler.php index a35e2a265..d7bb97a36 100644 --- a/subscription/Handler/RecurringOrderHandler.php +++ b/subscription/Handler/RecurringOrderHandler.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -36,6 +46,10 @@ use MolRecurringOrdersProduct; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class RecurringOrderHandler { /** @var SubscriptionApi */ diff --git a/subscription/Handler/SubscriptionCancellationHandler.php b/subscription/Handler/SubscriptionCancellationHandler.php index 5dc801bff..963fe80cb 100644 --- a/subscription/Handler/SubscriptionCancellationHandler.php +++ b/subscription/Handler/SubscriptionCancellationHandler.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -12,6 +22,10 @@ use Mollie\Subscription\Utility\ClockInterface; use MolRecurringOrder; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionCancellationHandler { /** @var ClockInterface */ diff --git a/subscription/Handler/SubscriptionCreationHandler.php b/subscription/Handler/SubscriptionCreationHandler.php index 9f5e027cf..8376b8a33 100644 --- a/subscription/Handler/SubscriptionCreationHandler.php +++ b/subscription/Handler/SubscriptionCreationHandler.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -13,6 +23,10 @@ use MolRecurringOrdersProduct; use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionCreationHandler { /** @var ClockInterface */ diff --git a/subscription/Handler/SubscriptionPaymentMethodUpdateHandler.php b/subscription/Handler/SubscriptionPaymentMethodUpdateHandler.php index c6cfb8e02..42c40114b 100644 --- a/subscription/Handler/SubscriptionPaymentMethodUpdateHandler.php +++ b/subscription/Handler/SubscriptionPaymentMethodUpdateHandler.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -11,6 +21,10 @@ use Mollie\Subscription\Repository\RecurringOrderRepositoryInterface; use Mollie\Subscription\Utility\ClockInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionPaymentMethodUpdateHandler { /** @var SubscriptionApi */ diff --git a/subscription/Handler/index.php b/subscription/Handler/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Handler/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Install/AbstractInstaller.php b/subscription/Install/AbstractInstaller.php index 46018e328..cf4e1628b 100644 --- a/subscription/Install/AbstractInstaller.php +++ b/subscription/Install/AbstractInstaller.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Install; +if (!defined('_PS_VERSION_')) { + exit; +} + abstract class AbstractInstaller implements InstallerInterface { /** @var string[] */ diff --git a/subscription/Install/AbstractUninstaller.php b/subscription/Install/AbstractUninstaller.php index 5cd55c5f1..559b6d284 100644 --- a/subscription/Install/AbstractUninstaller.php +++ b/subscription/Install/AbstractUninstaller.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Install; +if (!defined('_PS_VERSION_')) { + exit; +} + abstract class AbstractUninstaller implements UninstallerInterface { /** @var string[] */ diff --git a/subscription/Install/AttributeInstaller.php b/subscription/Install/AttributeInstaller.php index edaf8a244..ebf541dba 100644 --- a/subscription/Install/AttributeInstaller.php +++ b/subscription/Install/AttributeInstaller.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -16,6 +26,10 @@ use Psr\Log\LogLevel; use Validate; +if (!defined('_PS_VERSION_')) { + exit; +} + class AttributeInstaller extends AbstractInstaller { private const FILE_NAME = 'AttributeInstaller'; @@ -68,8 +82,6 @@ public function install(): bool /** * @param array> $languages - * - * @return AttributeGroup */ private function createAttributeGroup(array $languages): AttributeGroup { @@ -95,9 +107,6 @@ private function createAttributeGroup(array $languages): AttributeGroup /** * @param array> $languages - * @param int $attributeGroupId - * - * @return void */ private function createAttributes(array $languages, int $attributeGroupId): void { diff --git a/subscription/Install/AttributeUninstaller.php b/subscription/Install/AttributeUninstaller.php index 8de11089b..7765bcc42 100644 --- a/subscription/Install/AttributeUninstaller.php +++ b/subscription/Install/AttributeUninstaller.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -12,6 +22,10 @@ use PrestaShopException; use Psr\Log\LogLevel; +if (!defined('_PS_VERSION_')) { + exit; +} + class AttributeUninstaller extends AbstractUninstaller { private const FILE_NAME = 'AttributeUninstaller'; diff --git a/subscription/Install/DatabaseTableInstaller.php b/subscription/Install/DatabaseTableInstaller.php index 497e6718c..14f500247 100644 --- a/subscription/Install/DatabaseTableInstaller.php +++ b/subscription/Install/DatabaseTableInstaller.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -6,6 +16,10 @@ use Db; +if (!defined('_PS_VERSION_')) { + exit; +} + final class DatabaseTableInstaller extends AbstractInstaller { public function install(): bool @@ -21,9 +35,6 @@ public function install(): bool return $this->alterTableCommands(); } - /** - * @return array - */ private function getCommands(): array { $sql = []; diff --git a/subscription/Install/DatabaseTableUninstaller.php b/subscription/Install/DatabaseTableUninstaller.php index ea3a1789b..f66d2581d 100644 --- a/subscription/Install/DatabaseTableUninstaller.php +++ b/subscription/Install/DatabaseTableUninstaller.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -6,6 +16,10 @@ use Db; +if (!defined('_PS_VERSION_')) { + exit; +} + final class DatabaseTableUninstaller extends AbstractUninstaller { public function uninstall(): bool diff --git a/subscription/Install/HookInstaller.php b/subscription/Install/HookInstaller.php index 3240f4585..a0b901163 100644 --- a/subscription/Install/HookInstaller.php +++ b/subscription/Install/HookInstaller.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use Mollie; use Mollie\Utility\PsVersionUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class HookInstaller extends AbstractInstaller { /** @var Mollie */ diff --git a/subscription/Install/Installer.php b/subscription/Install/Installer.php index 89d9a0786..6d854ad74 100644 --- a/subscription/Install/Installer.php +++ b/subscription/Install/Installer.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Install; +if (!defined('_PS_VERSION_')) { + exit; +} + class Installer extends AbstractInstaller { /** @var InstallerInterface */ diff --git a/subscription/Install/InstallerInterface.php b/subscription/Install/InstallerInterface.php index 85199d8c3..e0034d0b0 100644 --- a/subscription/Install/InstallerInterface.php +++ b/subscription/Install/InstallerInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Install; +if (!defined('_PS_VERSION_')) { + exit; +} + interface InstallerInterface { /** diff --git a/subscription/Install/Uninstaller.php b/subscription/Install/Uninstaller.php index a279f6888..473831e91 100644 --- a/subscription/Install/Uninstaller.php +++ b/subscription/Install/Uninstaller.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Install; +if (!defined('_PS_VERSION_')) { + exit; +} + class Uninstaller extends AbstractUninstaller { /** @var UninstallerInterface */ diff --git a/subscription/Install/UninstallerInterface.php b/subscription/Install/UninstallerInterface.php index aad5b7479..5ad31c73a 100644 --- a/subscription/Install/UninstallerInterface.php +++ b/subscription/Install/UninstallerInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Install; +if (!defined('_PS_VERSION_')) { + exit; +} + interface UninstallerInterface { public function uninstall(): bool; diff --git a/subscription/Install/index.php b/subscription/Install/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Install/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Logger/Logger.php b/subscription/Logger/Logger.php index 86f9a3df1..97bb1f21c 100644 --- a/subscription/Logger/Logger.php +++ b/subscription/Logger/Logger.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Logger; +if (!defined('_PS_VERSION_')) { + exit; +} + class Logger implements LoggerInterface { const FILE_NAME = 'Logger'; diff --git a/subscription/Logger/LoggerInterface.php b/subscription/Logger/LoggerInterface.php index abae4e177..1d8f0b5a3 100644 --- a/subscription/Logger/LoggerInterface.php +++ b/subscription/Logger/LoggerInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Logger; +if (!defined('_PS_VERSION_')) { + exit; +} + interface LoggerInterface extends \Psr\Log\LoggerInterface { } diff --git a/subscription/Logger/NullLogger.php b/subscription/Logger/NullLogger.php index 64db18dcb..bdfee6fe0 100644 --- a/subscription/Logger/NullLogger.php +++ b/subscription/Logger/NullLogger.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Logger; +if (!defined('_PS_VERSION_')) { + exit; +} + //NOTE only should be used for tests final class NullLogger implements LoggerInterface { diff --git a/subscription/Logger/index.php b/subscription/Logger/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Logger/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Presenter/OrderDetailPresenter.php b/subscription/Presenter/OrderDetailPresenter.php index 9d02c0d9e..a7deae596 100644 --- a/subscription/Presenter/OrderDetailPresenter.php +++ b/subscription/Presenter/OrderDetailPresenter.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Presenter; @@ -11,6 +21,10 @@ use Mollie\Subscription\Repository\OrderDetailRepositoryInterface; use Mollie\Utility\NumberUtility; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderDetailPresenter { /** @var OrderDetailRepositoryInterface */ diff --git a/subscription/Presenter/RecurringOrderPresenter.php b/subscription/Presenter/RecurringOrderPresenter.php index 0c73f39e2..fac199df0 100644 --- a/subscription/Presenter/RecurringOrderPresenter.php +++ b/subscription/Presenter/RecurringOrderPresenter.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -13,6 +23,10 @@ use PrestaShop\PrestaShop\Adapter\Presenter\Order\OrderPresenter; use Product; +if (!defined('_PS_VERSION_')) { + exit; +} + class RecurringOrderPresenter { /** @var RecurringOrderRepositoryInterface */ diff --git a/subscription/Presenter/RecurringOrdersPresenter.php b/subscription/Presenter/RecurringOrdersPresenter.php index 42bc1f93b..2b96939f8 100644 --- a/subscription/Presenter/RecurringOrdersPresenter.php +++ b/subscription/Presenter/RecurringOrdersPresenter.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -15,6 +25,10 @@ use MolRecurringOrder; use Product; +if (!defined('_PS_VERSION_')) { + exit; +} + class RecurringOrdersPresenter { /** @var RecurringOrderRepositoryInterface */ diff --git a/subscription/Presenter/index.php b/subscription/Presenter/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Presenter/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Provider/MollieModuleServiceProvider.php b/subscription/Provider/MollieModuleServiceProvider.php index 3fbf621d9..c9c227bec 100644 --- a/subscription/Provider/MollieModuleServiceProvider.php +++ b/subscription/Provider/MollieModuleServiceProvider.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use Module; use Mollie; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieModuleServiceProvider { public function get(string $service) diff --git a/subscription/Provider/SubscriptionCarrierDeliveryPriceProvider.php b/subscription/Provider/SubscriptionCarrierDeliveryPriceProvider.php index 39dd93fbf..5fbc7d64e 100644 --- a/subscription/Provider/SubscriptionCarrierDeliveryPriceProvider.php +++ b/subscription/Provider/SubscriptionCarrierDeliveryPriceProvider.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Provider; @@ -11,6 +21,10 @@ use Mollie\Repository\CustomerRepositoryInterface; use Mollie\Subscription\Exception\CouldNotProvideSubscriptionCarrierDeliveryPrice; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionCarrierDeliveryPriceProvider { /** @var ConfigurationAdapter */ diff --git a/subscription/Provider/SubscriptionDescriptionProvider.php b/subscription/Provider/SubscriptionDescriptionProvider.php index 5adc69c35..b15560ec8 100644 --- a/subscription/Provider/SubscriptionDescriptionProvider.php +++ b/subscription/Provider/SubscriptionDescriptionProvider.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -6,6 +16,10 @@ use Order; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionDescriptionProvider { public function getSubscriptionDescription(Order $order) diff --git a/subscription/Provider/SubscriptionIntervalProvider.php b/subscription/Provider/SubscriptionIntervalProvider.php index 63a9a9dee..be232827b 100644 --- a/subscription/Provider/SubscriptionIntervalProvider.php +++ b/subscription/Provider/SubscriptionIntervalProvider.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -10,6 +20,10 @@ use Mollie\Subscription\DTO\Object\Interval; use Mollie\Subscription\Exception\SubscriptionIntervalException; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionIntervalProvider { /** @var ConfigurationAdapter */ diff --git a/subscription/Provider/index.php b/subscription/Provider/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Provider/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Repository/AbstractRepository.php b/subscription/Repository/AbstractRepository.php index 9e203269c..b6c2ed13b 100644 --- a/subscription/Repository/AbstractRepository.php +++ b/subscription/Repository/AbstractRepository.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use PrestaShopCollection; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + abstract class AbstractRepository { /** @@ -39,8 +53,6 @@ public function findAll() } /** - * @param array $keyValueCriteria - * * @return ObjectModel|null * * @throws PrestaShopException @@ -60,8 +72,6 @@ public function findOneBy(array $keyValueCriteria) } /** - * @param array $keyValueCriteria - * * @return PrestaShopCollection|null * * @throws PrestaShopException diff --git a/subscription/Repository/CombinationRepository.php b/subscription/Repository/CombinationRepository.php index ad07f0130..2d30c74d3 100644 --- a/subscription/Repository/CombinationRepository.php +++ b/subscription/Repository/CombinationRepository.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class CombinationRepository { public function getById(int $id): \Combination diff --git a/subscription/Repository/CurrencyRepository.php b/subscription/Repository/CurrencyRepository.php index f326268d7..18348cfbc 100644 --- a/subscription/Repository/CurrencyRepository.php +++ b/subscription/Repository/CurrencyRepository.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class CurrencyRepository { public function getById(int $id): \Currency diff --git a/subscription/Repository/LanguageRepository.php b/subscription/Repository/LanguageRepository.php index a3a202edb..f1cf22b5c 100644 --- a/subscription/Repository/LanguageRepository.php +++ b/subscription/Repository/LanguageRepository.php @@ -1,22 +1,30 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class LanguageRepository { - /** - * @return int - **/ public function getDefaultLanguageId(): int { return (int) \Configuration::get('PS_LANG_DEFAULT'); } - /** - * @return array - **/ public function getAllLanguages(): array { return \Language::getLanguages(false); diff --git a/subscription/Repository/OrderDetailRepository.php b/subscription/Repository/OrderDetailRepository.php index 5afa02e64..9b79722cc 100644 --- a/subscription/Repository/OrderDetailRepository.php +++ b/subscription/Repository/OrderDetailRepository.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class OrderDetailRepository extends AbstractRepository implements OrderDetailRepositoryInterface { public function __construct() diff --git a/subscription/Repository/OrderDetailRepositoryInterface.php b/subscription/Repository/OrderDetailRepositoryInterface.php index 8d93bb236..4ad3825b6 100644 --- a/subscription/Repository/OrderDetailRepositoryInterface.php +++ b/subscription/Repository/OrderDetailRepositoryInterface.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Repository; use Mollie\Repository\ReadOnlyRepositoryInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + interface OrderDetailRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/subscription/Repository/ProductCombinationRepository.php b/subscription/Repository/ProductCombinationRepository.php index c5563a663..e3cd0c145 100644 --- a/subscription/Repository/ProductCombinationRepository.php +++ b/subscription/Repository/ProductCombinationRepository.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class ProductCombinationRepository { public function getIds(int $combinationId): array diff --git a/subscription/Repository/RecurringOrderRepository.php b/subscription/Repository/RecurringOrderRepository.php index eb48cfc55..d3213f1c5 100644 --- a/subscription/Repository/RecurringOrderRepository.php +++ b/subscription/Repository/RecurringOrderRepository.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use MolRecurringOrder; use PrestaShopCollection; +if (!defined('_PS_VERSION_')) { + exit; +} + class RecurringOrderRepository extends AbstractRepository implements RecurringOrderRepositoryInterface { public function findOneBy(array $keyValueCriteria): ?MolRecurringOrder diff --git a/subscription/Repository/RecurringOrderRepositoryInterface.php b/subscription/Repository/RecurringOrderRepositoryInterface.php index 18092ca62..7bcf75013 100644 --- a/subscription/Repository/RecurringOrderRepositoryInterface.php +++ b/subscription/Repository/RecurringOrderRepositoryInterface.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -8,6 +18,10 @@ use PrestaShopCollection; use PrestaShopException; +if (!defined('_PS_VERSION_')) { + exit; +} + interface RecurringOrderRepositoryInterface { // TODO add return types for all repositories diff --git a/subscription/Repository/RecurringOrdersProductRepository.php b/subscription/Repository/RecurringOrdersProductRepository.php index 7115076fd..84aa9c46e 100644 --- a/subscription/Repository/RecurringOrdersProductRepository.php +++ b/subscription/Repository/RecurringOrdersProductRepository.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use MolRecurringOrdersProduct; use PrestaShopCollection; +if (!defined('_PS_VERSION_')) { + exit; +} + class RecurringOrdersProductRepository extends AbstractRepository implements RecurringOrdersProductRepositoryInterface { public function findOneBy(array $keyValueCriteria): ?MolRecurringOrdersProduct diff --git a/subscription/Repository/RecurringOrdersProductRepositoryInterface.php b/subscription/Repository/RecurringOrdersProductRepositoryInterface.php index db7e768b2..f74937bd6 100644 --- a/subscription/Repository/RecurringOrdersProductRepositoryInterface.php +++ b/subscription/Repository/RecurringOrdersProductRepositoryInterface.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -7,6 +17,10 @@ use MolRecurringOrdersProduct; use PrestaShopCollection; +if (!defined('_PS_VERSION_')) { + exit; +} + interface RecurringOrdersProductRepositoryInterface { /** diff --git a/subscription/Repository/SpecificPriceRepository.php b/subscription/Repository/SpecificPriceRepository.php index 3702afea1..49dcdd286 100644 --- a/subscription/Repository/SpecificPriceRepository.php +++ b/subscription/Repository/SpecificPriceRepository.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Repository; +if (!defined('_PS_VERSION_')) { + exit; +} + class SpecificPriceRepository extends AbstractRepository implements SpecificPriceRepositoryInterface { public function __construct() diff --git a/subscription/Repository/SpecificPriceRepositoryInterface.php b/subscription/Repository/SpecificPriceRepositoryInterface.php index 72d322208..62a901ff6 100644 --- a/subscription/Repository/SpecificPriceRepositoryInterface.php +++ b/subscription/Repository/SpecificPriceRepositoryInterface.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Repository; use Mollie\Repository\ReadOnlyRepositoryInterface; +if (!defined('_PS_VERSION_')) { + exit; +} + interface SpecificPriceRepositoryInterface extends ReadOnlyRepositoryInterface { } diff --git a/subscription/Repository/index.php b/subscription/Repository/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Repository/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Utility/Clock.php b/subscription/Utility/Clock.php index 3367fc226..c68df3d19 100644 --- a/subscription/Utility/Clock.php +++ b/subscription/Utility/Clock.php @@ -1,9 +1,23 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); namespace Mollie\Subscription\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class Clock implements ClockInterface { public function getCurrentDate(string $format = 'Y-m-d H:i:s'): string diff --git a/subscription/Utility/ClockInterface.php b/subscription/Utility/ClockInterface.php index 11ae33fe2..f14f47964 100644 --- a/subscription/Utility/ClockInterface.php +++ b/subscription/Utility/ClockInterface.php @@ -1,7 +1,21 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + interface ClockInterface { public function getCurrentDate(string $format = 'Y-m-d H:i:s'): string; diff --git a/subscription/Utility/index.php b/subscription/Utility/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Utility/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Validator/CanProductBeAddedToCartValidator.php b/subscription/Validator/CanProductBeAddedToCartValidator.php index 1060d0139..0a0ae61c0 100644 --- a/subscription/Validator/CanProductBeAddedToCartValidator.php +++ b/subscription/Validator/CanProductBeAddedToCartValidator.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -9,6 +19,10 @@ use Mollie\Subscription\Exception\ExceptionCode; use Mollie\Subscription\Exception\SubscriptionProductValidationException; +if (!defined('_PS_VERSION_')) { + exit; +} + class CanProductBeAddedToCartValidator { /** @var CartAdapter */ @@ -34,10 +48,6 @@ public function __construct( * Validates if product can be added to the cart. * Only 1 subscription product can be to the cart * - * @param int $productAttributeId - * - * @return bool - * * @throws SubscriptionProductValidationException */ public function validate(int $productAttributeId): bool @@ -54,10 +64,6 @@ public function validate(int $productAttributeId): bool } /** - * @param int $productAttributeId - * - * @return bool - * * @throws SubscriptionProductValidationException */ private function validateIfSubscriptionProductCanBeAdded(int $productAttributeId): bool diff --git a/subscription/Validator/SubscriptionOrderValidator.php b/subscription/Validator/SubscriptionOrderValidator.php index d6948f6aa..d35ed08dd 100644 --- a/subscription/Validator/SubscriptionOrderValidator.php +++ b/subscription/Validator/SubscriptionOrderValidator.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -6,6 +16,10 @@ use Cart; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionOrderValidator { /** @var SubscriptionProductValidator */ diff --git a/subscription/Validator/SubscriptionProductValidator.php b/subscription/Validator/SubscriptionProductValidator.php index e00f345f2..0be48321b 100644 --- a/subscription/Validator/SubscriptionProductValidator.php +++ b/subscription/Validator/SubscriptionProductValidator.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); @@ -11,6 +21,10 @@ use Mollie\Subscription\Repository\CombinationRepository; use Mollie\Subscription\Repository\ProductCombinationRepository; +if (!defined('_PS_VERSION_')) { + exit; +} + class SubscriptionProductValidator { /** @var ConfigurationAdapter */ diff --git a/subscription/Validator/index.php b/subscription/Validator/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Validator/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/Verification/HasSubscriptionProductInCart.php b/subscription/Verification/HasSubscriptionProductInCart.php index dfc64626e..7fea7c856 100644 --- a/subscription/Verification/HasSubscriptionProductInCart.php +++ b/subscription/Verification/HasSubscriptionProductInCart.php @@ -1,10 +1,24 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Verification; use Mollie\Adapter\Context; use Mollie\Subscription\Validator\SubscriptionProductValidator; +if (!defined('_PS_VERSION_')) { + exit; +} + class HasSubscriptionProductInCart { /** @var Context */ diff --git a/subscription/Verification/index.php b/subscription/Verification/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/Verification/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/subscription/index.php b/subscription/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/subscription/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Application/CommandHandler/RequestApplePayPaymentSessionHandlerTest.php b/tests/Integration/Application/CommandHandler/RequestApplePayPaymentSessionHandlerTest.php index 5aca037a2..5d9acdc7a 100644 --- a/tests/Integration/Application/CommandHandler/RequestApplePayPaymentSessionHandlerTest.php +++ b/tests/Integration/Application/CommandHandler/RequestApplePayPaymentSessionHandlerTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Application\Command\RequestApplePayPaymentSession; use Mollie\Application\CommandHandler\RequestApplePayPaymentSessionHandler; diff --git a/tests/Integration/Factory/AddressFactory.php b/tests/Integration/Factory/AddressFactory.php index 7d3321697..88a09c473 100644 --- a/tests/Integration/Factory/AddressFactory.php +++ b/tests/Integration/Factory/AddressFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Factory; diff --git a/tests/Integration/Factory/CarrierFactory.php b/tests/Integration/Factory/CarrierFactory.php index ab6aa3ccb..3652e5362 100644 --- a/tests/Integration/Factory/CarrierFactory.php +++ b/tests/Integration/Factory/CarrierFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Factory; diff --git a/tests/Integration/Factory/CartFactory.php b/tests/Integration/Factory/CartFactory.php index 54698b77c..c2eafb84d 100644 --- a/tests/Integration/Factory/CartFactory.php +++ b/tests/Integration/Factory/CartFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Factory; diff --git a/tests/Integration/Factory/CustomerFactory.php b/tests/Integration/Factory/CustomerFactory.php index 0906629b4..18c2ff9bb 100644 --- a/tests/Integration/Factory/CustomerFactory.php +++ b/tests/Integration/Factory/CustomerFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Factory; diff --git a/tests/Integration/Factory/FactoryInterface.php b/tests/Integration/Factory/FactoryInterface.php index 2b91d48c9..2b0cbc72f 100644 --- a/tests/Integration/Factory/FactoryInterface.php +++ b/tests/Integration/Factory/FactoryInterface.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Factory; diff --git a/tests/Integration/Factory/ProductFactory.php b/tests/Integration/Factory/ProductFactory.php index e44c0c4f9..66c1e55c6 100644 --- a/tests/Integration/Factory/ProductFactory.php +++ b/tests/Integration/Factory/ProductFactory.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Factory; diff --git a/tests/Integration/Factory/index.php b/tests/Integration/Factory/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Factory/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Infrastructure/Adapter/LockTest.php b/tests/Integration/Infrastructure/Adapter/LockTest.php index a5803fd41..6918af8b9 100644 --- a/tests/Integration/Infrastructure/Adapter/LockTest.php +++ b/tests/Integration/Infrastructure/Adapter/LockTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Infrastructure\Adapter; diff --git a/tests/Integration/Infrastructure/Adapter/index.php b/tests/Integration/Infrastructure/Adapter/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Infrastructure/Adapter/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Infrastructure/index.php b/tests/Integration/Infrastructure/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Infrastructure/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Install/OrderStateInstallerTest.php b/tests/Integration/Install/OrderStateInstallerTest.php index efe13004b..445a35fac 100644 --- a/tests/Integration/Install/OrderStateInstallerTest.php +++ b/tests/Integration/Install/OrderStateInstallerTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Install; diff --git a/tests/Integration/Install/index.php b/tests/Integration/Install/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Install/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Service/PaymentMethod/PaymentMethodRestrictionValidation/B2bPaymentMethodRestrictionValidatorTest.php b/tests/Integration/Service/PaymentMethod/PaymentMethodRestrictionValidation/B2bPaymentMethodRestrictionValidatorTest.php index ad88fa2c7..d5ae2401c 100644 --- a/tests/Integration/Service/PaymentMethod/PaymentMethodRestrictionValidation/B2bPaymentMethodRestrictionValidatorTest.php +++ b/tests/Integration/Service/PaymentMethod/PaymentMethodRestrictionValidation/B2bPaymentMethodRestrictionValidatorTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Service\PaymentMethod\PaymentMethodRestrictionValidation; diff --git a/tests/Integration/Service/PaymentMethod/PaymentMethodRestrictionValidation/index.php b/tests/Integration/Service/PaymentMethod/PaymentMethodRestrictionValidation/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Service/PaymentMethod/PaymentMethodRestrictionValidation/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Service/PaymentMethod/index.php b/tests/Integration/Service/PaymentMethod/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Service/PaymentMethod/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Service/index.php b/tests/Integration/Service/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Service/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Subscription/Action/CreateSpecificPriceActionTest.php b/tests/Integration/Subscription/Action/CreateSpecificPriceActionTest.php index c27213362..30d608b15 100644 --- a/tests/Integration/Subscription/Action/CreateSpecificPriceActionTest.php +++ b/tests/Integration/Subscription/Action/CreateSpecificPriceActionTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Subscription\Action; diff --git a/tests/Integration/Subscription/Action/index.php b/tests/Integration/Subscription/Action/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Subscription/Action/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Subscription/Factory/TestCreateMandateData.php b/tests/Integration/Subscription/Factory/TestCreateMandateData.php index 6e911f958..11bd2ec32 100644 --- a/tests/Integration/Subscription/Factory/TestCreateMandateData.php +++ b/tests/Integration/Subscription/Factory/TestCreateMandateData.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); diff --git a/tests/Integration/Subscription/Factory/TestCreateSubscriptionData.php b/tests/Integration/Subscription/Factory/TestCreateSubscriptionData.php index a3f3b0a2f..4d8b7b72b 100644 --- a/tests/Integration/Subscription/Factory/TestCreateSubscriptionData.php +++ b/tests/Integration/Subscription/Factory/TestCreateSubscriptionData.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); diff --git a/tests/Integration/Subscription/Factory/index.php b/tests/Integration/Subscription/Factory/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Subscription/Factory/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Subscription/Provider/SubscriptionCarrierDeliveryPriceProviderTest.php b/tests/Integration/Subscription/Provider/SubscriptionCarrierDeliveryPriceProviderTest.php index 1a5a890dc..0be142fb1 100644 --- a/tests/Integration/Subscription/Provider/SubscriptionCarrierDeliveryPriceProviderTest.php +++ b/tests/Integration/Subscription/Provider/SubscriptionCarrierDeliveryPriceProviderTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Subscription\Provider; diff --git a/tests/Integration/Subscription/Provider/index.php b/tests/Integration/Subscription/Provider/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Subscription/Provider/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Subscription/Tool/index.php b/tests/Integration/Subscription/Tool/index.php index 88355f610..d3343995f 100644 --- a/tests/Integration/Subscription/Tool/index.php +++ b/tests/Integration/Subscription/Tool/index.php @@ -1,5 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); diff --git a/tests/Integration/Subscription/Validator/CanProductBeAddedToCartValidatorTest.php b/tests/Integration/Subscription/Validator/CanProductBeAddedToCartValidatorTest.php index 319709425..0274d901c 100644 --- a/tests/Integration/Subscription/Validator/CanProductBeAddedToCartValidatorTest.php +++ b/tests/Integration/Subscription/Validator/CanProductBeAddedToCartValidatorTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Subscription\Validator; @@ -55,8 +65,6 @@ protected function setUp(): void /** * @dataProvider productDataProvider - * - * @return void */ public function testValidate(string $combinationReference, bool $hasExtraAttribute, array $cartProducts, $expectedResult): void { diff --git a/tests/Integration/Subscription/Validator/SubscriptionOrderValidatorTest.php b/tests/Integration/Subscription/Validator/SubscriptionOrderValidatorTest.php index dd2467b2d..1c9af8f6d 100644 --- a/tests/Integration/Subscription/Validator/SubscriptionOrderValidatorTest.php +++ b/tests/Integration/Subscription/Validator/SubscriptionOrderValidatorTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Subscription\Validator; @@ -50,8 +60,6 @@ protected function setUp(): void /** * @dataProvider productDataProvider - * - * @return void */ public function testValidate(array $orderProducts, $expectedResult): void { diff --git a/tests/Integration/Subscription/Validator/SubscriptionProductValidatorTest.php b/tests/Integration/Subscription/Validator/SubscriptionProductValidatorTest.php index 7448e07cb..437ebe1f5 100644 --- a/tests/Integration/Subscription/Validator/SubscriptionProductValidatorTest.php +++ b/tests/Integration/Subscription/Validator/SubscriptionProductValidatorTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\Subscription\Validator; diff --git a/tests/Integration/Subscription/Validator/index.php b/tests/Integration/Subscription/Validator/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Subscription/Validator/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/Subscription/index.php b/tests/Integration/Subscription/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/Subscription/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/src/Action/CreateOrderPaymentFeeActionTest.php b/tests/Integration/src/Action/CreateOrderPaymentFeeActionTest.php index 79890feaa..1385321aa 100644 --- a/tests/Integration/src/Action/CreateOrderPaymentFeeActionTest.php +++ b/tests/Integration/src/Action/CreateOrderPaymentFeeActionTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\src\Action; diff --git a/tests/Integration/src/Action/UpdateOrderTotalsActionTest.php b/tests/Integration/src/Action/UpdateOrderTotalsActionTest.php index 254d3caf3..cb9aa8e4e 100644 --- a/tests/Integration/src/Action/UpdateOrderTotalsActionTest.php +++ b/tests/Integration/src/Action/UpdateOrderTotalsActionTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Integration\src\Action; diff --git a/tests/Integration/src/Action/index.php b/tests/Integration/src/Action/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/src/Action/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Integration/src/index.php b/tests/Integration/src/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Integration/src/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Mollie/Tests/Unit/Utility/NumberUtilityTest.php b/tests/Mollie/Tests/Unit/Utility/NumberUtilityTest.php index 3d3e81b48..c7569cd40 100644 --- a/tests/Mollie/Tests/Unit/Utility/NumberUtilityTest.php +++ b/tests/Mollie/Tests/Unit/Utility/NumberUtilityTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Unit\Utility; diff --git a/tests/Mollie/Tests/Unit/Utility/index.php b/tests/Mollie/Tests/Unit/Utility/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Mollie/Tests/Unit/Utility/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Mollie/Tests/Unit/index.php b/tests/Mollie/Tests/Unit/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Mollie/Tests/Unit/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Mollie/Tests/index.php b/tests/Mollie/Tests/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Mollie/Tests/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Mollie/index.php b/tests/Mollie/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Mollie/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Unit/Builder/InvoicePdfTemplateBuilderTest.php b/tests/Unit/Builder/InvoicePdfTemplateBuilderTest.php index 17bc53974..f02d70f4d 100644 --- a/tests/Unit/Builder/InvoicePdfTemplateBuilderTest.php +++ b/tests/Unit/Builder/InvoicePdfTemplateBuilderTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Unit\Builder; diff --git a/tests/Unit/Calculator/PaymentFeeCalculatorTest.php b/tests/Unit/Calculator/PaymentFeeCalculatorTest.php index b7e33a7a3..ab5e06ba7 100644 --- a/tests/Unit/Calculator/PaymentFeeCalculatorTest.php +++ b/tests/Unit/Calculator/PaymentFeeCalculatorTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Unit\Calculator; diff --git a/tests/Unit/Calculator/index.php b/tests/Unit/Calculator/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Unit/Calculator/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Unit/Collector/ApplePayDirect/OrderTotalCollectorTest.php b/tests/Unit/Collector/ApplePayDirect/OrderTotalCollectorTest.php index 05e4b671d..a57535f7e 100644 --- a/tests/Unit/Collector/ApplePayDirect/OrderTotalCollectorTest.php +++ b/tests/Unit/Collector/ApplePayDirect/OrderTotalCollectorTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Unit\Collector\ApplePayDirect; diff --git a/tests/Unit/Factory/SubscriptionDataTest.php b/tests/Unit/Factory/SubscriptionDataTest.php index 88bec26bf..400edd280 100644 --- a/tests/Unit/Factory/SubscriptionDataTest.php +++ b/tests/Unit/Factory/SubscriptionDataTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ declare(strict_types=1); diff --git a/tests/Unit/Factory/index.php b/tests/Unit/Factory/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Unit/Factory/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Unit/Handler/Api/OrderEndpointPaymentTypeHandlerTest.php b/tests/Unit/Handler/Api/OrderEndpointPaymentTypeHandlerTest.php index 7c0236a2b..a91818884 100644 --- a/tests/Unit/Handler/Api/OrderEndpointPaymentTypeHandlerTest.php +++ b/tests/Unit/Handler/Api/OrderEndpointPaymentTypeHandlerTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Enum\PaymentTypeEnum; use Mollie\Handler\Api\OrderEndpointPaymentTypeHandler; diff --git a/tests/Unit/Handler/Order/OrderPaymentFeeHandlerTest.php b/tests/Unit/Handler/Order/OrderPaymentFeeHandlerTest.php index e33f33d5b..c0713ab86 100644 --- a/tests/Unit/Handler/Order/OrderPaymentFeeHandlerTest.php +++ b/tests/Unit/Handler/Order/OrderPaymentFeeHandlerTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Unit\Handler\Order; diff --git a/tests/Unit/Handler/Order/index.php b/tests/Unit/Handler/Order/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Unit/Handler/Order/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Unit/Handler/RetryHandlerTest.php b/tests/Unit/Handler/RetryHandlerTest.php index 22a16e428..418b13724 100644 --- a/tests/Unit/Handler/RetryHandlerTest.php +++ b/tests/Unit/Handler/RetryHandlerTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Exception\OrderCreationException; use Mollie\Exception\RetryOverException; diff --git a/tests/Unit/Handler/Shipment/ShipmentSenderHandlerTest.php b/tests/Unit/Handler/Shipment/ShipmentSenderHandlerTest.php index fce1377c5..2f0e9b660 100644 --- a/tests/Unit/Handler/Shipment/ShipmentSenderHandlerTest.php +++ b/tests/Unit/Handler/Shipment/ShipmentSenderHandlerTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Api\MollieApiClient; use Mollie\Exception\ShipmentCannotBeSentException; diff --git a/tests/Unit/Provider/PaymentFeeProviderTest.php b/tests/Unit/Provider/PaymentFeeProviderTest.php index b6eee7744..2b5cc85f6 100644 --- a/tests/Unit/Provider/PaymentFeeProviderTest.php +++ b/tests/Unit/Provider/PaymentFeeProviderTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Unit\Provider; diff --git a/tests/Unit/Provider/SubscriptionDescriptionTest.php b/tests/Unit/Provider/SubscriptionDescriptionTest.php index f2830d271..db68b5e5f 100644 --- a/tests/Unit/Provider/SubscriptionDescriptionTest.php +++ b/tests/Unit/Provider/SubscriptionDescriptionTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Tests\Unit\Provider; diff --git a/tests/Unit/Provider/SubscriptionIntervalTest.php b/tests/Unit/Provider/SubscriptionIntervalTest.php index eb819f3a4..e4f15b3bf 100644 --- a/tests/Unit/Provider/SubscriptionIntervalTest.php +++ b/tests/Unit/Provider/SubscriptionIntervalTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Subscription\Tests\Unit\Provider; diff --git a/tests/Unit/Provider/TaxCalculatorProviderTest.php b/tests/Unit/Provider/TaxCalculatorProviderTest.php index 9d0c941e4..c335917a7 100644 --- a/tests/Unit/Provider/TaxCalculatorProviderTest.php +++ b/tests/Unit/Provider/TaxCalculatorProviderTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Unit\Provider; diff --git a/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/AmountPaymentRestrictionValidationTest.php b/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/AmountPaymentRestrictionValidationTest.php index 4c3fac144..ae347e396 100644 --- a/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/AmountPaymentRestrictionValidationTest.php +++ b/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/AmountPaymentRestrictionValidationTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Config\Config; use Mollie\Service\PaymentMethod\PaymentMethodRestrictionValidation\AmountPaymentMethodRestrictionValidator; diff --git a/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/ApplePayPaymentRestrictionValidationTest.php b/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/ApplePayPaymentRestrictionValidationTest.php index 346b8dbd9..0aa2f0dac 100644 --- a/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/ApplePayPaymentRestrictionValidationTest.php +++ b/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/ApplePayPaymentRestrictionValidationTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Config\Config; use Mollie\Service\PaymentMethod\PaymentMethodRestrictionValidation\ApplePayPaymentMethodRestrictionValidator; diff --git a/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/VersionSpecificPaymentRestrictionValidationTest.php b/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/VersionSpecificPaymentRestrictionValidationTest.php index 4e0b74863..75921260f 100644 --- a/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/VersionSpecificPaymentRestrictionValidationTest.php +++ b/tests/Unit/Service/PaymentMethod/PaymentMethodRestrictionValidation/VersionSpecificPaymentRestrictionValidationTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Config\Config; use Mollie\Provider\EnvironmentVersionProvider; diff --git a/tests/Unit/Service/PaymentMethod/PaymentMethodSortProviderTest.php b/tests/Unit/Service/PaymentMethod/PaymentMethodSortProviderTest.php index 0a9f2551e..bf5fa27cb 100644 --- a/tests/Unit/Service/PaymentMethod/PaymentMethodSortProviderTest.php +++ b/tests/Unit/Service/PaymentMethod/PaymentMethodSortProviderTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Service\PaymentMethod\PaymentMethodSortProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Unit/Service/UpgradeNoticeServiceTest.php b/tests/Unit/Service/UpgradeNoticeServiceTest.php index 5e446232d..84102f94e 100644 --- a/tests/Unit/Service/UpgradeNoticeServiceTest.php +++ b/tests/Unit/Service/UpgradeNoticeServiceTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Service\UpgradeNoticeService; use PHPUnit\Framework\TestCase; diff --git a/tests/Unit/Service/index.php b/tests/Unit/Service/index.php index 2701cf51a..d3343995f 100644 --- a/tests/Unit/Service/index.php +++ b/tests/Unit/Service/index.php @@ -1,30 +1,14 @@ -* @copyright 2007-2016 PrestaShop SA -* @version Release: $Revision$ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - +/** + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); diff --git a/tests/Unit/Subscription/Presenter/OrderDetailPresenterTest.php b/tests/Unit/Subscription/Presenter/OrderDetailPresenterTest.php index 62663ba1a..e47429dba 100644 --- a/tests/Unit/Subscription/Presenter/OrderDetailPresenterTest.php +++ b/tests/Unit/Subscription/Presenter/OrderDetailPresenterTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ namespace Mollie\Tests\Unit\Subscription\Presenter; diff --git a/tests/Unit/Subscription/Presenter/index.php b/tests/Unit/Subscription/Presenter/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Unit/Subscription/Presenter/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Unit/Subscription/index.php b/tests/Unit/Subscription/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/tests/Unit/Subscription/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Unit/Utility/ApplePayDirect/ShippingMethodUtilityTest.php b/tests/Unit/Utility/ApplePayDirect/ShippingMethodUtilityTest.php index fca9fce2d..387e820a9 100644 --- a/tests/Unit/Utility/ApplePayDirect/ShippingMethodUtilityTest.php +++ b/tests/Unit/Utility/ApplePayDirect/ShippingMethodUtilityTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\DTO\ApplePay\Carrier\Carrier as AppleCarrier; use Mollie\Utility\ApplePayDirect\ShippingMethodUtility; diff --git a/tests/Unit/Utility/CalculationUtilityTest.php b/tests/Unit/Utility/CalculationUtilityTest.php index d293248ce..606a31fcd 100644 --- a/tests/Unit/Utility/CalculationUtilityTest.php +++ b/tests/Unit/Utility/CalculationUtilityTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Utility\CalculationUtility; use PHPUnit\Framework\TestCase; diff --git a/tests/Unit/Validator/OrderConfirmationMailValidatorTest.php b/tests/Unit/Validator/OrderConfirmationMailValidatorTest.php index 7372340ea..fb71a4528 100644 --- a/tests/Unit/Validator/OrderConfirmationMailValidatorTest.php +++ b/tests/Unit/Validator/OrderConfirmationMailValidatorTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Adapter\ConfigurationAdapter; use Mollie\Config\Config; diff --git a/tests/Unit/Verification/PaymentType/CanBeRegularPaymentTypeTest.php b/tests/Unit/Verification/PaymentType/CanBeRegularPaymentTypeTest.php index 7ff23d516..e0d495de4 100644 --- a/tests/Unit/Verification/PaymentType/CanBeRegularPaymentTypeTest.php +++ b/tests/Unit/Verification/PaymentType/CanBeRegularPaymentTypeTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use PHPUnit\Framework\TestCase; diff --git a/tests/Unit/Verification/Shipment/CanSendShipmentTest.php b/tests/Unit/Verification/Shipment/CanSendShipmentTest.php index f309de0d8..2175dde56 100644 --- a/tests/Unit/Verification/Shipment/CanSendShipmentTest.php +++ b/tests/Unit/Verification/Shipment/CanSendShipmentTest.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ use Mollie\Config\Config; use Mollie\Enum\PaymentTypeEnum; diff --git a/tests/Unit/bootstrap.php b/tests/Unit/bootstrap.php index 54dff446e..09c60d7ef 100644 --- a/tests/Unit/bootstrap.php +++ b/tests/Unit/bootstrap.php @@ -1,5 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ $projectDir = __DIR__ . '/../../'; require_once $projectDir . 'vendor/autoload.php'; diff --git a/tests/Unit/index.php b/tests/Unit/index.php index 2701cf51a..d3343995f 100644 --- a/tests/Unit/index.php +++ b/tests/Unit/index.php @@ -1,30 +1,14 @@ -* @copyright 2007-2016 PrestaShop SA -* @version Release: $Revision$ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - +/** + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 6db43cd14..6a9781fb1 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,5 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ $rootDirectory = __DIR__ . '/../../../'; $projectDir = __DIR__ . '/../'; diff --git a/tests/index.php b/tests/index.php index 2701cf51a..d3343995f 100644 --- a/tests/index.php +++ b/tests/index.php @@ -1,30 +1,14 @@ -* @copyright 2007-2016 PrestaShop SA -* @version Release: $Revision$ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - +/** + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); diff --git a/tests/phpstan/index.php b/tests/phpstan/index.php index 2701cf51a..d3343995f 100644 --- a/tests/phpstan/index.php +++ b/tests/phpstan/index.php @@ -1,30 +1,14 @@ -* @copyright 2007-2016 PrestaShop SA -* @version Release: $Revision$ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - +/** + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); diff --git a/tests/seed/settings/defines.inc.php b/tests/seed/settings/defines.inc.php new file mode 100644 index 000000000..5c3ffbaf8 --- /dev/null +++ b/tests/seed/settings/defines.inc.php @@ -0,0 +1,218 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ + +/* Debug only */ +if (!defined('_PS_MODE_DEV_')) { + define('_PS_MODE_DEV_', true); +} +/* Compatibility warning */ +define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true); +if (_PS_MODE_DEV_ === true) { + $errorReportingLevel = E_ALL | E_STRICT; + if (_PS_DISPLAY_COMPATIBILITY_WARNING_ === false) { + $errorReportingLevel = $errorReportingLevel & ~E_DEPRECATED & ~E_USER_DEPRECATED; + } + @ini_set('display_errors', 'on'); + @error_reporting($errorReportingLevel); + define('_PS_DEBUG_SQL_', true); +} else { + @ini_set('display_errors', 'off'); + define('_PS_DEBUG_SQL_', false); +} + +if (!defined('_PS_DEBUG_PROFILING_')) { + define('_PS_DEBUG_PROFILING_', false); +} +if (!defined('_PS_MODE_DEMO_')) { + define('_PS_MODE_DEMO_', false); +} + +$currentDir = dirname(__FILE__); + +if (!defined('_PS_HOST_MODE_') && (getenv('_PS_HOST_MODE_') || getenv('REDIRECT__PS_HOST_MODE_'))) { + define('_PS_HOST_MODE_', getenv('_PS_HOST_MODE_') ? getenv('_PS_HOST_MODE_') : getenv('REDIRECT__PS_HOST_MODE_')); +} + +if (!defined('_PS_ROOT_DIR_') && (getenv('_PS_ROOT_DIR_') || getenv('REDIRECT__PS_ROOT_DIR_'))) { + define('_PS_ROOT_DIR_', getenv('_PS_ROOT_DIR_') ? getenv('_PS_ROOT_DIR_') : getenv('REDIRECT__PS_ROOT_DIR_')); +} + +/* Directories */ +if (!defined('_PS_ROOT_DIR_')) { + define('_PS_ROOT_DIR_', realpath($currentDir . '/..')); +} + +if (!defined('_PS_CORE_DIR_')) { + define('_PS_CORE_DIR_', realpath($currentDir . '/..')); +} + +define('_PS_ALL_THEMES_DIR_', _PS_ROOT_DIR_ . '/themes/'); +/* BO THEMES */ +if (defined('_PS_ADMIN_DIR_')) { + define('_PS_BO_ALL_THEMES_DIR_', _PS_ADMIN_DIR_ . '/themes/'); +} + +// Find if we are running under a Symfony command +$cliEnvValue = null; +if (isset($argv) && is_array($argv)) { + if (in_array('--env', $argv)) { + $cliEnvValue = $argv[array_search('--env', $argv) + 1]; + } elseif (in_array('-e', $argv)) { + $cliEnvValue = $argv[array_search('-e', $argv) + 1]; + } +} + +if ((defined('_PS_IN_TEST_') && _PS_IN_TEST_) + || $cliEnvValue === 'test' +) { + define('_PS_ENV_', 'test'); +} else { + define('_PS_ENV_', _PS_MODE_DEV_ ? 'dev' : 'prod'); +} + +if (!defined('_PS_CACHE_DIR_')) { + define('_PS_CACHE_DIR_', _PS_ROOT_DIR_ . '/var/cache/' . _PS_ENV_ . DIRECTORY_SEPARATOR); +} + +define('_PS_CONFIG_DIR_', _PS_CORE_DIR_ . '/config/'); +define('_PS_CUSTOM_CONFIG_FILE_', _PS_CONFIG_DIR_ . 'settings_custom.inc.php'); +define('_PS_CLASS_DIR_', _PS_CORE_DIR_ . '/classes/'); +if (!defined('_PS_DOWNLOAD_DIR_')) { + $dir = (defined('_PS_IN_TEST_') && _PS_IN_TEST_) ? '/tests/Resources/download/' : '/download/'; + define('_PS_DOWNLOAD_DIR_', _PS_ROOT_DIR_ . $dir); +} +define('_PS_MAIL_DIR_', _PS_CORE_DIR_ . '/mails/'); +if (!defined('_PS_MODULE_DIR_')) { + define('_PS_MODULE_DIR_', _PS_ROOT_DIR_ . '/modules/'); +} +if (!defined('_PS_OVERRIDE_DIR_')) { + define('_PS_OVERRIDE_DIR_', _PS_ROOT_DIR_ . '/override/'); +} +define('_PS_PDF_DIR_', _PS_CORE_DIR_ . '/pdf/'); +define('_PS_TRANSLATIONS_DIR_', _PS_ROOT_DIR_ . '/translations/'); +if (!defined('_PS_UPLOAD_DIR_')) { + define('_PS_UPLOAD_DIR_', _PS_ROOT_DIR_ . '/upload/'); +} +define('_PS_CONTROLLER_DIR_', _PS_CORE_DIR_ . '/controllers/'); +define('_PS_ADMIN_CONTROLLER_DIR_', _PS_CORE_DIR_ . '/controllers/admin/'); +define('_PS_FRONT_CONTROLLER_DIR_', _PS_CORE_DIR_ . '/controllers/front/'); + +define('_PS_TOOL_DIR_', _PS_CORE_DIR_ . '/tools/'); +if (!defined('_PS_GEOIP_DIR_')) { + define('_PS_GEOIP_DIR_', _PS_CORE_DIR_ . '/app/Resources/geoip/'); +} +if (!defined('_PS_GEOIP_CITY_FILE_')) { + define('_PS_GEOIP_CITY_FILE_', 'GeoLite2-City.mmdb'); +} + +define('_PS_VENDOR_DIR_', _PS_CORE_DIR_ . '/vendor/'); +define('_PS_PEAR_XML_PARSER_PATH_', _PS_TOOL_DIR_ . 'pear_xml_parser/'); +define('_PS_SWIFT_DIR_', _PS_TOOL_DIR_ . 'swift/'); +define('_PS_TAASC_PATH_', _PS_TOOL_DIR_ . 'taasc/'); +define('_PS_TCPDF_PATH_', _PS_TOOL_DIR_ . 'tcpdf/'); + +define('_PS_IMG_SOURCE_DIR_', _PS_ROOT_DIR_ . '/img/'); +if (!defined('_PS_IMG_DIR_')) { + $dir = (defined('_PS_IN_TEST_') && _PS_IN_TEST_) ? '/tests/Resources/img/' : '/img/'; + define('_PS_IMG_DIR_', _PS_ROOT_DIR_ . $dir); +} + +if (!defined('_PS_HOST_MODE_')) { + define('_PS_CORE_IMG_DIR_', _PS_CORE_DIR_ . '/img/'); +} else { + define('_PS_CORE_IMG_DIR_', _PS_ROOT_DIR_ . '/img/'); +} + +define('_PS_CAT_IMG_DIR_', _PS_IMG_DIR_ . 'c/'); +define('_PS_COL_IMG_DIR_', _PS_IMG_DIR_ . 'co/'); +define('_PS_EMPLOYEE_IMG_DIR_', _PS_IMG_DIR_ . 'e/'); +define('_PS_GENDERS_DIR_', _PS_IMG_DIR_ . 'genders/'); +define('_PS_LANG_IMG_DIR_', _PS_IMG_DIR_ . 'l/'); +define('_PS_MANU_IMG_DIR_', _PS_IMG_DIR_ . 'm/'); +define('_PS_ORDER_STATE_IMG_DIR_', _PS_IMG_DIR_ . 'os/'); +define('_PS_PROD_IMG_DIR_', _PS_IMG_DIR_ . 'p/'); +define('_PS_PROFILE_IMG_DIR_', _PS_IMG_DIR_ . 'pr/'); +define('_PS_SHIP_IMG_DIR_', _PS_IMG_DIR_ . 's/'); +define('_PS_STORE_IMG_DIR_', _PS_IMG_DIR_ . 'st/'); +define('_PS_SUPP_IMG_DIR_', _PS_IMG_DIR_ . 'su/'); +define('_PS_TMP_IMG_DIR_', _PS_IMG_DIR_ . 'tmp/'); + +/* settings php */ +define('_PS_TRANS_PATTERN_', '(.*[^\\\\])'); +define('_PS_MIN_TIME_GENERATE_PASSWD_', '360'); + +if (!defined('_PS_MAGIC_QUOTES_GPC_')) { + define('_PS_MAGIC_QUOTES_GPC_', false); +} + +define('_CAN_LOAD_FILES_', 1); + +/* Order statuses +Order statuses have been moved into config.inc.php file for backward compatibility reasons */ + +/* Tax behavior */ +define('PS_PRODUCT_TAX', 0); +define('PS_STATE_TAX', 1); +define('PS_BOTH_TAX', 2); + +define('PS_TAX_EXC', 1); +define('PS_TAX_INC', 0); + +define('PS_ROUND_UP', 0); +define('PS_ROUND_DOWN', 1); +define('PS_ROUND_HALF_UP', 2); +define('PS_ROUND_HALF_DOWN', 3); +define('PS_ROUND_HALF_EVEN', 4); +define('PS_ROUND_HALF_ODD', 5); + +/* Backward compatibility */ +define('PS_ROUND_HALF', PS_ROUND_HALF_UP); + +/* Carrier::getCarriers() filter */ +// these defines are DEPRECATED since 1.4.5 version +define('PS_CARRIERS_ONLY', 1); +define('CARRIERS_MODULE', 2); +define('CARRIERS_MODULE_NEED_RANGE', 3); +define('PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE', 4); +define('ALL_CARRIERS', 5); + +/* SQL Replication management */ +define('_PS_USE_SQL_SLAVE_', 0); + +/* PS Technical configuration */ +define('_PS_ADMIN_PROFILE_', 1); + +/* Stock Movement */ +define('_STOCK_MOVEMENT_ORDER_REASON_', 3); +define('_STOCK_MOVEMENT_MISSING_REASON_', 4); + +define('_PS_CACHEFS_DIRECTORY_', _PS_ROOT_DIR_ . '/cache/cachefs/'); + +/* Geolocation */ +define('_PS_GEOLOCATION_NO_CATALOG_', 0); +define('_PS_GEOLOCATION_NO_ORDER_', 1); + +define('MIN_PASSWD_LENGTH', 8); + +define('_PS_SMARTY_NO_COMPILE_', 0); +define('_PS_SMARTY_CHECK_COMPILE_', 1); +define('_PS_SMARTY_FORCE_COMPILE_', 2); + +define('_PS_SMARTY_CONSOLE_CLOSE_', 0); +define('_PS_SMARTY_CONSOLE_OPEN_BY_URL_', 1); +define('_PS_SMARTY_CONSOLE_OPEN_', 2); + +if (!defined('_PS_JQUERY_VERSION_')) { + define('_PS_JQUERY_VERSION_', '3.4.1'); +} + +define('_PS_CACHE_CA_CERT_FILE_', _PS_CACHE_DIR_ . 'cacert.pem'); diff --git a/tests/seed/settings/parameters.php b/tests/seed/settings/parameters.php new file mode 100644 index 000000000..e69de29bb diff --git a/tests/seed/settings1785/defines.inc.php b/tests/seed/settings1785/defines.inc.php index 47f30550d..5c3ffbaf8 100644 --- a/tests/seed/settings1785/defines.inc.php +++ b/tests/seed/settings1785/defines.inc.php @@ -1,27 +1,13 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.md. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://devdocs.prestashop.com/ for more information. - * - * @author PrestaShop SA and Contributors - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */ /* Debug only */ diff --git a/tests/seed/settings1785/parameters.php b/tests/seed/settings1785/parameters.php index e84112375..e3f16837e 100755 --- a/tests/seed/settings1785/parameters.php +++ b/tests/seed/settings1785/parameters.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ return [ 'parameters' => [ diff --git a/tests/seed/settings8/defines.inc.php b/tests/seed/settings8/defines.inc.php new file mode 100755 index 000000000..e69de29bb diff --git a/tests/seed/settings8/parameters.php b/tests/seed/settings8/parameters.php new file mode 100755 index 000000000..e69de29bb diff --git a/translations/de.php b/translations/de.php index 6e9e72736..79c17faa5 100644 --- a/translations/de.php +++ b/translations/de.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ global $_MODULE; $_MODULE = array(); diff --git a/translations/en.php b/translations/en.php index 13969433b..fdd1f27cc 100644 --- a/translations/en.php +++ b/translations/en.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ global $_MODULE; $_MODULE = array(); diff --git a/translations/fr.php b/translations/fr.php index ce7a09238..d2b2ee481 100644 --- a/translations/fr.php +++ b/translations/fr.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ global $_MODULE; $_MODULE = array(); diff --git a/translations/nl.php b/translations/nl.php index 67d89a740..02bca6ee6 100644 --- a/translations/nl.php +++ b/translations/nl.php @@ -1,4 +1,14 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ global $_MODULE; $_MODULE = array(); diff --git a/upgrade/Upgrade-6.0.2.php b/upgrade/Upgrade-6.0.2.php index 0aa070247..2e9afb50c 100644 --- a/upgrade/Upgrade-6.0.2.php +++ b/upgrade/Upgrade-6.0.2.php @@ -1,5 +1,4 @@ + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + *#} {% set route_params = { (action.options.route_param_name) : (record[action.options.route_param_field]) } %} diff --git a/views/assets/compiled/index.php b/views/assets/compiled/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/views/assets/compiled/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/assets/compiled/subscription.bundle.js b/views/assets/compiled/subscription.bundle.js index 0d43fe7af..3e0887ed6 100644 --- a/views/assets/compiled/subscription.bundle.js +++ b/views/assets/compiled/subscription.bundle.js @@ -1,266 +1,112 @@ !function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="/",e(e.s="GP0s")}({GP0s:function(t,n,e){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,n){for(var e=0;e + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(i,"string"),"symbol"===r(a)?a:String(a)),o)}var i,a}e.r(n);var i=window.$,a=function(){function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=n,this.$container=i("#"+this.id+"_grid")}var n,e,r;return n=t,(e=[{key:"getId",value:function(){return this.id}},{key:"getContainer",value:function(){return this.$container}},{key:"getHeaderContainer",value:function(){return this.$container.closest(".js-grid-panel").find(".js-grid-header")}},{key:"addExtension",value:function(t){t.extend(this)}}])&&o(n.prototype,e),r&&o(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,n){for(var e=0;e + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(o,"string"),"symbol"===u(i)?i:String(i)),r)}var o,i}var l=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,r;return n=t,(e=[{key:"extend",value:function(t){t.getHeaderContainer().on("click",".js-common_refresh_list-grid-action",(function(){location.reload()}))}}])&&c(n.prototype,e),r&&c(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,n){for(var e=0;e + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(o,"string"),"symbol"===f(i)?i:String(i)),r)}var o,i}var y=window.$,b=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,r;return n=t,(e=[{key:"extend",value:function(t){var n=this;t.getHeaderContainer().on("click",".js-common_show_query-grid-action",(function(){return n._onShowSqlQueryClick(t)})),t.getHeaderContainer().on("click",".js-common_export_sql_manager-grid-action",(function(){return n._onExportSqlManagerClick(t)}))}},{key:"_onShowSqlQueryClick",value:function(t){var n=y("#"+t.getId()+"_common_show_query_modal_form");this._fillExportForm(n,t);var e=y("#"+t.getId()+"_grid_common_show_query_modal");e.modal("show"),e.on("click",".btn-sql-submit",(function(){return n.submit()}))}},{key:"_onExportSqlManagerClick",value:function(t){var n=y("#"+t.getId()+"_common_show_query_modal_form");this._fillExportForm(n,t),n.submit()}},{key:"_fillExportForm",value:function(t,n){var e=n.getContainer().find(".js-grid-table").data("query");t.find('textarea[name="sql"]').val(e),t.find('input[name="name"]').val(this._getNameFromBreadcrumb())}},{key:"_getNameFromBreadcrumb",value:function(){var t=y(".header-toolbar").find(".breadcrumb-item"),n="";return t.each((function(t,e){var r=y(e),o=0 ")),n=n.concat(o)})),n}}])&&s(n.prototype,e),r&&s(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),m=e("sjyX");function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,n){for(var e=0;e + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(o,"string"),"symbol"===d(i)?i:String(i)),r)}var o,i}var v=window.$,g=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,r;return n=t,(e=[{key:"extend",value:function(t){t.getContainer().on("click",".js-reset-search",(function(t){Object(m.a)(v(t.currentTarget).data("url"),v(t.currentTarget).data("redirect"))}))}}])&&p(n.prototype,e),r&&p(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),h=e("zNKw");function w(t){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function S(t,n){for(var e=0;e + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(o,"string"),"symbol"===w(i)?i:String(i)),r)}var o,i}var k=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,r;return n=t,(e=[{key:"extend",value:function(t){var n=t.getContainer().find("table.table");new h.a(n).attach()}}])&&S(n.prototype,e),r&&S(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(t,n){for(var e=0;e + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(o,"string"),"symbol"===j(i)?i:String(i)),r)}var o,i}var P=window.$,C=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,r;return n=t,(e=[{key:"extend",value:function(t){this.initRowLinks(t),this.initConfirmableActions(t)}},{key:"initConfirmableActions",value:function(t){t.getContainer().on("click",".js-link-row-action",(function(t){var n=P(t.currentTarget).data("confirm-message");n.length&&!confirm(n)&&t.preventDefault()}))}},{key:"initRowLinks",value:function(t){P("tr",t.getContainer()).each((function(){var t=P(this);P(".js-link-row-action[data-clickable-row=1]:first",t).each((function(){var n=P(this),e=n.closest("td");P("td.data-type, td.identifier-type:not(:has(input)), td.badge-type, td.position-type",t).not(e).addClass("cursor-pointer").click((function(){var t=n.data("confirm-message");t.length&&!confirm(t)||(document.location=n.attr("href"))}))}))}))}}])&&_(n.prototype,e),r&&_(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function x(t){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(t,n){for(var e=0;e + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(o,"string"),"symbol"===x(i)?i:String(i)),r)}var o,i}var T=window.$,O=function(){function t(){var n=this;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),{extend:function(t){return n.extend(t)}}}var n,e,r;return n=t,(e=[{key:"extend",value:function(t){var n=this;t.getContainer().on("click",".js-bulk-action-submit-btn",(function(e){n.submit(e,t)}))}},{key:"submit",value:function(t,n){var e=T(t.currentTarget),r=e.data("confirm-message");if(!(void 0!==r&&0 + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(o,"string"),"symbol"===B(i)?i:String(i)),r)}var o,i}var A=window.$,$=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,r;return n=t,(e=[{key:"extend",value:function(t){this._handleBulkActionCheckboxSelect(t),this._handleBulkActionSelectAllCheckbox(t)}},{key:"_handleBulkActionSelectAllCheckbox",value:function(t){var n=this;t.getContainer().on("change",".js-bulk-action-select-all",(function(e){var r=A(e.currentTarget).is(":checked");r?n._enableBulkActionsBtn(t):n._disableBulkActionsBtn(t),t.getContainer().find(".js-bulk-action-checkbox").prop("checked",r)}))}},{key:"_handleBulkActionCheckboxSelect",value:function(t){var n=this;t.getContainer().on("change",".js-bulk-action-checkbox",(function(){t.getContainer().find(".js-bulk-action-checkbox:checked").length>0?n._enableBulkActionsBtn(t):n._disableBulkActionsBtn(t)}))}},{key:"_enableBulkActionsBtn",value:function(t){t.getContainer().find(".js-bulk-actions-btn").prop("disabled",!1)}},{key:"_disableBulkActionsBtn",value:function(t){t.getContainer().find(".js-bulk-actions-btn").prop("disabled",!0)}}])&&N(n.prototype,e),r&&N(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function q(t){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function F(t,n){for(var e=0;e + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(o,"string"),"symbol"===q(i)?i:String(i)),r)}var o,i}var L=window.$,M=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,r;return n=t,(e=[{key:"extend",value:function(t){t.getContainer().on("click",".js-submit-row-action",(function(t){t.preventDefault();var n=L(t.currentTarget),e=n.data("confirm-message");if(!e.length||confirm(e)){var r=n.data("method"),o=["GET","POST"].includes(r),i=L("
",{action:n.data("url"),method:o?r:"POST"}).appendTo("body");o||i.append(L("",{type:"_hidden",name:"_method",value:r})),i.submit()}}))}}])&&F(n.prototype,e),r&&F(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();(0,window.$)((function(){var t=new a("invertus_mollie_subscription");t.addExtension(new l),t.addExtension(new b),t.addExtension(new g),t.addExtension(new k),t.addExtension(new C),t.addExtension(new O),t.addExtension(new $),t.addExtension(new M)}))},sjyX:function(t,n,e){"use strict";(function(t){ /** - * 2007-2019 PrestaShop and Contributors - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. + * Mollie https://www.mollie.nl * - * DISCLAIMER + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */ var e=t.$;n.a=function(t,n){e.post(t).then((function(){return window.location.assign(n)}))}}).call(this,e("yLpj"))},yLpj:function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},zNKw:function(t,n,e){"use strict";(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n){for(var r=0;r + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart */(i,"string"),"symbol"===e(a)?a:String(a)),o)}var i,a}var o=t.$,i=function(){function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.selector=".ps-sortable-column",this.columns=o(n).find(this.selector)}var n,e,i;return n=t,(e=[{key:"attach",value:function(){var t=this;this.columns.on("click",(function(n){var e=o(n.delegateTarget);t._sortByColumn(e,t._getToggledSortDirection(e))}))}},{key:"sortBy",value:function(t,n){var e=this.columns.is('[data-sort-col-name="'.concat(t,'"]'));if(!e)throw new Error('Cannot sort by "'.concat(t,'": invalid column'));this._sortByColumn(e,n)}},{key:"_sortByColumn",value:function(t,n){window.location=this._getUrl(t.data("sortColName"),"desc"===n?"desc":"asc",t.data("sortPrefix"))}},{key:"_getToggledSortDirection",value:function(t){return"asc"===t.data("sortDirection")?"desc":"asc"}},{key:"_getUrl",value:function(t,n,e){var r=new URL(window.location.href),o=r.searchParams;return e?(o.set(e+"[orderBy]",t),o.set(e+"[sortOrder]",n)):(o.set("orderBy",t),o.set("sortOrder",n)),r.toString()}}])&&r(n.prototype,e),i&&r(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();n.a=i}).call(this,e("yLpj"))}}); \ No newline at end of file diff --git a/views/assets/index.php b/views/assets/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/views/assets/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/assets/js/index.php b/views/assets/js/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/views/assets/js/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/assets/js/subscription.js b/views/assets/js/subscription.js index f1837fba0..b83b9c06b 100644 --- a/views/assets/js/subscription.js +++ b/views/assets/js/subscription.js @@ -1,3 +1,13 @@ +/** + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ import Grid from "../../../../../admin1/themes/new-theme/js/components/grid/grid"; import ReloadListActionExtension from "../../../../../admin1/themes/new-theme/js/components/grid/extension/reload-list-extension"; diff --git a/views/css/admin/menu.css b/views/css/admin/menu.css index 378572cc8..c95fc2835 100644 --- a/views/css/admin/menu.css +++ b/views/css/admin/menu.css @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/css/admin/order-list.css b/views/css/admin/order-list.css index d143d7ebe..e19ba6114 100644 --- a/views/css/admin/order-list.css +++ b/views/css/admin/order-list.css @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/css/front.css b/views/css/front.css index 28789577c..e3ec0f5cc 100644 --- a/views/css/front.css +++ b/views/css/front.css @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/css/front/bancontact_qr_code.css b/views/css/front/bancontact_qr_code.css index 5db67e8b4..cb3bb8e2a 100644 --- a/views/css/front/bancontact_qr_code.css +++ b/views/css/front/bancontact_qr_code.css @@ -1,3 +1,13 @@ +/** + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ #mollie-bancontact-qr-code { width: 180px; height: 180px; diff --git a/views/css/front/subscription/customer_order_detail.css b/views/css/front/subscription/customer_order_detail.css index dbcfc504e..e75197598 100644 --- a/views/css/front/subscription/customer_order_detail.css +++ b/views/css/front/subscription/customer_order_detail.css @@ -1,3 +1,13 @@ +/** + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ .box { box-shadow: 2px 2px 8px 0 rgb(0 0 0 / 20%); background: #fff; diff --git a/views/css/front/subscription/index.php b/views/css/front/subscription/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/views/css/front/subscription/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/js/admin/api_key_test.js b/views/js/admin/api_key_test.js index 7b7981c70..17ef85d0b 100644 --- a/views/js/admin/api_key_test.js +++ b/views/js/admin/api_key_test.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -18,6 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ + $(document).ready(function () { $('button.js-test-api-keys').on('click', testApiKeys); diff --git a/views/js/admin/commands/translation_commands.js b/views/js/admin/commands/translation_commands.js index e94d4f826..e3b396035 100644 --- a/views/js/admin/commands/translation_commands.js +++ b/views/js/admin/commands/translation_commands.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -18,6 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ + $('table.table tr td:nth-child(1)').each(function () { var $textField = $(this); var $input = $($textField.next().next()).find(':input'); diff --git a/views/js/admin/custom_logo.js b/views/js/admin/custom_logo.js index f9c5ac85d..48c4b8259 100644 --- a/views/js/admin/custom_logo.js +++ b/views/js/admin/custom_logo.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -18,6 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ + $(document).ready(function () { handleLogoImportButton(); toggleCustomLogo(); diff --git a/views/js/admin/init_mollie_account.js b/views/js/admin/init_mollie_account.js index ef5be982d..23bcac0d9 100644 --- a/views/js/admin/init_mollie_account.js +++ b/views/js/admin/init_mollie_account.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -18,6 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ + $(document).ready(function () { function initMollieAccount() { var source = $('input[name="MOLLIE_ACCOUNT_SWITCH"]'); diff --git a/views/js/admin/order_add.js b/views/js/admin/order_add.js index 8770269b3..d8089b7fc 100644 --- a/views/js/admin/order_add.js +++ b/views/js/admin/order_add.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -18,6 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ + $(document).ready(function () { var $paymentSelector = isPsVersion177 ? 'select[name="cart_summary[payment_module]"]' : 'select[name="payment_module_name"]'; var displayHiddenClass = 'd-none hidden'; diff --git a/views/js/admin/order_list.js b/views/js/admin/order_list.js index 74e64e053..20aafabdf 100644 --- a/views/js/admin/order_list.js +++ b/views/js/admin/order_list.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/js/admin/payment_methods.js b/views/js/admin/payment_methods.js index 9b028a118..272789cc7 100644 --- a/views/js/admin/payment_methods.js +++ b/views/js/admin/payment_methods.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/js/admin/settings.js b/views/js/admin/settings.js index 0bec51d69..14a244ea5 100644 --- a/views/js/admin/settings.js +++ b/views/js/admin/settings.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -18,6 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ + $(document).ready(function () { disableCharactersInAmountInput(); handleDisableForCustomUrl(); diff --git a/views/js/admin/upgrade_notice.js b/views/js/admin/upgrade_notice.js index ceed4d266..9d10981b0 100644 --- a/views/js/admin/upgrade_notice.js +++ b/views/js/admin/upgrade_notice.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/js/apple_payment.js b/views/js/apple_payment.js index 2d9f5d7db..1d7c4de66 100644 --- a/views/js/apple_payment.js +++ b/views/js/apple_payment.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -18,6 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ + $(document).ready(function() { document.cookie = 'isApplePayMethod = 0'; if (window.ApplePaySession && window.ApplePaySession.canMakePayments()) { diff --git a/views/js/front/applePayDirect/applePayDirectCart.js b/views/js/front/applePayDirect/applePayDirectCart.js index f6ac3aaaa..f29884a05 100644 --- a/views/js/front/applePayDirect/applePayDirectCart.js +++ b/views/js/front/applePayDirect/applePayDirectCart.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -19,7 +9,6 @@ * @codingStandardsIgnoreStart */ - $(document).ready(function () { var applePayMethodElement = document.querySelector( '#mollie-applepay-direct-button', diff --git a/views/js/front/applePayDirect/applePayDirectProduct.js b/views/js/front/applePayDirect/applePayDirectProduct.js index 3993127af..03a900799 100644 --- a/views/js/front/applePayDirect/applePayDirectProduct.js +++ b/views/js/front/applePayDirect/applePayDirectProduct.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/js/front/bancontact/qr_code.js b/views/js/front/bancontact/qr_code.js index e0d3de33c..e2f64af4e 100644 --- a/views/js/front/bancontact/qr_code.js +++ b/views/js/front/bancontact/qr_code.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/js/front/mollie_error_handle.js b/views/js/front/mollie_error_handle.js index e3c1a8d3a..a41d49548 100644 --- a/views/js/front/mollie_error_handle.js +++ b/views/js/front/mollie_error_handle.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -18,6 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ + $(document).ready(function () { var hasHashTag = document.URL.indexOf('#'); if (hasHashTag >= 0) { diff --git a/views/js/front/mollie_iframe.js b/views/js/front/mollie_iframe.js index 18a75a5e2..c3ca7f231 100644 --- a/views/js/front/mollie_iframe.js +++ b/views/js/front/mollie_iframe.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/js/front/mollie_single_click.js b/views/js/front/mollie_single_click.js index 9e09a6cbb..1528945b1 100644 --- a/views/js/front/mollie_single_click.js +++ b/views/js/front/mollie_single_click.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/js/front/payment_fee.js b/views/js/front/payment_fee.js index eac3d2c57..455011241 100644 --- a/views/js/front/payment_fee.js +++ b/views/js/front/payment_fee.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * @@ -18,6 +8,7 @@ * @see https://github.com/mollie/PrestaShop * @codingStandardsIgnoreStart */ + $(document).ready(function () { displayPaymentFee(); function displayPaymentFee() { diff --git a/views/js/front/subscription/index.php b/views/js/front/subscription/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/views/js/front/subscription/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/js/front/subscription/product.js b/views/js/front/subscription/product.js index 32af9f702..07977b18d 100644 --- a/views/js/front/subscription/product.js +++ b/views/js/front/subscription/product.js @@ -1,3 +1,13 @@ +/** + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ $(document).ready(function () { prestashop.on('handleError', function(parameters) { if (parameters.eventType !== 'addProductToCart' || isVersionGreaterOrEqualTo177) { diff --git a/views/js/method_countries.js b/views/js/method_countries.js index 5cab4fa4d..f1b29a490 100644 --- a/views/js/method_countries.js +++ b/views/js/method_countries.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/js/validation.js b/views/js/validation.js index dfe8e6156..498599648 100644 --- a/views/js/validation.js +++ b/views/js/validation.js @@ -1,13 +1,3 @@ -/** - * Mollie https://www.mollie.nl - * - * @author Mollie B.V. - * @copyright Mollie B.V. - * - * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md - * - * @see https://github.com/mollie/PrestaShop - */ /** * Mollie https://www.mollie.nl * diff --git a/views/templates/admin/Subscription/index.php b/views/templates/admin/Subscription/index.php new file mode 100644 index 000000000..d3343995f --- /dev/null +++ b/views/templates/admin/Subscription/index.php @@ -0,0 +1,20 @@ + + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/templates/admin/Subscription/subscriptions-faq.html.twig b/views/templates/admin/Subscription/subscriptions-faq.html.twig index 58d78f091..70629423b 100644 --- a/views/templates/admin/Subscription/subscriptions-faq.html.twig +++ b/views/templates/admin/Subscription/subscriptions-faq.html.twig @@ -1,26 +1,12 @@ {#** - * 2007-2019 PrestaShop and Contributors + * Mollie https://www.mollie.nl * - * NOTICE OF LICENSE + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart *#} {% extends '@PrestaShop/Admin/layout.html.twig' %} diff --git a/views/templates/admin/Subscription/subscriptions-grid.html.twig b/views/templates/admin/Subscription/subscriptions-grid.html.twig index ee791a18e..5f629ad07 100644 --- a/views/templates/admin/Subscription/subscriptions-grid.html.twig +++ b/views/templates/admin/Subscription/subscriptions-grid.html.twig @@ -1,26 +1,12 @@ -{# ** - * 2007-2019 PrestaShop and Contributors +{#** + * Mollie https://www.mollie.nl * - * NOTICE OF LICENSE + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart *#} {% extends '@PrestaShop/Admin/layout.html.twig' %} diff --git a/views/templates/admin/Subscription/subscriptions-settings.html.twig b/views/templates/admin/Subscription/subscriptions-settings.html.twig index 7591371ce..3b571e579 100644 --- a/views/templates/admin/Subscription/subscriptions-settings.html.twig +++ b/views/templates/admin/Subscription/subscriptions-settings.html.twig @@ -1,27 +1,13 @@ -{# ** - * 2007-2019 PrestaShop and Contributors +{#** + * Mollie https://www.mollie.nl * - * NOTICE OF LICENSE + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to https://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA - * #} + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + *#} {% set subscriptionOptions = subscriptionOptionsForm %} diff --git a/views/templates/admin/_configure/helpers/form/form.tpl b/views/templates/admin/_configure/helpers/form/form.tpl index bb74c2d85..8914d7d95 100644 --- a/views/templates/admin/_configure/helpers/form/form.tpl +++ b/views/templates/admin/_configure/helpers/form/form.tpl @@ -1,11 +1,13 @@ {** -* Mollie https://www.mollie.nl -* -* @author Mollie B.V. -* @copyright Mollie B.V. -* @link https://github.com/mollie/PrestaShop -* @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md -*} + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + *} {extends file="helpers/form/form.tpl"} {block name="input"} diff --git a/views/templates/admin/api_test_results.tpl b/views/templates/admin/api_test_results.tpl index 98e96b368..42d1a2fed 100644 --- a/views/templates/admin/api_test_results.tpl +++ b/views/templates/admin/api_test_results.tpl @@ -1,11 +1,13 @@ {** -* Mollie https://www.mollie.nl -* -* @author Mollie B.V. -* @copyright Mollie B.V. -* @link https://github.com/mollie/PrestaShop -* @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md -*} + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + *}
diff --git a/views/templates/admin/applePayDirectDocumentation.tpl b/views/templates/admin/applePayDirectDocumentation.tpl index c01391393..fcbdac577 100644 --- a/views/templates/admin/applePayDirectDocumentation.tpl +++ b/views/templates/admin/applePayDirectDocumentation.tpl @@ -1,9 +1,11 @@ {** -* Mollie https://www.mollie.nl -* -* @author Mollie B.V. -* @copyright Mollie B.V. -* @link https://github.com/mollie/PrestaShop -* @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md -*} + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + *} diff --git a/views/templates/admin/create_new_account_link.tpl b/views/templates/admin/create_new_account_link.tpl index 473835506..a1772045e 100644 --- a/views/templates/admin/create_new_account_link.tpl +++ b/views/templates/admin/create_new_account_link.tpl @@ -1,11 +1,13 @@ {** -* Mollie https://www.mollie.nl -* -* @author Mollie B.V. -* @copyright Mollie B.V. -* @link https://github.com/mollie/PrestaShop -* @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md -*} + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + *} {l s='Click here' mod='mollie'} diff --git a/views/templates/admin/email_checkbox.tpl b/views/templates/admin/email_checkbox.tpl index aaced8de4..f6dee1afb 100644 --- a/views/templates/admin/email_checkbox.tpl +++ b/views/templates/admin/email_checkbox.tpl @@ -1,11 +1,13 @@ {** -* Mollie https://www.mollie.nl -* -* @author Mollie B.V. -* @copyright Mollie B.V. -* @link https://github.com/mollie/PrestaShop -* @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md -*} + * Mollie https://www.mollie.nl + * + * @author Mollie B.V. + * @copyright Mollie B.V. + * @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md + * + * @see https://github.com/mollie/PrestaShop + * @codingStandardsIgnoreStart + *}