From cc82d098acad82df40fad286028b88c7e49cd4ed Mon Sep 17 00:00:00 2001 From: SirDomin Date: Mon, 26 Oct 2020 10:26:40 +0100 Subject: [PATCH] removed unused controller --- src/Controller/PayWithPayPalFormAction.php | 82 ------------------- src/Resources/config/services/controller.xml | 8 -- src/Resources/config/shop_routing.yaml | 6 -- .../templates/bundles/SyliusAdminBundle | 1 - .../templates/bundles/SyliusShopBundle | 1 - 5 files changed, 98 deletions(-) delete mode 100644 src/Controller/PayWithPayPalFormAction.php delete mode 120000 tests/Application/templates/bundles/SyliusAdminBundle delete mode 120000 tests/Application/templates/bundles/SyliusShopBundle diff --git a/src/Controller/PayWithPayPalFormAction.php b/src/Controller/PayWithPayPalFormAction.php deleted file mode 100644 index 8e2ace2c..00000000 --- a/src/Controller/PayWithPayPalFormAction.php +++ /dev/null @@ -1,82 +0,0 @@ -twig = $twig; - $this->paymentRepository = $paymentRepository; - $this->countriesProvider = $countriesProvider; - $this->authorizeClientApi = $authorizeClientApi; - $this->identityApi = $identityApi; - } - - public function __invoke(Request $request): Response - { - /** @var PaymentInterface $payment */ - $payment = $this->paymentRepository->find($request->attributes->get('id')); - /** @var PaymentMethodInterface $paymentMethod */ - $paymentMethod = $payment->getMethod(); - - /** @var GatewayConfigInterface $gatewayConfig */ - $gatewayConfig = $paymentMethod->getGatewayConfig(); - /** @var string $clientId */ - $clientId = $gatewayConfig->getConfig()['client_id']; - /** @var string $partnerAttributionId */ - $partnerAttributionId = $gatewayConfig->getConfig()['partner_attribution_id']; - - /** @var OrderInterface $order */ - $order = $payment->getOrder(); - - $token = $this->authorizeClientApi->authorize($paymentMethod); - $clientToken = $this->identityApi->generateToken($token); - - return new Response($this->twig->render('@SyliusPayPalPlugin/payWithPaypal.html.twig', [ - 'available_countries' => $this->countriesProvider->provide(), - 'billing_address' => $order->getBillingAddress(), - 'client_id' => $clientId, - 'client_token' => $clientToken, - 'currency' => $order->getCurrencyCode(), - 'locale' => $request->getLocale(), - 'merchant_id' => $gatewayConfig->getConfig()['merchant_id'], - 'order_token' => $order->getTokenValue(), - 'partner_attribution_id' => $partnerAttributionId, - ])); - } -} diff --git a/src/Resources/config/services/controller.xml b/src/Resources/config/services/controller.xml index bb87fd4f..b10f3c3f 100644 --- a/src/Resources/config/services/controller.xml +++ b/src/Resources/config/services/controller.xml @@ -87,14 +87,6 @@ - - - - - - - - diff --git a/src/Resources/config/shop_routing.yaml b/src/Resources/config/shop_routing.yaml index 149671ee..7bccdda7 100644 --- a/src/Resources/config/shop_routing.yaml +++ b/src/Resources/config/shop_routing.yaml @@ -1,9 +1,3 @@ -sylius_paypal_plugin_pay_with_paypal_form: - path: /pay-with-paypal/{id} - methods: [GET] - defaults: - _controller: Sylius\PayPalPlugin\Controller\PayWithPayPalFormAction - sylius_paypal_plugin_create_paypal_order: path: /create-pay-pal-order/{id} methods: [POST] diff --git a/tests/Application/templates/bundles/SyliusAdminBundle b/tests/Application/templates/bundles/SyliusAdminBundle deleted file mode 120000 index bc0b81e1..00000000 --- a/tests/Application/templates/bundles/SyliusAdminBundle +++ /dev/null @@ -1 +0,0 @@ -/Users/dominik/PayPalPlugin/src/Resources/views/bundles/SyliusAdminBundle \ No newline at end of file diff --git a/tests/Application/templates/bundles/SyliusShopBundle b/tests/Application/templates/bundles/SyliusShopBundle deleted file mode 120000 index 42780a13..00000000 --- a/tests/Application/templates/bundles/SyliusShopBundle +++ /dev/null @@ -1 +0,0 @@ -/Users/dominik/PayPalPlugin/src/Resources/views/bundles/SyliusShopBundle \ No newline at end of file