Skip to content

Commit 5d34563

Browse files
Merge pull request #321 from Wojdylak/SYL-4154-pay-pal-plugin-2.0-translations
[Maintenance] Change translation key and configuration root key
2 parents 1a9f55c + a4e0b8c commit 5d34563

32 files changed

+147
-144
lines changed

UPGRADE-2.0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
1. The minimum supported version of PHP has been increased to 8.2.
88

9+
1. The configuration root node has been changed from `sylius_pay_pal` to `sylius_paypal`.
10+
11+
1. The translations' prefix has been changed from `sylius.pay_pal` to `sylius_paypal`.
12+
913
1. The route `sylius_paypal_plugin_create_paypal_order_from_product` has been removed and replaced with the `AddToCartFormComponent`.
1014

1115
1. The directories structure has been updated to the current Symfony recommendations:

config/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ sylius_grid:
3030
type: enable_seller
3131
download_report:
3232
type: download_report
33-
label: sylius.pay_pal.report
33+
label: sylius_paypal.report
3434
icon: tabler:download
3535
options:
3636
link:

config/services.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
<service id="sylius_paypal.form.extension.payment_method" class="Sylius\PayPalPlugin\Form\Extension\PaymentMethodTypeExtension">
3030
<tag name="form.type_extension" />
3131
</service>
32-
<service id="sylius_paypal.form.extension.payment_method" alias="Sylius\PayPalPlugin\Form\Extension\PaymentMethodTypeExtension" />
3332

3433
<service id="sylius_paypal.form.type.paypal_configuration" class="Sylius\PayPalPlugin\Form\Type\PayPalConfigurationType">
35-
<tag name="sylius.gateway_configuration_type" type="sylius.pay_pal" label="sylius.pay_pal.label" />
34+
<tag name="sylius.gateway_configuration_type" type="sylius.pay_pal" label="sylius_paypal.label" />
3635
</service>
3736

3837
<service

docs/sandbox-vs-live.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ By default, plugin operates in the sandbox mode. I means all the transactions wo
44
To change it, you need to configure the plugin properly:
55

66
```yaml
7-
sylius_pay_pal:
7+
sylius_paypal:
88
sandbox: false
99
```
1010
11-
You can, for example, configure it only for the production environment (e.g. in `config/packages/prod/sylius_pay_pal_plugin.yaml`).
11+
You can, for example, configure it only for the production environment (e.g. in `config/packages/prod/sylius_paypal.yaml`).
1212

1313
---
1414

phpstan.neon.dist

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,3 @@ parameters:
1919
# Test dependencies
2020
- 'tests/Application/app/**.php'
2121
- 'tests/Application/src/**.php'
22-
23-
# Classes using SyliusResourceBundle classes, with namespaces changing across versions
24-
- 'src/Factory/PayPalPaymentMethodNewResourceFactory.php'
25-
26-
ignoreErrors:
27-
- '/Call to an undefined method Sylius\\Component\\Core\\Repository\\PaymentRepositoryInterface\:\:createQueryBuilder\(\)\./'

spec/Listener/PayPalPaymentMethodListenerSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function it_redirects_with_error_if_the_pay_pal_payment_method_already_exists(
9191
$paymentMethod->getGatewayConfig()->willReturn($gatewayConfig);
9292
$gatewayConfig->getFactoryName()->willReturn('sylius.pay_pal');
9393

94-
$flashBag->add('error', 'sylius.pay_pal.more_than_one_seller_not_allowed')->shouldBeCalled();
94+
$flashBag->add('error', 'sylius_paypal.more_than_one_seller_not_allowed')->shouldBeCalled();
9595
$session->getBag('flashes')->willReturn($flashBag);
9696
$requestStack->getSession()->willReturn($session);
9797

src/Controller/CancelPayPalCheckoutPaymentAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __invoke(Request $request): Response
4040

4141
/** @var FlashBagInterface $flashBag */
4242
$flashBag = $request->getSession()->getBag('flashes');
43-
$flashBag->add('error', 'sylius.pay_pal.something_went_wrong');
43+
$flashBag->add('error', 'sylius_paypal.something_went_wrong');
4444

4545
$this->paymentStateManager->cancel($payment);
4646

src/Controller/CancelPayPalOrderAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __invoke(Request $request): Response
4545
$order = $payment->getOrder();
4646
$this->orderRepository->remove($order);
4747

48-
FlashBagProvider::getFlashBag($this->flashBagOrRequestStack)->add('success', 'sylius.pay_pal.order_cancelled');
48+
FlashBagProvider::getFlashBag($this->flashBagOrRequestStack)->add('success', 'sylius_paypal.order_cancelled');
4949

5050
return new Response('', Response::HTTP_NO_CONTENT);
5151
}

src/Controller/CancelPayPalPaymentAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __invoke(Request $request): Response
5555
$this->objectManager->flush();
5656

5757
FlashBagProvider::getFlashBag($this->flashBagOrRequestStack)
58-
->add('success', 'sylius.pay_pal.payment_cancelled')
58+
->add('success', 'sylius_paypal.payment_cancelled')
5959
;
6060

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

src/Controller/CreatePayPalOrderFromCartAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __invoke(Request $request): Response
4545
} catch (GuzzleException $exception) {
4646
/** @var FlashBagInterface $flashBag */
4747
$flashBag = $request->getSession()->getBag('flashes');
48-
$flashBag->add('error', 'sylius.pay_pal.something_went_wrong');
48+
$flashBag->add('error', 'sylius_paypal.something_went_wrong');
4949

5050
return new JsonResponse([], Response::HTTP_BAD_REQUEST);
5151
}

0 commit comments

Comments
 (0)