Skip to content

Commit 2dc15ab

Browse files
tomkalonNoResponseMate
authored andcommitted
CancelPayPalOrderAction has been fixed
1 parent 18749c2 commit 2dc15ab

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/Controller/CancelPayPalOrderAction.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace Sylius\PayPalPlugin\Controller;
1515

16-
use Sylius\Component\Core\Model\OrderInterface;
1716
use Sylius\Component\Core\Repository\OrderRepositoryInterface;
1817
use Sylius\PayPalPlugin\Provider\FlashBagProvider;
1918
use Sylius\PayPalPlugin\Provider\PaymentProviderInterface;
@@ -46,19 +45,6 @@ public function __construct(
4645

4746
public function __invoke(Request $request): Response
4847
{
49-
/**
50-
* @var string $content
51-
*/
52-
$content = $request->getContent();
53-
54-
$content = (array) json_decode($content, true);
55-
56-
$payment = $this->paymentProvider->getByPayPalOrderId((string) $content['payPalOrderId']);
57-
58-
/** @var OrderInterface $order */
59-
$order = $payment->getOrder();
60-
$this->orderRepository->remove($order);
61-
6248
FlashBagProvider::getFlashBag($this->flashBagOrRequestStack)->add('success', 'sylius.pay_pal.order_cancelled');
6349

6450
return new Response('', Response::HTTP_NO_CONTENT);

0 commit comments

Comments
 (0)