Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions config/routes/routes_shop.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use CommerceWeavers\SyliusTpayPlugin\Controller\DisplayPaymentFailedPageAction;
use CommerceWeavers\SyliusTpayPlugin\Controller\DisplayThankYouPageAction;
use CommerceWeavers\SyliusTpayPlugin\Controller\DisplayWaitingForPaymentPage;
use CommerceWeavers\SyliusTpayPlugin\Controller\RetryPaymentAction;
use CommerceWeavers\SyliusTpayPlugin\Routing;
use Symfony\Component\HttpFoundation\Request;

Expand All @@ -17,11 +16,6 @@
->methods([Request::METHOD_GET])
;

$routes->add(Routing::SHOP_RETRY_PAYMENT, Routing::SHOP_RETRY_PAYMENT_PATH)
->controller(RetryPaymentAction::class)
->methods([Request::METHOD_POST])
;

$routes->add(Routing::SHOP_THANK_YOU, Routing::SHOP_THANK_YOU_PATH)
->controller(DisplayThankYouPageAction::class)
->methods([Request::METHOD_GET])
Expand Down
12 changes: 0 additions & 12 deletions config/services/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use CommerceWeavers\SyliusTpayPlugin\Controller\DisplayThankYouPageAction;
use CommerceWeavers\SyliusTpayPlugin\Controller\DisplayWaitingForPaymentPage;
use CommerceWeavers\SyliusTpayPlugin\Controller\PaymentNotificationAction;
use CommerceWeavers\SyliusTpayPlugin\Controller\RetryPaymentAction;
use CommerceWeavers\SyliusTpayPlugin\Controller\TpayGetChannelsAction;
use CommerceWeavers\SyliusTpayPlugin\Controller\TpayNotificationAction;

Expand Down Expand Up @@ -52,17 +51,6 @@
->tag('controller.service_arguments')
;

$services->set(RetryPaymentAction::class)
->args([
service('security.csrf.token_manager'),
service('sylius.command_bus'),
service('sylius.repository.order'),
service('router'),
service('request_stack'),
])
->tag('controller.service_arguments')
;

$services->set(TpayNotificationAction::class)
->args([
service('commerce_weavers_sylius_tpay.tpay.security.notification.verifier.signature'),
Expand Down
92 changes: 0 additions & 92 deletions src/Controller/RetryPaymentAction.php

This file was deleted.

4 changes: 0 additions & 4 deletions src/Routing.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ final class Routing

public const SHOP_PAYMENT_FAILED_PATH = '/tpay/order/{orderToken}/payment-failed';

public const SHOP_RETRY_PAYMENT = 'commerce_weavers_sylius_tpay_retry_payment';

public const SHOP_RETRY_PAYMENT_PATH = '/tpay/order/{orderToken}/retry-payment';

public const SHOP_THANK_YOU = 'commerce_weavers_sylius_tpay_thank_you';

public const SHOP_THANK_YOU_PATH = '/tpay/order/{orderToken}/thank-you';
Expand Down
9 changes: 3 additions & 6 deletions templates/shop/cart/complete/payment_failed.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@
</div>

<div class="mt-4">
<form action="{{ path(constant('CommerceWeavers\\SyliusTpayPlugin\\Routing::SHOP_RETRY_PAYMENT'), {'orderToken': order.tokenValue}) }}" method="post" novalidate>
<input type="hidden" name="_csrf_token" value="{{ csrf_token(order.tokenValue) }}" />
<button type="submit" class="btn btn-primary">
<i class="fas fa-undo me-2"></i>{{ 'commerce_weavers_sylius_tpay.shop.payment_failed.retry_payment'|trans }}
</button>
</form>
<a href="{{ path('sylius_shop_order_show', {'tokenValue': order.tokenValue}) }}" class="btn btn-primary">
<i class="fas fa-undo me-2"></i>{{ 'commerce_weavers_sylius_tpay.shop.payment_failed.retry_payment'|trans }}
</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion tests/E2E/Helper/Order/RetryPaymentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public function showPaymentFailedPage(string $orderToken): void

public function retryPayment(): void
{
$this->client->submitForm('Retry payment');
$this->client->clickLink('Retry payment');
}
}
3 changes: 1 addition & 2 deletions tests/E2E/Shop/RetryPayment/RetryingPaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function test_it_retries_payment(): void
$this->retryPayment();

$this->assertPageTitleContains('Summary of your order');
$this->assertSelectorWillContain('.alert', 'The previous payment has been cancelled');
}

public function test_it_prevents_retrying_not_qualifying_payments(): void
Expand All @@ -41,6 +40,6 @@ public function test_it_prevents_retrying_not_qualifying_payments(): void
$this->showPaymentFailedPage('t0k3n');
$this->retryPayment();

$this->assertSelectorWillContain('.alert', 'This payment cannot be retried');
$this->assertPageTitleContains('Summary of your order');
}
}
4 changes: 0 additions & 4 deletions translations/flashes.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ commerce_weavers_sylius_tpay:
admin:
payment_method:
image_has_been_removed: 'Payment method image has been removed'
shop:
retry_payment:
cannot_be_retried: 'This payment cannot be retried'
previous_payment_cancelled: 'The previous payment has been cancelled'
4 changes: 0 additions & 4 deletions translations/flashes.pl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ commerce_weavers_sylius_tpay:
admin:
payment_method:
image_has_been_removed: 'Logo metody płatności zostało usunięte'
shop:
retry_payment:
cannot_be_retried: 'Wybrana płatność nie może być ponowiona'
previous_payment_cancelled: 'Poprzednia płatność została anulowana'
Loading