Skip to content

Commit cfba608

Browse files
committed
OP-367 Added ECS fixes
1 parent 92dddd1 commit cfba608

6 files changed

Lines changed: 16 additions & 21 deletions

File tree

src/Exception/PayUResponseException.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
namespace BitBag\SyliusPayUPlugin\Exception;
1212

1313
use Exception;
14-
use Payum\Core\Exception\Http\HttpException;
15-
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
1614

1715
final class PayUResponseException extends Exception
1816
{

tests/Behat/Context/Setup/PayUContext.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(
4444
SharedStorageInterface $sharedStorage,
4545
PaymentMethodRepositoryInterface $paymentMethodRepository,
4646
ExampleFactoryInterface $paymentMethodExampleFactory,
47-
ObjectManager $paymentMethodManager
47+
ObjectManager $paymentMethodManager,
4848
) {
4949
$this->sharedStorage = $sharedStorage;
5050
$this->paymentMethodRepository = $paymentMethodRepository;
@@ -57,7 +57,7 @@ public function __construct(
5757
*/
5858
public function theStoreHasAPaymentMethodWithACodeAndPayuCheckoutGateway(
5959
string $paymentMethodName,
60-
string $paymentMethodCode
60+
string $paymentMethodCode,
6161
): void {
6262
$paymentMethod = $this->createPaymentMethod($paymentMethodName, $paymentMethodCode, 'PayU Checkout');
6363
$paymentMethod->getGatewayConfig()->setConfig(
@@ -68,7 +68,7 @@ public function theStoreHasAPaymentMethodWithACodeAndPayuCheckoutGateway(
6868
'oauth_client_id' => 'CLIENT_ID',
6969
'oauth_client_secret' => 'SECRET',
7070
'payum.http_client' => '@sylius.payum.http_client',
71-
]
71+
],
7272
);
7373
$this->paymentMethodManager->persist($paymentMethod);
7474
$this->paymentMethodManager->flush();
@@ -79,7 +79,7 @@ private function createPaymentMethod(
7979
string $code,
8080
string $description = '',
8181
bool $addForCurrentChannel = true,
82-
?int $position = null
82+
?int $position = null,
8383
): PaymentMethodInterface {
8484
/** @var PaymentMethodInterface $paymentMethod */
8585
$paymentMethod = $this->paymentMethodExampleFactory->create(
@@ -92,7 +92,7 @@ private function createPaymentMethod(
9292
'enabled' => true,
9393
'channels' => ($addForCurrentChannel && $this->sharedStorage->has('channel'))
9494
? [$this->sharedStorage->get('channel')] : [],
95-
]
95+
],
9696
);
9797

9898
if (null !== $position) {

tests/Behat/Context/Ui/PayUContext.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(
3636
PayUApiMocker $payUApiMocker,
3737
ShowPageInterface $orderDetails,
3838
CompletePageInterface $summaryPage,
39-
PayUCheckoutPageInterface $payUCheckoutPage
39+
PayUCheckoutPageInterface $payUCheckoutPage,
4040
) {
4141
$this->orderDetails = $orderDetails;
4242
$this->summaryPage = $summaryPage;
@@ -53,7 +53,7 @@ public function iConfirmMyOrderWithPayUPayment(): void
5353
$this->payUApiMocker->mockApiSuccessfulPaymentResponse(
5454
function () {
5555
$this->summaryPage->confirmOrder();
56-
}
56+
},
5757
);
5858
}
5959

@@ -65,7 +65,7 @@ public function iSignInToPayUAndPaySuccessfully(): void
6565
$this->payUApiMocker->completedPayment(
6666
function () {
6767
$this->payUCheckoutPage->pay();
68-
}
68+
},
6969
);
7070
}
7171

@@ -78,7 +78,7 @@ public function iCancelMyPayUPayment(): void
7878
$this->payUApiMocker->canceledPayment(
7979
function () {
8080
$this->payUCheckoutPage->cancel();
81-
}
81+
},
8282
);
8383
}
8484

@@ -90,7 +90,7 @@ public function iTryToPayAgainWithPayUPayment(): void
9090
$this->payUApiMocker->mockApiSuccessfulPaymentResponse(
9191
function () {
9292
$this->orderDetails->pay();
93-
}
93+
},
9494
);
9595
}
9696
}

tests/Behat/Mocker/OpenPyUBridge.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function setAuthorizationData(
3131
string $signatureKey,
3232
string $posId,
3333
string $clientId,
34-
string $clientSecret
34+
string $clientSecret,
3535
): void {
3636
$this->container
3737
->get('bitbag.payu_plugin.bridge.open_payu')
@@ -40,7 +40,7 @@ public function setAuthorizationData(
4040
$signatureKey,
4141
$posId,
4242
$clientId,
43-
$clientSecret
43+
$clientSecret,
4444
)
4545
;
4646
}

tests/Behat/Mocker/PayUApiMocker.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function completedPayment(callable $action): void
4444
->mockService('bitbag.payu_plugin.bridge.open_payu', OpenPayUBridgeInterface::class);
4545

4646
$service->shouldReceive('retrieve')->andReturn(
47-
$this->getDataRetrieve(OpenPayUBridge::COMPLETED_API_STATUS)
47+
$this->getDataRetrieve(OpenPayUBridge::COMPLETED_API_STATUS),
4848
);
4949
$service->shouldReceive('create')->andReturn($this->createResponseSuccessfulApi());
5050
$service->shouldReceive('setAuthorizationData');
@@ -60,7 +60,7 @@ public function canceledPayment(callable $action): void
6060
->mockService('bitbag.payu_plugin.bridge.open_payu', OpenPayUBridgeInterface::class);
6161

6262
$service->shouldReceive('retrieve')->andReturn(
63-
$this->getDataRetrieve(OpenPayUBridge::CANCELED_API_STATUS)
63+
$this->getDataRetrieve(OpenPayUBridge::CANCELED_API_STATUS),
6464
);
6565
$service->shouldReceive('create')->andReturn($this->createResponseSuccessfulApi());
6666
$service->shouldReceive('setAuthorizationData');
@@ -70,9 +70,6 @@ public function canceledPayment(callable $action): void
7070
$this->mocker->unmockAll();
7171
}
7272

73-
/**
74-
* @param $statusPayment
75-
*/
7673
private function getDataRetrieve($statusPayment): OpenPayU_Result
7774
{
7875
$openPayUResult = new OpenPayU_Result();

tests/Behat/Page/External/PayUCheckoutPage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public function __construct(Session $session, $parameters, RepositoryInterface $
3131
}
3232

3333
/**
34-
* {@inheritdoc}
34+
* @inheritdoc
3535
*/
3636
public function pay()
3737
{
3838
$this->getDriver()->visit($this->findCaptureToken()->getTargetUrl());
3939
}
4040

4141
/**
42-
* {@inheritdoc}
42+
* @inheritdoc
4343
*/
4444
public function cancel()
4545
{

0 commit comments

Comments
 (0)