From c6d736ced5ec26a443523951135a153dd3c98df3 Mon Sep 17 00:00:00 2001 From: Can Demiralp Date: Tue, 27 Feb 2024 12:08:07 +0100 Subject: [PATCH 01/10] Initial version bump for V4 --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index da409c32..51ad47e6 100644 --- a/composer.json +++ b/composer.json @@ -6,13 +6,13 @@ } ], "description": "Official Shopware 6 Plugin to connect to Payment Service Provider Adyen", - "version": "3.14.4", + "version": "4.0.0", "type": "shopware-platform-plugin", "license": "MIT", "require": { - "shopware/core": "~6.4.0 || ~6.5.0", - "shopware/storefront": "~6.4.0 || ~6.5.0", - "adyen/php-api-library": "^15.0.0", + "shopware/core": "~6.6.0", + "shopware/storefront": "~6.6.0", + "adyen/php-api-library": "^17.0.0", "adyen/php-webhook-module": "0.8.0", "ext-json": "*" }, @@ -41,8 +41,8 @@ } }, "require-dev": { - "squizlabs/php_codesniffer": "^3.5", - "phpunit/phpunit": "^9" + "squizlabs/php_codesniffer": "^3.7", + "phpunit/phpunit": "^10.4" }, "config": { "allow-plugins": { From b5a148da7d6a73a799f4e5088732beac335e50fe Mon Sep 17 00:00:00 2001 From: Can Demiralp Date: Mon, 15 Apr 2024 15:08:19 +0200 Subject: [PATCH 02/10] Support Shopware 6.6 (#474) * [ECP-8935] Support Symfony 7 (#467) * Initial version bump for V4 * [ECP-8935] Update migration due to removed column * [ECP-8935] Fix return types of command controllers * [ECP-8935] Convert annotations into attributes for routing of the controllers * [ECP-8935] Add missing import for the class * [ECP-8935] Implement attributes for command name and definitions * [ECP-8935] Implement attributes for routes of the controllers * [ECP-8935] Handle payment response with correct order transaction * [ECP-8935] Convert annotations into attributes for controller routing * [ECP-8935] Add stateMachineState association to order transaction on donation data builder * [ECP-9047] Migrate to Vuejs 3 (#470) * Initial version bump for V4 * [ECP-8935] Update migration due to removed column * [ECP-8935] Fix return types of command controllers * [ECP-8935] Convert annotations into attributes for routing of the controllers * [ECP-8935] Add missing import for the class * [ECP-8935] Implement attributes for command name and definitions * [ECP-8935] Implement attributes for routes of the controllers * [ECP-8935] Handle payment response with correct order transaction * [ECP-8935] Convert annotations into attributes for controller routing * [ECP-8935] Add stateMachineState association to order transaction on donation data builder * [ECP-9047] Fix Test Configuration button * [ECP-9047] Remove installJsAssets() method * [ECP-9047] Remove JS dist files and update frontend assets * [ECP-9047] Fix v-model usage according to Vuejs 3 * [ECP-9047] Update frontend assets * Remove debugger --------- Co-authored-by: Can Demiralp * Use Symfony Command return constants * Update frontend assets * Bump PHP version * Ignore LineLength CS errors on route definitions * Fix CS issues * Fix CS issues * Bump E2E workflow Dockware version --------- Co-authored-by: Can Demiralp --- .github/workflows/e2e-test.yml | 2 +- .github/workflows/main.yml | 2 +- composer.json | 4 +- src/AdyenPaymentShopware6.php | 42 ---- src/Command/DisablePaymentMethodCommand.php | 22 +- src/Command/EnablePaymentMethodCommand.php | 22 +- .../FetchPaymentMethodLogosCommand.php | 12 +- src/Command/ProcessWebhooksCommand.php | 12 +- src/Controller/AdminController.php | 115 ++++------ .../StoreApi/Donate/DonateController.php | 31 ++- .../StoreApi/OrderApi/OrderApiController.php | 76 +++---- .../StoreApi/Payment/PaymentController.php | 130 ++++------- .../Command/DisablePaymentMethodHandler.php | 1 + src/Handlers/PaymentResponseHandler.php | 16 +- .../Migration1609373668AdyenMediaFolder.php | 5 +- .../adyen-config-check-button/index.js | 4 +- .../adyen-refund/adyen-refund.html.twig | 8 +- .../storefront/js/adyen-payment-shopware6.js | 1 - .../adyen-payment-shopware6.js | 1 + .../js/adyen-payment-shopware64.js.dist | 1 - .../js/adyen-payment-shopware65.js.dist | 1 - src/Resources/config/routes.xml | 6 +- src/Resources/config/services/controllers.xml | 2 - src/Resources/config/services/subscribers.xml | 1 + .../css/adyen-payment-shopware6.css | 5 +- .../js/adyen-payment-shopware6.js | 3 +- .../js/adyen-payment-shopware64.js.dist | 1 - .../js/adyen-payment-shopware65.js.dist | 1 - .../css/adyen-payment-shopware6.css.map | 1 + .../static/js/adyen-payment-shopware6.js.map | 1 + .../Repository/OrderTransactionRepository.php | 1 + .../Controller/FrontendProxyController.php | 208 ++++++++---------- .../NotificationReceiverController.php | 32 +-- src/Subscriber/PostPaymentSubscriber.php | 55 +++-- 34 files changed, 345 insertions(+), 480 deletions(-) delete mode 100644 src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6.js create mode 100644 src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6/adyen-payment-shopware6.js delete mode 100644 src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware64.js.dist delete mode 100644 src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware65.js.dist delete mode 100644 src/Resources/public/administration/js/adyen-payment-shopware64.js.dist delete mode 100644 src/Resources/public/administration/js/adyen-payment-shopware65.js.dist create mode 100644 src/Resources/public/static/css/adyen-payment-shopware6.css.map create mode 100644 src/Resources/public/static/js/adyen-payment-shopware6.js.map diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 51c3097d..06632912 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -25,7 +25,7 @@ jobs: docker pull dockware/dev:6.5.2.1 docker run --rm -p 443:443 --name shopware6 \ --mount type=bind,source="$(pwd)",target=/data/extensions/workdir \ - --env PHP_VERSION=8.2 -d dockware/dev:6.5.2.1 + --env PHP_VERSION=8.2 -d dockware/dev:latest sleep 30 docker logs shopware6 docker exec shopware6 bash -c "sudo mysql -u root -proot shopware -e \"UPDATE sales_channel_domain SET url='https://local.shopware.shop' WHERE url NOT LIKE 'default.%';\"" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa244284..cc1aa12a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: [ 7.4, 8.0, 8.1, 8.2 ] + php-version: [ 8.2, 8.3 ] steps: - name: Setup PHP diff --git a/composer.json b/composer.json index 51ad47e6..400f8a1d 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,8 @@ "require": { "shopware/core": "~6.6.0", "shopware/storefront": "~6.6.0", - "adyen/php-api-library": "^17.0.0", - "adyen/php-webhook-module": "0.8.0", + "adyen/php-api-library": "^17.4.0", + "adyen/php-webhook-module": "^1", "ext-json": "*" }, "extra": { diff --git a/src/AdyenPaymentShopware6.php b/src/AdyenPaymentShopware6.php index 0d0a2cdf..cfc87dec 100644 --- a/src/AdyenPaymentShopware6.php +++ b/src/AdyenPaymentShopware6.php @@ -29,7 +29,6 @@ use Adyen\Shopware\Entity\PaymentResponse\PaymentResponseEntityDefinition; use Adyen\Shopware\Entity\PaymentStateData\PaymentStateDataEntityDefinition; use Adyen\Shopware\Handlers\GenericGiftCardPaymentMethodHandler; -use Adyen\Shopware\PaymentMethods; use Adyen\Shopware\Service\ConfigurationService; use Shopware\Core\Checkout\Payment\PaymentMethodEntity; use Shopware\Core\Framework\Plugin; @@ -46,50 +45,11 @@ use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; use Doctrine\DBAL\Connection; use Shopware\Core\System\SalesChannel\SalesChannelEntity; -use Symfony\Component\DependencyInjection\ContainerBuilder; class AdyenPaymentShopware6 extends Plugin { - public function installJsAssets($shopwareVersion) - { - $storefrontAssetPath = __DIR__ . '/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6.js'; - $adminAssetPath = __DIR__ . '/Resources/public/administration/js/adyen-payment-shopware6.js'; - if (\version_compare($shopwareVersion, '6.5.0.0', '<')) { - $resultStorefront = $this->safeCopyAsset( - __DIR__ . '/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware64.js.dist', - $storefrontAssetPath - ); - $resultAdmin = $this->safeCopyAsset( - __DIR__ . '/Resources/public/administration/js/adyen-payment-shopware64.js.dist', - $adminAssetPath - ); - } else { - $resultStorefront = $this->safeCopyAsset( - __DIR__ . '/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware65.js.dist', - $storefrontAssetPath - ); - $resultAdmin = $this->safeCopyAsset( - __DIR__ . '/Resources/public/administration/js/adyen-payment-shopware64.js.dist', - $adminAssetPath - ); - } - - if (!$resultStorefront) { - // @todo: add notice: - // Unable to install your storefront javascript assets, please run the command `bin/build-storefront.sh` - // from your Shopware web directory - } - - if (!$resultAdmin) { - // @todo: add notice: - // Unable to install your admin javascript assets, please run the command `bin/build-administration.sh` - // from your Shopware web directory - } - } - public function install(InstallContext $installContext): void { - $this->installJsAssets($installContext->getCurrentShopwareVersion()); foreach (PaymentMethods\PaymentMethods::PAYMENT_METHODS as $paymentMethod) { $this->addPaymentMethod(new $paymentMethod(), $installContext->getContext()); } @@ -97,7 +57,6 @@ public function install(InstallContext $installContext): void public function activate(ActivateContext $activateContext): void { - $this->installJsAssets($activateContext->getCurrentShopwareVersion()); foreach (PaymentMethods\PaymentMethods::PAYMENT_METHODS as $paymentMethod) { $this->setPaymentMethodIsActive(true, $activateContext->getContext(), new $paymentMethod()); } @@ -131,7 +90,6 @@ public function uninstall(UninstallContext $uninstallContext): void public function update(UpdateContext $updateContext): void { - $this->installJsAssets($updateContext->getCurrentShopwareVersion()); $currentVersion = $updateContext->getCurrentPluginVersion(); if (\version_compare($currentVersion, '1.2.0', '<')) { diff --git a/src/Command/DisablePaymentMethodCommand.php b/src/Command/DisablePaymentMethodCommand.php index 2bc3a674..6256512f 100644 --- a/src/Command/DisablePaymentMethodCommand.php +++ b/src/Command/DisablePaymentMethodCommand.php @@ -25,19 +25,20 @@ namespace Adyen\Shopware\Command; use Adyen\Shopware\Handlers\Command\DisablePaymentMethodHandler; +use Exception; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'adyen:payment-method:disable', description: 'Disables Adyen payment methods')] class DisablePaymentMethodCommand extends Command { - protected static $defaultName = 'adyen:payment-method:disable'; - /** * @var DisablePaymentMethodHandler */ - protected $handler; + protected DisablePaymentMethodHandler $handler; public function __construct(DisablePaymentMethodHandler $handler) { @@ -45,7 +46,7 @@ public function __construct(DisablePaymentMethodHandler $handler) $this->handler = $handler; } - protected function configure() + protected function configure(): void { $this->setDescription('Finds the payment method according to given PM handler and disables it'); @@ -64,7 +65,7 @@ protected function configure() ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { try { $isAllSelected = $input->getOption('all'); @@ -73,14 +74,15 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($isAllSelected xor isset($paymentMethodHandlerIdentifier)) { $this->handler->run($isAllSelected, $paymentMethodHandlerIdentifier); $message = 'Payment method is disabled successfully.'; + $output->writeln($message); } else { - throw new \Exception('Invalid parameter! For usage please check manual --help.'); + throw new Exception('Invalid parameter! For usage please check manual --help.'); } - } catch (\Exception $e) { - $message = $e->getMessage(); + } catch (Exception $e) { + $output->writeln($e->getMessage()); + return Command::FAILURE; } - $output->writeln($message); - return 0; + return Command::SUCCESS; } } diff --git a/src/Command/EnablePaymentMethodCommand.php b/src/Command/EnablePaymentMethodCommand.php index 9b8199d8..81dc9e88 100644 --- a/src/Command/EnablePaymentMethodCommand.php +++ b/src/Command/EnablePaymentMethodCommand.php @@ -25,19 +25,20 @@ namespace Adyen\Shopware\Command; use Adyen\Shopware\Handlers\Command\EnablePaymentMethodHandler; +use Exception; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'adyen:payment-method:enable', description: 'Enables Adyen payment methods')] class EnablePaymentMethodCommand extends Command { - protected static $defaultName = 'adyen:payment-method:enable'; - /** * @var EnablePaymentMethodHandler */ - protected $handler; + protected EnablePaymentMethodHandler $handler; public function __construct(EnablePaymentMethodHandler $handler) { @@ -45,7 +46,7 @@ public function __construct(EnablePaymentMethodHandler $handler) $this->handler = $handler; } - protected function configure() + protected function configure(): void { $this->setDescription('Finds the payment method according to given PM handler and enables it'); @@ -64,7 +65,7 @@ protected function configure() ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { try { $isAllSelected = $input->getOption('all'); @@ -73,14 +74,15 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($isAllSelected xor isset($paymentMethodHandlerIdentifier)) { $this->handler->run($isAllSelected, $paymentMethodHandlerIdentifier); $message = 'Payment method is enabled successfully.'; + $output->writeln($message); } else { - throw new \Exception('Invalid parameter! For usage please check manual --help.'); + throw new Exception('Invalid parameter! For usage please check manual --help.'); } - } catch (\Exception $e) { - $message = $e->getMessage(); + } catch (Exception $e) { + $output->writeln($e->getMessage()); + return Command::FAILURE; } - $output->writeln($message); - return 0; + return Command::SUCCESS; } } diff --git a/src/Command/FetchPaymentMethodLogosCommand.php b/src/Command/FetchPaymentMethodLogosCommand.php index c76452c3..4bf31fa5 100644 --- a/src/Command/FetchPaymentMethodLogosCommand.php +++ b/src/Command/FetchPaymentMethodLogosCommand.php @@ -25,18 +25,18 @@ namespace Adyen\Shopware\Command; use Adyen\Shopware\ScheduledTask\FetchPaymentMethodLogosHandler; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'adyen:fetch-logos', description: 'Fetches Adyen payment method logos')] class FetchPaymentMethodLogosCommand extends Command { - protected static $defaultName = 'adyen:fetch-logos'; - /** * @var FetchPaymentMethodLogosHandler */ - protected $handler; + protected FetchPaymentMethodLogosHandler $handler; public function __construct(FetchPaymentMethodLogosHandler $handler) { @@ -44,15 +44,15 @@ public function __construct(FetchPaymentMethodLogosHandler $handler) $this->handler = $handler; } - protected function configure() + protected function configure(): void { $this->setDescription('Fetch and update logos for Adyen payment methods.'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->handler->run(); $output->writeln('All available logos have been updated.'); - return 0; + return Command::SUCCESS; } } diff --git a/src/Command/ProcessWebhooksCommand.php b/src/Command/ProcessWebhooksCommand.php index 67ce9e8b..e51c419f 100644 --- a/src/Command/ProcessWebhooksCommand.php +++ b/src/Command/ProcessWebhooksCommand.php @@ -25,18 +25,18 @@ namespace Adyen\Shopware\Command; use Adyen\Shopware\ScheduledTask\ProcessNotificationsHandler; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'adyen:process-webhooks', description: 'Processes scheduled webhooks')] class ProcessWebhooksCommand extends Command { - protected static $defaultName = 'adyen:process-webhooks'; - /** * @var ProcessNotificationsHandler */ - protected $handler; + protected ProcessNotificationsHandler $handler; public function __construct(ProcessNotificationsHandler $handler) { @@ -44,15 +44,15 @@ public function __construct(ProcessNotificationsHandler $handler) $this->handler = $handler; } - protected function configure() + protected function configure(): void { $this->setDescription('Process webhook notifications.'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->handler->run(); $output->writeln('Webhook notifications have been processed.'); - return 0; + return Command::SUCCESS; } } diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index d2809a87..f52d44f1 100644 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -50,52 +50,48 @@ use Shopware\Core\System\Currency\CurrencyFormatter; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; -/** - * Class AdminController - * @package Adyen\Shopware\Controller - * @Route(defaults={"_routeScope"={"administration"}}) - */ +#[Route(defaults: ['_routeScope' => ['administration']])] class AdminController { const ADMIN_DATETIME_FORMAT = 'Y-m-d H:i (e)'; /** @var LoggerInterface */ - private $logger; + private LoggerInterface $logger; /** @var OrderRepository */ - private $orderRepository; + private OrderRepository $orderRepository; /** @var RefundService */ - private $refundService; + private RefundService $refundService; /** @var AdyenRefundRepository */ - private $adyenRefundRepository; + private AdyenRefundRepository $adyenRefundRepository; /** @var NotificationService */ - private $notificationService; + private NotificationService $notificationService; /** @var CurrencyFormatter */ - private $currencyFormatter; + private CurrencyFormatter $currencyFormatter; /** @var Currency */ - private $currencyUtil; + private Currency $currencyUtil; /** @var CaptureService */ - private $captureService; + private CaptureService $captureService; /** @var AdyenPaymentCaptureRepository */ - private $adyenPaymentCaptureRepository; + private AdyenPaymentCaptureRepository $adyenPaymentCaptureRepository; /** @var ConfigurationService */ - private $configurationService; + private ConfigurationService $configurationService; /** @var AdyenPaymentService */ - private $adyenPaymentService; + private AdyenPaymentService $adyenPaymentService; /** @var OrderTransactionRepository */ - private $orderTransactionRepository; + private OrderTransactionRepository $orderTransactionRepository; /** * AdminController constructor. @@ -142,16 +138,17 @@ public function __construct( } /** - * @Route(path="/api/_action/adyen/verify") - * * @param RequestDataBag $dataBag * @return JsonResponse */ + #[Route('/api/_action/adyen/verify', name: 'api.action.adyen.verify', methods: ['POST', 'GET'])] public function check(RequestDataBag $dataBag): JsonResponse { try { $client = new Client(); - $environment = $dataBag->get(ConfigurationService::BUNDLE_NAME . '.config.environment') ? 'live' : 'test'; + $environment = $dataBag->get(ConfigurationService::BUNDLE_NAME . '.config.environment') ? + 'live' : + 'test'; $client->setXApiKey( $dataBag->get(ConfigurationService::BUNDLE_NAME . '.config.apiKey' . ucfirst($environment)) ); @@ -180,16 +177,11 @@ public function check(RequestDataBag $dataBag): JsonResponse /** * Send a capture request to the Adyen platform * - * @Route( - * "/api/adyen/capture", - * name="api.adyen_payment_capture.post", - * methods={"POST"} - * ) - * * @param Request $request * @return JsonResponse */ - public function sendCaptureRequest(Request $request) + #[Route('/api/adyen/capture', name: 'api.adyen_payment_capture.post', methods: ['POST'])] + public function sendCaptureRequest(Request $request): JsonResponse { $context = Context::createDefaultContext(); $orderId = $request->request->get('orderId'); @@ -237,15 +229,11 @@ public function sendCaptureRequest(Request $request) /** * Get payment capture requests by order * - * @Route( - * "/api/adyen/orders/{orderId}/captures", - * name="api.adyen_payment_capture.get", - * methods={"GET"} - * ) * @param string $orderId * @return JsonResponse */ - public function getCaptureRequests(string $orderId) + #[Route('/api/adyen/orders/{orderId}/captures', name: 'api.adyen_payment_capture.get', methods: ['GET'])] + public function getCaptureRequests(string $orderId): JsonResponse { $captureRequests = $this->adyenPaymentCaptureRepository->getCaptureRequestsByOrderId($orderId); @@ -255,15 +243,15 @@ public function getCaptureRequests(string $orderId) /** * Get payment capture requests by order * - * @Route( - * "/api/adyen/orders/{orderId}/is-capture-allowed", - * name="api.adyen_payment_capture_allowed.get", - * methods={"GET"} - * ) * @param string $orderId * @return JsonResponse */ - public function isCaptureAllowed(string $orderId) + #[Route( + '/api/adyen/orders/{orderId}/is-capture-allowed', + name: 'api.adyen_payment_capture_allowed.get', + methods: ['GET'] + )] + public function isCaptureAllowed(string $orderId): JsonResponse { $orderTransaction = $this->orderTransactionRepository->getFirstAdyenOrderTransactionByStates( $orderId, @@ -290,15 +278,15 @@ public function isCaptureAllowed(string $orderId) } /** - * @Route( - * "/api/adyen/orders/{orderId}/is-manual-capture-enabled", - * name="api.adyen_payment_capture_enabled.get", - * methods={"GET"} - * ) * @param string $orderId * @return JsonResponse */ - public function isManualCaptureEnabled(string $orderId) + #[Route( + '/api/adyen/orders/{orderId}/is-manual-capture-enabled', + name: 'api.adyen_payment_capture_enabled.get', + methods: ['GET'] + )] + public function isManualCaptureEnabled(string $orderId): JsonResponse { try { $orderTransaction = $this->orderTransactionRepository->getFirstAdyenOrderTransaction($orderId); @@ -315,15 +303,10 @@ public function isManualCaptureEnabled(string $orderId) /** * Send a refund operation to the Adyen platform * - * @Route( - * "/api/adyen/refunds", - * name="api.adyen_refund.post", - * methods={"POST"} - * ) - * * @param Request $request * @return JsonResponse */ + #[Route('/api/adyen/refunds', name: 'api.adyen_refund.post', methods: ['POST'])] public function postRefund(Request $request): JsonResponse { $context = Context::createDefaultContext(); @@ -398,15 +381,10 @@ public function postRefund(Request $request): JsonResponse } /** - * @Route( - * "/api/adyen/orders/{orderId}/refunds", - * name="api.adyen_refund.get", - * methods={"GET"} - * ) - * * @param string $orderId * @return JsonResponse */ + #[Route('/api/adyen/orders/{orderId}/refunds', name: 'api.adyen_refund.get', methods: ['GET'])] public function getRefunds(string $orderId): JsonResponse { $refunds = $this->adyenRefundRepository->getRefundsByOrderId($orderId); @@ -417,13 +395,10 @@ public function getRefunds(string $orderId): JsonResponse /** * Get all the notifications for an order. * - * @Route( - * "/api/adyen/orders/{orderId}/notifications", - * methods={"GET"} - * ) * @param string $orderId * @return JsonResponse */ + #[Route('/api/adyen/orders/{orderId}/notifications', name: 'api.adyen_notifications.get', methods: ['GET'])] public function getOrderNotifications(string $orderId): JsonResponse { $order = $this->orderRepository->getOrder($orderId, Context::createDefaultContext()); @@ -457,13 +432,10 @@ public function getOrderNotifications(string $orderId): JsonResponse /** * Get all the authorised payments of an order from adyen_payment table. * - * @Route( - * "/api/adyen/orders/{orderId}/partial-payments", - * methods={"GET"} - * ) * @param string $orderId * @return JsonResponse */ + #[Route('/api/adyen/orders/{orderId}/partial-payments', name: 'api.adyen_partial_payments.get', methods: ['GET'])] public function getPartialPayments(string $orderId): JsonResponse { $order = $this->orderRepository->getOrder($orderId, Context::createDefaultContext()); @@ -521,15 +493,14 @@ private function buildResponseData(array $entities) } /** - * @Route( - * "/api/adyen/reschedule-notification/{notificationId}", - * name="admin.action.adyen.reschedule-notification", - * methods={"GET"} - * ) - * * @param string $notificationId * @return JsonResponse */ + #[Route( + '/api/adyen/reschedule-notification/{notificationId}', + name: 'admin.action.adyen.reschedule-notification', + methods: ['GET'] + )] public function rescheduleNotification(string $notificationId): JsonResponse { $notification = $this->notificationService->getNotificationById($notificationId); diff --git a/src/Controller/StoreApi/Donate/DonateController.php b/src/Controller/StoreApi/Donate/DonateController.php index 028d26ca..922ca7f9 100644 --- a/src/Controller/StoreApi/Donate/DonateController.php +++ b/src/Controller/StoreApi/Donate/DonateController.php @@ -38,41 +38,40 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStates; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; -/** - * Class DonateController - * @package Adyen\Shopware\Controller\StoreApi\Donate - * @Route(defaults={"_routeScope"={"store-api"}}) - */ +#[Route(defaults: ['_routeScope' => ['store-api']])] class DonateController { /** * @var OrderTransactionRepository */ - private $adyenOrderTransactionRepository; + private OrderTransactionRepository $adyenOrderTransactionRepository; + /** * @var EntityRepository */ - private $orderTransactionRepository; + private EntityRepository $orderTransactionRepository; + /** * @var DonationService */ - private $donationService; + private DonationService $donationService; /** * @var ConfigurationService */ - private $configurationService; + private ConfigurationService $configurationService; /** * @var Currency */ - private $currency; + private Currency $currency; + /** * @var LoggerInterface */ - private $logger; + private LoggerInterface $logger; /** * StoreApiController constructor. @@ -81,6 +80,7 @@ class DonateController * @param OrderTransactionRepository $adyenOrderTransactionRepository * @param EntityRepository $orderTransactionRepository * @param ConfigurationService $configurationService + * @param Currency $currency * @param LoggerInterface $logger */ public function __construct( @@ -100,16 +100,11 @@ public function __construct( } /** - * @Route( - * "/store-api/adyen/donate", - * name="store-api.action.adyen.donate", - * methods={"POST"} - * ) - * * @param Request $request * @param SalesChannelContext $salesChannelContext * @return JsonResponse */ + #[Route('/store-api/adyen/donate', name: 'store-api.action.adyen.donate', methods: ['POST'])] public function donate( Request $request, SalesChannelContext $salesChannelContext diff --git a/src/Controller/StoreApi/OrderApi/OrderApiController.php b/src/Controller/StoreApi/OrderApi/OrderApiController.php index 3f4da9e7..41bd1eb4 100644 --- a/src/Controller/StoreApi/OrderApi/OrderApiController.php +++ b/src/Controller/StoreApi/OrderApi/OrderApiController.php @@ -24,6 +24,7 @@ namespace Adyen\Shopware\Controller\StoreApi\OrderApi; +use Adyen\AdyenException; use Adyen\Shopware\Exception\ValidationException; use Adyen\Shopware\Service\PaymentMethodsBalanceService; use Adyen\Shopware\Service\OrdersService; @@ -33,36 +34,30 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Shopware\Core\Framework\Uuid\Uuid; -use Psr\Log\LoggerInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; -/** - * Class OrderApiController - * @package Adyen\Shopware\Controller\StoreApi\OrderApi - * @Route(defaults={"_routeScope"={"store-api"}}) - */ +#[Route(defaults: ['_routeScope' => ['store-api']])] class OrderApiController { /** * @var PaymentMethodsBalanceService */ - private $paymentMethodsBalanceService; + private PaymentMethodsBalanceService $paymentMethodsBalanceService; + /** * @var OrdersService */ - private $ordersService; + private OrdersService $ordersService; + /** - * @var OrdersService + * @var OrdersService|OrdersCancelService */ - private $ordersCancelService; + private OrdersCancelService|OrdersService $ordersCancelService; + /** * @var PaymentStateDataService */ - private $paymentStateDataService; - /** - * @var LoggerInterface - */ - private $logger; + private PaymentStateDataService $paymentStateDataService; /** * StoreApiController constructor. @@ -71,33 +66,29 @@ class OrderApiController * @param OrdersService $ordersService * @param OrdersCancelService $ordersCancelService * @param PaymentStateDataService $paymentStateDataService - * @param LoggerInterface $logger */ public function __construct( PaymentMethodsBalanceService $paymentMethodsBalanceService, OrdersService $ordersService, OrdersCancelService $ordersCancelService, - PaymentStateDataService $paymentStateDataService, - LoggerInterface $logger + PaymentStateDataService $paymentStateDataService ) { $this->paymentMethodsBalanceService = $paymentMethodsBalanceService; $this->ordersService = $ordersService; $this->ordersCancelService = $ordersCancelService; $this->paymentStateDataService = $paymentStateDataService; - $this->logger = $logger; } /** - * @Route( - * "/store-api/adyen/payment-methods/balance", - * name="store-api.action.adyen.payment-methods.balance", - * methods={"POST"} - * ) - * * @param SalesChannelContext $context * @param Request $request * @return JsonResponse */ + #[Route( + '/store-api/adyen/payment-methods/balance', + name: 'store-api.action.adyen.payment-methods.balance', + methods: ['POST'] + )] public function getPaymentMethodsBalance(SalesChannelContext $context, Request $request): JsonResponse { $paymentMethod = json_decode($request->request->get('paymentMethod', ''), true); @@ -108,15 +99,11 @@ public function getPaymentMethodsBalance(SalesChannelContext $context, Request $ } /** - * @Route( - * "/store-api/adyen/orders", - * name="store-api.action.adyen.orders", - * methods={"POST"} - * ) - * * @param SalesChannelContext $context + * @param Request $request * @return JsonResponse */ + #[Route('/store-api/adyen/orders', name: 'store-api.action.adyen.orders', methods: ['POST'])] public function createOrder(SalesChannelContext $context, Request $request): JsonResponse { $uuid = Uuid::randomHex(); @@ -127,15 +114,11 @@ public function createOrder(SalesChannelContext $context, Request $request): Jso } /** - * @Route( - * "/store-api/adyen/orders/cancel", - * name="store-api.action.adyen.orders.cancel", - * methods={"POST"} - * ) - * * @param SalesChannelContext $context + * @param Request $request * @return JsonResponse */ + #[Route('/store-api/adyen/orders/cancel', name: 'store-api.action.adyen.orders.cancel', methods: ['POST'])] public function cancelOrder(SalesChannelContext $context, Request $request): JsonResponse { $orderData = $request->request->get('orderData'); @@ -145,17 +128,13 @@ public function cancelOrder(SalesChannelContext $context, Request $request): Jso } /** - * @Route( - * "/store-api/adyen/giftcard", - * name="store-api.action.adyen.giftcard", - * methods={"POST"} - * ) * @param SalesChannelContext $context * @param Request $request * @return JsonResponse * @throws ValidationException - * @throws \Adyen\AdyenException + * @throws AdyenException */ + #[Route('/store-api/adyen/giftcard', name: 'store-api.action.adyen.giftcard', methods: ['POST'])] public function giftcardStateData(SalesChannelContext $context, Request $request): JsonResponse { // store giftcard state data for context @@ -177,16 +156,11 @@ public function giftcardStateData(SalesChannelContext $context, Request $request } /** - * @Route( - * "/store-api/adyen/giftcard/remove", - * name="store-api.action.adyen.giftcard.remove", - * methods={"POST"} - * ) * @param SalesChannelContext $context - * @param Request $request * @return JsonResponse */ - public function deleteGiftCardStateData(SalesChannelContext $context, Request $request): JsonResponse + #[Route('/store-api/adyen/giftcard/remove', name: 'store-api.action.adyen.giftcard.remove', methods: ['POST'])] + public function deleteGiftCardStateData(SalesChannelContext $context): JsonResponse { $this->paymentStateDataService->deletePaymentStateDataFromContextToken($context->getToken()); diff --git a/src/Controller/StoreApi/Payment/PaymentController.php b/src/Controller/StoreApi/Payment/PaymentController.php index 8cd85b91..2f361ac8 100644 --- a/src/Controller/StoreApi/Payment/PaymentController.php +++ b/src/Controller/StoreApi/Payment/PaymentController.php @@ -24,6 +24,7 @@ namespace Adyen\Shopware\Controller\StoreApi\Payment; +use Adyen\Exception\MissingDataException; use Adyen\Service\Validator\CheckoutStateDataValidator; use Adyen\Shopware\Exception\PaymentFailedException; use Adyen\Shopware\Handlers\PaymentResponseHandler; @@ -33,6 +34,7 @@ use Adyen\Shopware\Service\PaymentResponseService; use Adyen\Shopware\Service\PaymentStatusService; use Adyen\Shopware\Service\Repository\OrderRepository; +use JsonException; use Psr\Log\LoggerInterface; use Shopware\Core\Checkout\Cart\Price\Struct\CalculatedPrice; use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionDefinition; @@ -50,72 +52,75 @@ use Shopware\Core\System\StateMachine\Transition; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Annotation\Route; -use OpenApi\Annotations as OA; +use Symfony\Component\Routing\Attribute\Route; -/** - * Class PaymentController - * @package Adyen\Shopware\Controller\StoreApi\Payment - * @Route(defaults={"_routeScope"={"store-api"}}) - */ +#[Route(defaults: ['_routeScope' => ['store-api']])] class PaymentController { /** * @var PaymentMethodsService */ - private $paymentMethodsService; + private PaymentMethodsService $paymentMethodsService; + /** * @var PaymentDetailsService */ - private $paymentDetailsService; + private PaymentDetailsService $paymentDetailsService; + /** * @var CheckoutStateDataValidator */ - private $checkoutStateDataValidator; + private CheckoutStateDataValidator $checkoutStateDataValidator; + /** * @var PaymentStatusService */ - private $paymentStatusService; + private PaymentStatusService $paymentStatusService; + /** * @var PaymentResponseHandler */ - private $paymentResponseHandler; + private PaymentResponseHandler $paymentResponseHandler; + /** * @var PaymentResponseService */ - private $paymentResponseService; + private PaymentResponseService $paymentResponseService; + /** * @var OrderRepository */ - private $orderRepository; - /** - * @var OrderService - */ - private $orderService; + private OrderRepository $orderRepository; + /** * @var EntityRepository */ private EntityRepository $orderTransactionRepository; + /** * @var StateMachineRegistry */ - private $stateMachineRegistry; + private StateMachineRegistry $stateMachineRegistry; + /** * @var LoggerInterface */ - private $logger; + private LoggerInterface $logger; + /** * @var ConfigurationService */ - private $configurationService; + private ConfigurationService $configurationService; + /** * @var OrderTransactionStateHandler */ - private $orderTransactionStateHandler; + private OrderTransactionStateHandler $orderTransactionStateHandler; + /** * @var InitialStateIdLoader */ - private $initialStateIdLoader; + private InitialStateIdLoader $initialStateIdLoader; /** * StoreApiController constructor. @@ -127,7 +132,6 @@ class PaymentController * @param PaymentResponseHandler $paymentResponseHandler * @param PaymentResponseService $paymentResponseService * @param OrderRepository $orderRepository - * @param OrderService $orderService * @param StateMachineRegistry $stateMachineRegistry * @param InitialStateIdLoader $initialStateIdLoader * @param EntityRepository $orderTransactionRepository @@ -143,7 +147,6 @@ public function __construct( PaymentResponseHandler $paymentResponseHandler, PaymentResponseService $paymentResponseService, OrderRepository $orderRepository, - OrderService $orderService, StateMachineRegistry $stateMachineRegistry, InitialStateIdLoader $initialStateIdLoader, EntityRepository $orderTransactionRepository, @@ -158,7 +161,6 @@ public function __construct( $this->paymentResponseHandler = $paymentResponseHandler; $this->paymentResponseService = $paymentResponseService; $this->orderRepository = $orderRepository; - $this->orderService = $orderService; $this->stateMachineRegistry = $stateMachineRegistry; $this->orderTransactionRepository = $orderTransactionRepository; $this->configurationService = $configurationService; @@ -168,31 +170,21 @@ public function __construct( } /** - * @Route( - * "/store-api/adyen/payment-methods", - * name="store-api.action.adyen.payment-methods", - * methods={"GET"} - * ) - * * @param SalesChannelContext $context * @return JsonResponse */ + #[Route('/store-api/adyen/payment-methods', name: 'store-api.action.adyen.payment-methods', methods: ['GET'])] public function getPaymentMethods(SalesChannelContext $context): JsonResponse { return new JsonResponse($this->paymentMethodsService->getPaymentMethods($context)); } /** - * @Route( - * "/store-api/adyen/payment-details", - * name="store-api.action.adyen.payment-details", - * methods={"POST"} - * ) - * * @param Request $request * @param SalesChannelContext $context * @return JsonResponse */ + #[Route('/store-api/adyen/payment-details', name: 'store-api.action.adyen.payment-details', methods: ['POST'])] public function postPaymentDetails( Request $request, SalesChannelContext $context @@ -268,16 +260,11 @@ function (Context $context) use ($orderTransactionId, $customFields) { } /** - * @Route( - * "/store-api/adyen/payment-status", - * name="store-api.action.adyen.payment-status", - * methods={"POST"} - * ) - * * @param Request $request * @param SalesChannelContext $context * @return JsonResponse */ + #[Route('/store-api/adyen/payment-status', name: 'store-api.action.adyen.payment-status', methods: ['POST'])] public function getPaymentStatus(Request $request, SalesChannelContext $context): JsonResponse { $orderId = $request->request->get('orderId'); @@ -296,38 +283,11 @@ public function getPaymentStatus(Request $request, SalesChannelContext $context) } /** - * @OA\Post( - * path="/adyen/set-payment", - * summary="set payment for an order", - * operationId="orderSetPayment", - * tags={"Store API", "Account"}, - * @OA\RequestBody( - * required=true, - * @OA\JsonContent( - * @OA\Property( - * property="paymentMethodId", - * description="The ID of the new paymentMethod", - * type="string" - * ), - * @OA\Property(property="orderId", description="The ID of the order", type="string") - * ) - * ), - * @OA\Response( - * response="200", - * description="Successfully set a payment", - * @OA\JsonContent(ref="#/components/schemas/SuccessResponse") - * ) - * ) - * @Route( - * "/store-api/adyen/set-payment", - * name="store-api.action.adyen.set-payment", - * methods={"POST"} - * ) - * * @param Request $request * @param SalesChannelContext $context * @return SetPaymentOrderRouteResponse */ + #[Route('/store-api/adyen/set-payment', name: 'store-api.action.adyen.set-payment', methods: ['POST'])] public function updatePaymentMethod(Request $request, SalesChannelContext $context): SetPaymentOrderRouteResponse { $this->setPaymentMethod( @@ -385,18 +345,17 @@ function () use ($order, $initialStateId, $orderId, $paymentMethodId, $context): } /** - * @Route( - * "/store-api/adyen/cancel-order-transaction", - * name="store-api.action.adyen.cancel-order-transaction", - * methods={"POST"} - * ) - * * @param Request $request * @param SalesChannelContext $salesChannelContext * @return JsonResponse - * @throws \Adyen\Exception\MissingDataException - * @throws \JsonException + * @throws MissingDataException + * @throws JsonException */ + #[Route( + '/store-api/adyen/cancel-order-transaction', + name: 'store-api.action.adyen.cancel-order-transaction', + methods: ['POST'] + )] public function cancelOrderTransaction( Request $request, SalesChannelContext $salesChannelContext @@ -405,10 +364,17 @@ public function cancelOrderTransaction( $orderId = $request->request->get('orderId'); $order = $this->orderRepository->getOrder($orderId, $context, ['transactions']); - $transaction = $order->getTransactions()->filterByState(OrderTransactionStates::STATE_IN_PROGRESS)->first(); + $transaction = $order->getTransactions() + ->filterByState(OrderTransactionStates::STATE_IN_PROGRESS) + ->first(); $this->stateMachineRegistry->transition( - new Transition(OrderTransactionDefinition::ENTITY_NAME, $transaction->getId(), 'cancel', 'stateId'), + new Transition( + OrderTransactionDefinition::ENTITY_NAME, + $transaction->getId(), + 'cancel', + 'stateId' + ), $context ); diff --git a/src/Handlers/Command/DisablePaymentMethodHandler.php b/src/Handlers/Command/DisablePaymentMethodHandler.php index 298f23d6..56bfecc9 100644 --- a/src/Handlers/Command/DisablePaymentMethodHandler.php +++ b/src/Handlers/Command/DisablePaymentMethodHandler.php @@ -26,6 +26,7 @@ use Adyen\Shopware\Provider\AdyenPluginProvider; use Shopware\Core\Framework\Context; +use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository; use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\ContainsFilter; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter; diff --git a/src/Handlers/PaymentResponseHandler.php b/src/Handlers/PaymentResponseHandler.php index f7ab78f9..2d08513d 100644 --- a/src/Handlers/PaymentResponseHandler.php +++ b/src/Handlers/PaymentResponseHandler.php @@ -30,6 +30,7 @@ use Adyen\Shopware\Exception\PaymentFailedException; use Adyen\Shopware\Service\CaptureService; use Adyen\Shopware\Service\ConfigurationService; +use Adyen\Shopware\Service\Repository\OrderTransactionRepository as AdyenOrderTransactionRepository; use Psr\Log\LoggerInterface; use Adyen\Shopware\Service\PaymentResponseService; use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionEntity; @@ -81,6 +82,8 @@ class PaymentResponseHandler private $orderTransactionRepository; + private AdyenOrderTransactionRepository $adyenOrderTransactionRepository; + /** * @var ConfigurationService */ @@ -105,7 +108,8 @@ public function __construct( OrderTransactionStateHandler $transactionStateHandler, $orderTransactionRepository, CaptureService $captureService, - ConfigurationService $configurationService + ConfigurationService $configurationService, + AdyenOrderTransactionRepository $adyenOrderTransactionRepository ) { $this->logger = $logger; $this->paymentResponseService = $paymentResponseService; @@ -113,6 +117,7 @@ public function __construct( $this->orderTransactionRepository = $orderTransactionRepository; $this->captureService = $captureService; $this->configurationService = $configurationService; + $this->adyenOrderTransactionRepository = $adyenOrderTransactionRepository; } /** @@ -232,7 +237,14 @@ public function handleShopwareApis( ): void { $orderTransactionId = $transaction->getOrderTransaction()->getId(); $context = $salesChannelContext->getContext(); - $stateTechnicalName = $transaction->getOrderTransaction()->getStateMachineState()->getTechnicalName(); + + $stateMachineState = $transaction->getOrderTransaction()->getStateMachineState(); + if (is_null($stateMachineState)) { + $orderTransaction = $this->adyenOrderTransactionRepository->getWithId($orderTransactionId); + $stateMachineState = $orderTransaction->getStateMachineState(); + } + + $stateTechnicalName = $stateMachineState->getTechnicalName(); $requiresManualCapture = $this->captureService ->isManualCapture($transaction->getOrderTransaction()->getPaymentMethod()->getHandlerIdentifier()); diff --git a/src/Migration/Migration1609373668AdyenMediaFolder.php b/src/Migration/Migration1609373668AdyenMediaFolder.php index a7222b8f..f9f934f2 100644 --- a/src/Migration/Migration1609373668AdyenMediaFolder.php +++ b/src/Migration/Migration1609373668AdyenMediaFolder.php @@ -23,11 +23,10 @@ public function update(Connection $connection): void $defaultFolderId = Uuid::randomBytes(); $configurationId = Uuid::randomBytes(); $connection->executeStatement(' - INSERT INTO `media_default_folder` (`id`, `association_fields`, `entity`, `created_at`) - VALUES (:id, :associationFields, :entity, :createdAt) + INSERT INTO `media_default_folder` (`id`, `entity`, `created_at`) + VALUES (:id, :entity, :createdAt) ', [ 'id' => $defaultFolderId, - 'associationFields' => '[]', 'entity' => 'adyen', 'createdAt' => (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT) ]); diff --git a/src/Resources/app/administration/src/component/adyen-config-check-button/index.js b/src/Resources/app/administration/src/component/adyen-config-check-button/index.js index 14fa8968..8069c262 100644 --- a/src/Resources/app/administration/src/component/adyen-config-check-button/index.js +++ b/src/Resources/app/administration/src/component/adyen-config-check-button/index.js @@ -45,8 +45,8 @@ Component.register('adyen-config-check-button', { // i.e. from this.$parent.$parent.$parent to this.$parent.$parent.$parent.$parent // @fixme This is a hack to support all versions let systemConfigComponent = this.$parent; - while (!systemConfigComponent.hasOwnProperty('actualConfigData')) { - systemConfigComponent = systemConfigComponent.$parent + while (systemConfigComponent.actualConfigData === undefined) { + systemConfigComponent = systemConfigComponent.$parent; } let selectedSalesChannelId = systemConfigComponent.currentSalesChannelId; let config = systemConfigComponent.actualConfigData; diff --git a/src/Resources/app/administration/src/component/adyen-refund/adyen-refund.html.twig b/src/Resources/app/administration/src/component/adyen-refund/adyen-refund.html.twig index 46bc3abd..cacb6e7e 100644 --- a/src/Resources/app/administration/src/component/adyen-refund/adyen-refund.html.twig +++ b/src/Resources/app/administration/src/component/adyen-refund/adyen-refund.html.twig @@ -20,8 +20,12 @@ :title="$tc('adyen.refundConfirm') + ': ' + order.orderNumber" variant="small">
- + +
\n',inject:["adyenService"],mixins:[t.getByName("notification")],data(){return{isLoading:!1,isSaveSuccessful:!1}},computed:{pluginConfig(){let e=this.$parent;for(;void 0===e.actualConfigData;)e=e.$parent;let t=e.currentSalesChannelId,n=e.actualConfigData;return Object.assign({},n.null,n[t])}},methods:{saveFinish(){this.isSaveSuccessful=!1},check(){this.isLoading=!0,this.adyenService.check(this.pluginConfig).then(e=>{e.success?(this.isSaveSuccessful=!0,this.createNotificationSuccess({title:this.$tc("adyen.configTestTitle"),message:this.$tc("adyen.configTestSuccess")})):this.createNotificationError({title:this.$tc("adyen.configTestTitle"),message:this.$tc(e.message?e.message:"adyen.configTestFail")}),this.isLoading=!1})}}}),n(597);let{Component:a,Mixin:s}=Shopware;a.register("adyen-payment-capture",{template:'{% block adyen_capture %}\n \n
\n
\n
\n {{ $tc(\'adyen.noCaptureRequests\') }}\n
\n
\n \n {{ $tc(\'adyen.sendCaptureRequest\') }}\n \n
\n \n \n \n
\n \n \n
\n
\n {{ $tc(\'adyen.error\') }}\n
\n
\n{% endblock %}\n',inject:["adyenService","systemConfigApiService"],mixins:[s.getByName("notification")],props:{order:{type:Object,required:!0}},data(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],showModal:!1,captureRequests:[],allowCapture:!1,captureEnabled:!1,errorOccurred:!1,isLoading:!0,showWidget:!1}},methods:{openModal(){this.showModal=!0},onCloseModal(){this.showModal=!1},onSubmitCapture(){this.isLoading=!0,this.adyenService.capture(this.order.id).then(e=>{e.success?(this.fetchCaptureRequests(),this.createNotificationSuccess({title:this.$tc("adyen.adyenPaymentCaptureTitle"),message:this.$tc("adyen.captureSuccessful")})):this.createNotificationError({title:this.$tc("adyen.adyenPaymentCaptureTitle"),message:this.$tc(e.message?e.message:"adyen.error")})}).catch(()=>{this.createNotificationError({title:this.$tc("adyen.adyenPaymentCaptureTitle"),message:this.$tc("adyen.error")})}).finally(()=>{this.isLoading=!1,this.showModal=!1})},fetchCaptureRequests(){this.isLoading=!0,this.adyenService.getCaptureRequests(this.order.id).then(e=>{this.captureRequests=e,this.isCaptureAllowed()}).catch(()=>{this.errorOccurred=!0,this.captureRequests=[]}).finally(()=>{this.isLoading=!1})},isManualCaptureEnabled(){this.isLoading=!0,this.adyenService.isManualCaptureEnabled(this.order.id).then(e=>{this.captureEnabled=e,this.showWidget=this.adyenService.isAdyenOrder(this.order)&&this.captureEnabled}).catch(()=>{this.errorOccurred=!0,this.captureEnabled=!1}).finally(()=>{this.isLoading=!1})},isCaptureAllowed(){this.isLoading=!0,this.adyenService.isCaptureAllowed(this.order.id).then(e=>{this.allowCapture=e}).catch(()=>{this.errorOccurred=!0,this.allowCapture=!1}).finally(()=>{this.isLoading=!1})}},beforeMount(){this.isManualCaptureEnabled(),this.fetchCaptureRequests()}}),n(842);let{Component:r,Mixin:i}=Shopware;r.register("adyen-refund",{template:'{% block adyen_refund %}\n \n
\n
\n
\n {{ $tc(\'adyen.noRefundsCreated\') }}\n
\n
\n \n {{ $tc(\'sw-order.documentCard.labelCreateNew\') }}\n \n
\n \n
\n \n \n
\n \n
\n
\n \n \n
\n
\n {{ $tc(\'adyen.refundFetchError\') }}\n
\n
\n{% endblock %}\n',inject:["adyenService"],mixins:[i.getByName("notification")],props:{order:{type:Object,required:!0}},data(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],refundAmount:0,showModal:!1,refunds:[],allowRefund:!0,isLoadingTable:!0,errorOccurred:!1,isLoadingRefund:!1,showWidget:!1}},methods:{openModal(){this.showModal=!0},onCloseModal(){this.showModal=!1},onRefund(){this.isLoadingRefund=!0,this.adyenService.postRefund(this.order.id,this.refundAmount).then(e=>{e.success?(this.fetchRefunds(),this.createNotificationSuccess({title:this.$tc("adyen.refundTitle"),message:this.$tc("adyen.refundSuccessful")})):this.createNotificationError({title:this.$tc("adyen.refundTitle"),message:this.$tc(e.message?e.message:"adyen.error")})}).catch(()=>{this.createNotificationError({title:this.$tc("adyen.refundTitle"),message:this.$tc("adyen.error")})}).finally(()=>{this.isLoadingRefund=!1,this.showModal=!1})},fetchRefunds(){this.isLoadingTable=!0,this.adyenService.getRefunds(this.order.id).then(e=>{this.refunds=e,this.isRefundAllowed()}).catch(()=>{this.errorOccurred=!0,this.refunds=[]}).finally(()=>{this.isLoadingTable=!1})},isRefundAllowed(){let e=0;for(let t of this.refunds)"Failed"!==t.status&&(e+=t.rawAmount);this.allowRefund=this.order.amountTotal>e/100},isAdyenOrder(){let e=this.order.transactions,t=!1;for(let n=0;n\n \n \n {% block sw_data_grid_body_columns %}\n {% block sw_data_grid_column_actions %}\n \n {% endblock %}\n {% endblock %}\n \n

{{ $tc(\'adyen.noNotificationsReceived\') }}

\n
\n \n{% endblock %}\n',inject:["adyenService"],mixins:[d.getByName("notification")],props:{order:{type:Object,required:!0}},data(){return{notifications:[],columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"eventCode",label:this.$tc("adyen.columnHeaders.event")},{property:"success",label:this.$tc("adyen.columnHeaders.success")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")},{property:"errorCount",label:this.$tc("adyen.columnHeaders.errorCount")},{property:"errorMessage",label:this.$tc("adyen.columnHeaders.errorMessage")}],showWidget:!1}},methods:{fetchNotifications(){this.adyenService.fetchNotifications(this.order.id).then(e=>{this.notifications=e})},onReschedule(e){this.adyenService.rescheduleNotification(e.notificationId).then(e=>{this.createNotificationSuccess({title:this.$tc("adyen.reprocessNotification"),message:this.$tc("adyen.notificationRescheduleSuccess")}),this.fetchNotifications()})}},beforeMount(){this.showWidget=this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchNotifications()}});let c={};c.isVersionOlderThan65=()=>{var e,t;return -1===(t="6.5.0.0",(e=Shopware.Context.app.config.version).startsWith(t+"-")?-1:t.startsWith(e+"-")?1:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"}))};var l=c;let{Component:u}=Shopware;u.register("adyen-partial-payments",{template:'
\n
    \n
    {{ $tc(\'adyen.authorisedPayments\') }}
    \n
    \n {{ payment.pspReference }} -\n {{ payment.method }} -\n {{ payment.amount }}\n
    \n
    {{ errorMessage }}
    \n
\n
    \n \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n PSP Reference\n
    \n
    \n
    \n Payment Method\n
    \n
    \n
    \n Amount\n
    \n
    \n \n \n
    \n {{ payment.method }}\n
    \n
    \n
    \n {{ payment.amount }}\n
    \n
    \n
    \n
    \n {{ errorMessage }}\n
\n
\n',inject:["adyenService"],props:{order:{type:Object,required:!0}},methods:{fetchAdyenPartialPayments(){this.adyenService.fetchAdyenPartialPayments(this.order.id).then(e=>{e.length>0?this.partialPayments=e:this.errorMessage=this.$tc("adyen.pendingWebhook")})}},data(){return{errorMessage:"",partialPayments:[],showWidget:!1,isVersionOlderThan65:!1}},beforeMount(){this.isVersionOlderThan65=l.isVersionOlderThan65(),this.showWidget=this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchAdyenPartialPayments()}}),Shopware.Component.override("sw-order-detail-general",{template:'{% block sw_order_detail_general_line_items_card %}\n {% parent %}\n \n \n \n{% endblock %}\n'}),Shopware.Component.override("sw-order-detail-base",{template:'{% block sw_order_detail_base_custom_fields %}\n {% parent %}\n \n \n \n{% endblock %}\n'}),Shopware.Component.override("sw-order-user-card",{template:'{% block sw_order_detail_base_secondary_info_payment %}\n {% parent %}\n\n \n{% endblock %}\n'}),Shopware.Component.override("sw-order-detail-details",{template:'{% block sw_order_detail_details_payment_method_select %}\n {% parent %}\n\n \n{% endblock %}\n'}),n(465);var h=JSON.parse('{"adyen":{"configTestTitle":"Configuration test","configTestSuccess":"Configuration is successfully tested","configTestFail":"There\'s an issue in your configuration","adyenRefunds":"Adyen Refunds","refundTitle":"Refund","refundSuccessful":"A refund has been successfully submitted.","invalidRefundAmount":"Refund amount exceeds order total","error":"An error has occurred. Please check the logs.","refundFetchError":"An error has occurred while attempting to get linked refunds.","refundConfirm":"Create refund for order","createRefund":"Create Refund","noRefundsCreated":"No refunds created","columnHeaders":{"pspReference":"PSP Reference","amount":"Amount","status":"Status","event":"Event","success":"Success","created":"Created","updated":"Updated","errorCount":"Error Count","errorMessage":"Error Message"},"reprocessNotification":"Reprocess Notification","notificationRescheduleSuccess":"Notification will be processed again.","notificationsTitle":"Adyen Webhook Notifications","noNotificationsReceived":"No webhook notifications received.","adyenPaymentCaptureTitle":"Adyen Capture Requests","noCaptureRequests":"No capture requests have been sent","sendCaptureRequest":"Send Capture Request","captureConfirm":"Capture payment for order","captureSuccessful":"Capture request has been successfully sent","pendingWebhook":"Order is pending webhook.","authorisedPayments":"Authorised Payments"}}');Shopware.Locale.extend("en-GB",h)}()})(); +//# sourceMappingURL=adyen-payment-shopware6.js.map \ No newline at end of file diff --git a/src/Resources/public/administration/js/adyen-payment-shopware64.js.dist b/src/Resources/public/administration/js/adyen-payment-shopware64.js.dist deleted file mode 100644 index 29d51134..00000000 --- a/src/Resources/public/administration/js/adyen-payment-shopware64.js.dist +++ /dev/null @@ -1 +0,0 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/bundles/adyenpaymentshopware6/",n(n.s="RgpO")}({"6MJt":function(e,t,n){},Fxip:function(e,t,n){var r=n("xIYV");r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n("SZ7m").default)("3299a05e",r,!0,{})},MTTW:function(e,t){var n=Shopware.Component,r=Shopware.Data.Criteria;n.extend("sw-entity-single-select-override","sw-entity-single-select",{props:{criteria:{type:Object,required:!1,default:function(){var e=new r(1,this.resultLimit);return e.addFilter(r.equals("stateMachine.technicalName","order_delivery.state")),e}}}})},RgpO:function(e,t,n){"use strict";n.r(t);n("UvA/");var r=Shopware,a=r.Component,i=r.Mixin;a.register("adyen-config-check-button",{template:'\n',inject:["adyenService"],mixins:[i.getByName("notification")],data:function(){return{isLoading:!1,isSaveSuccessful:!1}},computed:{pluginConfig:function(){for(var e=this.$parent;!e.hasOwnProperty("actualConfigData");)e=e.$parent;var t=e.currentSalesChannelId,n=e.actualConfigData;return Object.assign({},n.null,n[t])}},methods:{saveFinish:function(){this.isSaveSuccessful=!1},check:function(){var e=this;this.isLoading=!0,this.adyenService.check(this.pluginConfig).then((function(t){t.success?(e.isSaveSuccessful=!0,e.createNotificationSuccess({title:e.$tc("adyen.configTestTitle"),message:e.$tc("adyen.configTestSuccess")})):e.createNotificationError({title:e.$tc("adyen.configTestTitle"),message:e.$tc(t.message?t.message:"adyen.configTestFail")}),e.isLoading=!1}))}}});n("hnQ+");var o=Shopware,s=o.Component,d=o.Mixin;s.register("adyen-payment-capture",{template:'{% block adyen_capture %}\n \n
\n
\n
\n {{ $tc(\'adyen.noCaptureRequests\') }}\n
\n
\n \n {{ $tc(\'adyen.sendCaptureRequest\') }}\n \n
\n \n \n \n
\n \n \n
\n
\n {{ $tc(\'adyen.error\') }}\n
\n
\n{% endblock %}\n',inject:["adyenService","systemConfigApiService"],mixins:[d.getByName("notification")],props:{order:{type:Object,required:!0}},data:function(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],showModal:!1,captureRequests:[],allowCapture:!1,captureEnabled:!1,errorOccurred:!1,isLoading:!0,showWidget:!1}},methods:{openModal:function(){this.showModal=!0},onCloseModal:function(){this.showModal=!1},onSubmitCapture:function(){var e=this;this.isLoading=!0,this.adyenService.capture(this.order.id).then((function(t){t.success?(e.fetchCaptureRequests(),e.createNotificationSuccess({title:e.$tc("adyen.adyenPaymentCaptureTitle"),message:e.$tc("adyen.captureSuccessful")})):e.createNotificationError({title:e.$tc("adyen.adyenPaymentCaptureTitle"),message:e.$tc(t.message?t.message:"adyen.error")})})).catch((function(){e.createNotificationError({title:e.$tc("adyen.adyenPaymentCaptureTitle"),message:e.$tc("adyen.error")})})).finally((function(){e.isLoading=!1,e.showModal=!1}))},fetchCaptureRequests:function(){var e=this;this.isLoading=!0,this.adyenService.getCaptureRequests(this.order.id).then((function(t){e.captureRequests=t,e.isCaptureAllowed()})).catch((function(){e.errorOccurred=!0,e.captureRequests=[]})).finally((function(){e.isLoading=!1}))},isManualCaptureEnabled:function(){var e=this;this.isLoading=!0,this.adyenService.isManualCaptureEnabled(this.order.id).then((function(t){e.captureEnabled=t,e.showWidget=e.adyenService.isAdyenOrder(e.order)&&e.captureEnabled})).catch((function(){e.errorOccurred=!0,e.captureEnabled=!1})).finally((function(){e.isLoading=!1}))},isCaptureAllowed:function(){var e=this;this.isLoading=!0,this.adyenService.isCaptureAllowed(this.order.id).then((function(t){e.allowCapture=t})).catch((function(){e.errorOccurred=!0,e.allowCapture=!1})).finally((function(){e.isLoading=!1}))}},beforeMount:function(){this.isManualCaptureEnabled(),this.fetchCaptureRequests()}});n("Fxip");function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n\n
\n
\n
\n {{ $tc(\'adyen.noRefundsCreated\') }}\n
\n
\n \n {{ $tc(\'sw-order.documentCard.labelCreateNew\') }}\n \n
\n \n
\n \n
\n \n
\n
\n \n \n
\n
\n {{ $tc(\'adyen.refundFetchError\') }}\n
\n \n{% endblock %}\n',inject:["adyenService"],mixins:[p.getByName("notification")],props:{order:{type:Object,required:!0}},data:function(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],refundAmount:0,showModal:!1,refunds:[],allowRefund:!0,isLoadingTable:!0,errorOccurred:!1,isLoadingRefund:!1,showWidget:!1}},methods:{openModal:function(){this.showModal=!0},onCloseModal:function(){this.showModal=!1},onRefund:function(){var e=this;this.isLoadingRefund=!0,this.adyenService.postRefund(this.order.id,this.refundAmount).then((function(t){t.success?(e.fetchRefunds(),e.createNotificationSuccess({title:e.$tc("adyen.refundTitle"),message:e.$tc("adyen.refundSuccessful")})):e.createNotificationError({title:e.$tc("adyen.refundTitle"),message:e.$tc(t.message?t.message:"adyen.error")})})).catch((function(){e.createNotificationError({title:e.$tc("adyen.refundTitle"),message:e.$tc("adyen.error")})})).finally((function(){e.isLoadingRefund=!1,e.showModal=!1}))},fetchRefunds:function(){var e=this;this.isLoadingTable=!0,this.adyenService.getRefunds(this.order.id).then((function(t){e.refunds=t,e.isRefundAllowed()})).catch((function(){e.errorOccurred=!0,e.refunds=[]})).finally((function(){e.isLoadingTable=!1}))},isRefundAllowed:function(){var e,t=0,n=c(this.refunds);try{for(n.s();!(e=n.n()).done;){var r=e.value;"Failed"!==r.status&&(t+=r.rawAmount)}}catch(e){n.e(e)}finally{n.f()}this.allowRefund=this.order.amountTotal>t/100},isAdyenOrder:function(){for(var e=this.order.transactions,t=!1,n=0;n\n \n \n {% block sw_data_grid_body_columns %}\n {% block sw_data_grid_column_actions %}\n \n {% endblock %}\n {% endblock %}\n \n

{{ $tc(\'adyen.noNotificationsReceived\') }}

\n
\n \n{% endblock %}\n',inject:["adyenService"],mixins:[m.getByName("notification")],props:{order:{type:Object,required:!0}},data:function(){return{notifications:[],columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"eventCode",label:this.$tc("adyen.columnHeaders.event")},{property:"success",label:this.$tc("adyen.columnHeaders.success")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")},{property:"errorCount",label:this.$tc("adyen.columnHeaders.errorCount")},{property:"errorMessage",label:this.$tc("adyen.columnHeaders.errorMessage")}],showWidget:!1}},methods:{fetchNotifications:function(){var e=this;this.adyenService.fetchNotifications(this.order.id).then((function(t){e.notifications=t}))},onReschedule:function(e){var t=this;this.adyenService.rescheduleNotification(e.notificationId).then((function(e){t.createNotificationSuccess({title:t.$tc("adyen.reprocessNotification"),message:t.$tc("adyen.notificationRescheduleSuccess")}),t.fetchNotifications()}))}},beforeMount:function(){this.showWidget=this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchNotifications()}});var g={isVersionOlderThan65:function(){var e,t,n=Shopware.Context.app.config.version;return-1===(t="6.5.0.0",(e=n).startsWith(t+"-")?-1:t.startsWith(e+"-")?1:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"}))}},v=g;Shopware.Component.register("adyen-partial-payments",{template:'
\n
    \n
    {{ $tc(\'adyen.authorisedPayments\') }}
    \n
    \n {{ payment.pspReference }} -\n {{ payment.method }} -\n {{ payment.amount }}\n
    \n
    {{ errorMessage }}
    \n
\n
    \n \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n PSP Reference\n
    \n
    \n
    \n Payment Method\n
    \n
    \n
    \n Amount\n
    \n
    \n \n \n
    \n {{ payment.method }}\n
    \n
    \n
    \n {{ payment.amount }}\n
    \n
    \n
    \n
    \n {{ errorMessage }}\n
\n
\n',inject:["adyenService"],props:{order:{type:Object,required:!0}},methods:{fetchAdyenPartialPayments:function(){var e=this;this.adyenService.fetchAdyenPartialPayments(this.order.id).then((function(t){t.length>0?e.partialPayments=t:e.errorMessage=e.$tc("adyen.pendingWebhook")}))}},data:function(){return{errorMessage:"",partialPayments:[],showWidget:!1,isVersionOlderThan65:!1}},beforeMount:function(){this.isVersionOlderThan65=v.isVersionOlderThan65(),this.showWidget=this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchAdyenPartialPayments()}});Shopware.Component.override("sw-order-detail-general",{template:'{% block sw_order_detail_general_line_items_card %}\n {% parent %}\n \n \n \n{% endblock %}\n'});Shopware.Component.override("sw-order-detail-base",{template:'{% block sw_order_detail_base_custom_fields %}\n {% parent %}\n \n \n \n{% endblock %}\n'});Shopware.Component.override("sw-order-user-card",{template:'{% block sw_order_detail_base_secondary_info_payment %}\n {% parent %}\n\n \n{% endblock %}\n'});Shopware.Component.override("sw-order-detail-details",{template:'{% block sw_order_detail_details_payment_method_select %}\n {% parent %}\n\n \n{% endblock %}\n'});n("MTTW");var w=n("bY4/");Shopware.Locale.extend("en-GB",w)},SZ7m:function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},a=0;an.parts.length&&(r.parts.length=n.parts.length)}else{var o=[];for(a=0;a2&&void 0!==arguments[2]?arguments[2]:"adyen";return r(this,l),(n=d.call(this,e,t,a)).headers=n.getBasicHeaders({}),n}return t=l,(n=[{key:"check",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.post("_action/".concat(this.getApiBasePath(),"/verify"),e,{headers:t}).then((function(e){return c.handleResponse(e)}))}},{key:"capture",value:function(e){return this.httpClient.post(this.getApiBasePath()+"/capture",{orderId:e},{headers:this.headers}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during capture request: "+e.message),e}))}},{key:"getCaptureRequests",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/captures",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during capture request: "+e.message),e}))}},{key:"isCaptureAllowed",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/is-capture-allowed",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during is-capture-allowed request: "+e.message),e}))}},{key:"isManualCaptureEnabled",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/is-manual-capture-enabled",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during is-capture-allowed request: "+e.message),e}))}},{key:"getRefunds",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/refunds",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during refunds request: "+e.message),e}))}},{key:"postRefund",value:function(e,t){var n=this.getBasicHeaders({});return this.httpClient.post(this.getApiBasePath()+"/refunds",{orderId:e,refundAmount:t},{headers:n}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during post refund request: "+e.message),e}))}},{key:"fetchNotifications",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/notifications",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred: "+e.message),e}))}},{key:"rescheduleNotification",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/reschedule-notification/"+e,{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred: "+e.message),e}))}},{key:"isAdyenOrder",value:function(e){for(var t=e.transactions,n=!1,r=0;r\n Test Configuration\n\n',inject:["adyenService"],mixins:[i.getByName("notification")],data:function(){return{isLoading:!1,isSaveSuccessful:!1}},computed:{pluginConfig:function(){for(var e=this.$parent;!e.hasOwnProperty("actualConfigData");)e=e.$parent;var t=e.currentSalesChannelId,n=e.actualConfigData;return Object.assign({},n.null,n[t])}},methods:{saveFinish:function(){this.isSaveSuccessful=!1},check:function(){var e=this;this.isLoading=!0,this.adyenService.check(this.pluginConfig).then((function(t){t.success?(e.isSaveSuccessful=!0,e.createNotificationSuccess({title:e.$tc("adyen.configTestTitle"),message:e.$tc("adyen.configTestSuccess")})):e.createNotificationError({title:e.$tc("adyen.configTestTitle"),message:e.$tc(t.message?t.message:"adyen.configTestFail")}),e.isLoading=!1}))}}});n("H7Mt");var o=Shopware,s=o.Component,d=o.Mixin;s.register("adyen-payment-capture",{template:'{% block adyen_capture %}\n \n
\n
\n
\n {{ $tc(\'adyen.noCaptureRequests\') }}\n
\n
\n \n {{ $tc(\'adyen.sendCaptureRequest\') }}\n \n
\n \n \n \n
\n \n \n
\n
\n {{ $tc(\'adyen.error\') }}\n
\n
\n{% endblock %}\n',inject:["adyenService","systemConfigApiService"],mixins:[d.getByName("notification")],props:{order:{type:Object,required:!0}},data:function(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],showModal:!1,captureRequests:[],allowCapture:!1,captureEnabled:!1,errorOccurred:!1,isLoading:!0,showWidget:!1}},methods:{openModal:function(){this.showModal=!0},onCloseModal:function(){this.showModal=!1},onSubmitCapture:function(){var e=this;this.isLoading=!0,this.adyenService.capture(this.order.id).then((function(t){t.success?(e.fetchCaptureRequests(),e.createNotificationSuccess({title:e.$tc("adyen.adyenPaymentCaptureTitle"),message:e.$tc("adyen.captureSuccessful")})):e.createNotificationError({title:e.$tc("adyen.adyenPaymentCaptureTitle"),message:e.$tc(t.message?t.message:"adyen.error")})})).catch((function(){e.createNotificationError({title:e.$tc("adyen.adyenPaymentCaptureTitle"),message:e.$tc("adyen.error")})})).finally((function(){e.isLoading=!1,e.showModal=!1}))},fetchCaptureRequests:function(){var e=this;this.isLoading=!0,this.adyenService.getCaptureRequests(this.order.id).then((function(t){e.captureRequests=t,e.isCaptureAllowed()})).catch((function(){e.errorOccurred=!0,e.captureRequests=[]})).finally((function(){e.isLoading=!1}))},isManualCaptureEnabled:function(){var e=this;this.isLoading=!0,this.adyenService.isManualCaptureEnabled(this.order.id).then((function(t){e.captureEnabled=t,e.showWidget=e.adyenService.isAdyenOrder(e.order)&&e.captureEnabled})).catch((function(){e.errorOccurred=!0,e.captureEnabled=!1})).finally((function(){e.isLoading=!1}))},isCaptureAllowed:function(){var e=this;this.isLoading=!0,this.adyenService.isCaptureAllowed(this.order.id).then((function(t){e.allowCapture=t})).catch((function(){e.errorOccurred=!0,e.allowCapture=!1})).finally((function(){e.isLoading=!1}))}},beforeMount:function(){this.isManualCaptureEnabled(),this.fetchCaptureRequests()}});n("tG31");function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n\n
\n
\n
\n {{ $tc(\'adyen.noRefundsCreated\') }}\n
\n
\n \n {{ $tc(\'sw-order.documentCard.labelCreateNew\') }}\n \n
\n \n
\n \n
\n \n
\n
\n \n \n
\n
\n {{ $tc(\'adyen.refundFetchError\') }}\n
\n \n{% endblock %}\n',inject:["adyenService"],mixins:[p.getByName("notification")],props:{order:{type:Object,required:!0}},data:function(){return{columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")}],refundAmount:0,showModal:!1,refunds:[],allowRefund:!0,isLoadingTable:!0,errorOccurred:!1,isLoadingRefund:!1,showWidget:!1}},methods:{openModal:function(){this.showModal=!0},onCloseModal:function(){this.showModal=!1},onRefund:function(){var e=this;this.isLoadingRefund=!0,this.adyenService.postRefund(this.order.id,this.refundAmount).then((function(t){t.success?(e.fetchRefunds(),e.createNotificationSuccess({title:e.$tc("adyen.refundTitle"),message:e.$tc("adyen.refundSuccessful")})):e.createNotificationError({title:e.$tc("adyen.refundTitle"),message:e.$tc(t.message?t.message:"adyen.error")})})).catch((function(){e.createNotificationError({title:e.$tc("adyen.refundTitle"),message:e.$tc("adyen.error")})})).finally((function(){e.isLoadingRefund=!1,e.showModal=!1}))},fetchRefunds:function(){var e=this;this.isLoadingTable=!0,this.adyenService.getRefunds(this.order.id).then((function(t){e.refunds=t,e.isRefundAllowed()})).catch((function(){e.errorOccurred=!0,e.refunds=[]})).finally((function(){e.isLoadingTable=!1}))},isRefundAllowed:function(){var e,t=0,n=c(this.refunds);try{for(n.s();!(e=n.n()).done;){var r=e.value;"Failed"!==r.status&&(t+=r.rawAmount)}}catch(e){n.e(e)}finally{n.f()}this.allowRefund=this.order.amountTotal>t/100},isAdyenOrder:function(){for(var e=this.order.transactions,t=!1,n=0;n\n \n \n {% block sw_data_grid_body_columns %}\n {% block sw_data_grid_column_actions %}\n \n {% endblock %}\n {% endblock %}\n \n

{{ $tc(\'adyen.noNotificationsReceived\') }}

\n
\n \n{% endblock %}\n',inject:["adyenService"],mixins:[m.getByName("notification")],props:{order:{type:Object,required:!0}},data:function(){return{notifications:[],columns:[{property:"pspReference",label:this.$tc("adyen.columnHeaders.pspReference")},{property:"eventCode",label:this.$tc("adyen.columnHeaders.event")},{property:"success",label:this.$tc("adyen.columnHeaders.success")},{property:"amount",label:this.$tc("adyen.columnHeaders.amount")},{property:"status",label:this.$tc("adyen.columnHeaders.status")},{property:"createdAt",label:this.$tc("adyen.columnHeaders.created")},{property:"updatedAt",label:this.$tc("adyen.columnHeaders.updated")},{property:"errorCount",label:this.$tc("adyen.columnHeaders.errorCount")},{property:"errorMessage",label:this.$tc("adyen.columnHeaders.errorMessage")}],showWidget:!1}},methods:{fetchNotifications:function(){var e=this;this.adyenService.fetchNotifications(this.order.id).then((function(t){e.notifications=t}))},onReschedule:function(e){var t=this;this.adyenService.rescheduleNotification(e.notificationId).then((function(e){t.createNotificationSuccess({title:t.$tc("adyen.reprocessNotification"),message:t.$tc("adyen.notificationRescheduleSuccess")}),t.fetchNotifications()}))}},beforeMount:function(){this.showWidget=this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchNotifications()}});var g={isVersionOlderThan65:function(){var e,t,n=Shopware.Context.app.config.version;return-1===(t="6.5.0.0",(e=n).startsWith(t+"-")?-1:t.startsWith(e+"-")?1:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"}))}},v=g;Shopware.Component.register("adyen-partial-payments",{template:'
\n
    \n
    {{ $tc(\'adyen.authorisedPayments\') }}
    \n
    \n {{ payment.pspReference }} -\n {{ payment.method }} -\n {{ payment.amount }}\n
    \n
    {{ errorMessage }}
    \n
\n
    \n \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n PSP Reference\n
    \n
    \n
    \n Payment Method\n
    \n
    \n
    \n Amount\n
    \n
    \n \n \n
    \n {{ payment.method }}\n
    \n
    \n
    \n {{ payment.amount }}\n
    \n
    \n
    \n
    \n {{ errorMessage }}\n
\n
\n',inject:["adyenService"],props:{order:{type:Object,required:!0}},methods:{fetchAdyenPartialPayments:function(){var e=this;this.adyenService.fetchAdyenPartialPayments(this.order.id).then((function(t){t.length>0?e.partialPayments=t:e.errorMessage=e.$tc("adyen.pendingWebhook")}))}},data:function(){return{errorMessage:"",partialPayments:[],showWidget:!1,isVersionOlderThan65:!1}},beforeMount:function(){this.isVersionOlderThan65=v.isVersionOlderThan65(),this.showWidget=this.adyenService.isAdyenOrder(this.order),this.showWidget&&this.fetchAdyenPartialPayments()}});Shopware.Component.override("sw-order-detail-general",{template:'{% block sw_order_detail_general_line_items_card %}\n {% parent %}\n \n \n \n{% endblock %}\n'});Shopware.Component.override("sw-order-detail-base",{template:'{% block sw_order_detail_base_custom_fields %}\n {% parent %}\n \n \n \n{% endblock %}\n'});Shopware.Component.override("sw-order-user-card",{template:'{% block sw_order_detail_base_secondary_info_payment %}\n {% parent %}\n\n \n{% endblock %}\n'});Shopware.Component.override("sw-order-detail-details",{template:'{% block sw_order_detail_details_payment_method_select %}\n {% parent %}\n\n \n{% endblock %}\n'});n("vNjL");var w=n("GGYj");Shopware.Locale.extend("en-GB",w)},GGYj:function(e){e.exports=JSON.parse('{"adyen":{"configTestTitle":"Configuration test","configTestSuccess":"Configuration is successfully tested","configTestFail":"There\'s an issue in your configuration","adyenRefunds":"Adyen Refunds","refundTitle":"Refund","refundSuccessful":"A refund has been successfully submitted.","invalidRefundAmount":"Refund amount exceeds order total","error":"An error has occurred. Please check the logs.","refundFetchError":"An error has occurred while attempting to get linked refunds.","refundConfirm":"Create refund for order","createRefund":"Create Refund","noRefundsCreated":"No refunds created","columnHeaders":{"pspReference":"PSP Reference","amount":"Amount","status":"Status","event":"Event","success":"Success","created":"Created","updated":"Updated","errorCount":"Error Count","errorMessage":"Error Message"},"reprocessNotification":"Reprocess Notification","notificationRescheduleSuccess":"Notification will be processed again.","notificationsTitle":"Adyen Webhook Notifications","noNotificationsReceived":"No webhook notifications received.","adyenPaymentCaptureTitle":"Adyen Capture Requests","noCaptureRequests":"No capture requests have been sent","sendCaptureRequest":"Send Capture Request","captureConfirm":"Capture payment for order","captureSuccessful":"Capture request has been successfully sent","pendingWebhook":"Order is pending webhook.","authorisedPayments":"Authorised Payments"}}')},H7Mt:function(e,t,n){var r=n("mH+n");r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n("P8hj").default)("056a1238",r,!0,{})},P8hj:function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},a=0;an.parts.length&&(r.parts.length=n.parts.length)}else{var o=[];for(a=0;a2&&void 0!==arguments[2]?arguments[2]:"adyen";return r(this,l),(n=d.call(this,e,t,a)).headers=n.getBasicHeaders({}),n}return t=l,(n=[{key:"check",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.post("_action/".concat(this.getApiBasePath(),"/verify"),e,{headers:t}).then((function(e){return c.handleResponse(e)}))}},{key:"capture",value:function(e){return this.httpClient.post(this.getApiBasePath()+"/capture",{orderId:e},{headers:this.headers}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during capture request: "+e.message),e}))}},{key:"getCaptureRequests",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/captures",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during capture request: "+e.message),e}))}},{key:"isCaptureAllowed",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/is-capture-allowed",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during is-capture-allowed request: "+e.message),e}))}},{key:"isManualCaptureEnabled",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/is-manual-capture-enabled",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during is-capture-allowed request: "+e.message),e}))}},{key:"getRefunds",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/refunds",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during refunds request: "+e.message),e}))}},{key:"postRefund",value:function(e,t){var n=this.getBasicHeaders({});return this.httpClient.post(this.getApiBasePath()+"/refunds",{orderId:e,refundAmount:t},{headers:n}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred during post refund request: "+e.message),e}))}},{key:"fetchNotifications",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/orders/"+e+"/notifications",{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred: "+e.message),e}))}},{key:"rescheduleNotification",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.get(this.getApiBasePath()+"/reschedule-notification/"+e,{headers:t}).then((function(e){return c.handleResponse(e)})).catch((function(e){throw console.error("An error occurred: "+e.message),e}))}},{key:"isAdyenOrder",value:function(e){for(var t=e.transactions,n=!1,r=0;r {\n return ApiService.handleResponse(response);\n });\n }\n\n capture(orderId) {\n return this.httpClient.post(\n this.getApiBasePath() + '/capture',\n { orderId },\n { headers: this.headers }\n ).then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during capture request: ' + error.message);\n throw error;\n });\n }\n\n getCaptureRequests(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/captures', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during capture request: ' + error.message);\n throw error;\n });\n }\n\n isCaptureAllowed(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/is-capture-allowed', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during is-capture-allowed request: ' + error.message);\n throw error;\n });\n }\n\n isManualCaptureEnabled(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/is-manual-capture-enabled', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during is-capture-allowed request: ' + error.message);\n throw error;\n });\n }\n\n getRefunds(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/refunds', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred during refunds request: ' + error.message);\n throw error;\n });\n }\n\n postRefund(orderId, refundAmount) {\n const headers = this.getBasicHeaders({});\n return this.httpClient\n .post(this.getApiBasePath() + '/refunds', {orderId: orderId, refundAmount: refundAmount}, {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n\n }).catch((error) => {\n console.error('An error occurred during post refund request: ' + error.message);\n throw error;\n });\n }\n\n fetchNotifications(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/notifications', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred: ' + error.message);\n throw error;\n });\n }\n\n rescheduleNotification(notificationId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/reschedule-notification/' + notificationId , {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred: ' + error.message);\n throw error;\n });\n }\n\n isAdyenOrder(order) {\n const orderTransactions = order.transactions;\n let isAdyen = false;\n for (let i = 0; i < orderTransactions.length; i++) {\n if (orderTransactions[i].customFields !== undefined) {\n if (orderTransactions[i].customFields.originalPspReference !== undefined) {\n isAdyen = true;\n }\n }\n }\n\n return isAdyen;\n }\n\n fetchAdyenPartialPayments(orderId) {\n const headers = this.getBasicHeaders({});\n\n return this.httpClient\n .get(this.getApiBasePath() + '/orders/' + orderId + '/partial-payments', {\n headers\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n }).catch((error) => {\n console.error('An error occurred: ' + error.message);\n throw error;\n });\n }\n}\n\nApplication.addServiceProvider('adyenService', (container) => {\n const initContainer = Application.getContainer('init');\n return new ApiClient(initContainer.httpClient, container.loginService);\n});\n","// style-loader: Adds some css to the DOM by adding a