Skip to content

Commit ff9ec45

Browse files
committed
[Maintenance] Add attribute to Command
1 parent b1e92cf commit ff9ec45

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

UPGRADE-2.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454

5555
1. The definition of `Http\Discovery\Psr18Client` has been removed, use `sylius.http_client` service instead.
5656

57+
1. The command `sylius:pay-pal-plugin:complete-payments` has been changed to `sylius-paypal:complete-payments`.
58+
5759
1. Aliases introduced in PayPalPlugin 1.7 have now become the primary service IDs in PayPalPlugin 2.0.
5860
The old service IDs have been removed, and all references must be updated accordingly:
5961

config/services.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
<argument type="service" id="sylius_paypal.api.cache_authorize_client" />
267267
<argument type="service" id="sylius_paypal.api.order_details" />
268268
<argument type="service" id="sylius_abstraction.state_machine" />
269-
<tag name="console.command" command="sylius:pay-pal-plugin:complete-payments" />
269+
<tag name="console.command" />
270270
</service>
271271

272272
<service

docs/processing-payments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Processing payments
22

3-
Plugin provides `sylius:pay-pal-plugin:complete-payments` command, that should be configured as cron job on the server.
3+
Plugin provides `sylius-paypal:complete-payments` command, that should be configured as cron job on the server.
44
It iterates over processing PayPal payments and completes them if the order is completed in PayPal.
55

66
---

src/Console/Command/CompletePaidPaymentsCommand.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@
2424
use Sylius\PayPalPlugin\Api\OrderDetailsApiInterface;
2525
use Sylius\PayPalPlugin\DependencyInjection\SyliusPayPalExtension;
2626
use Sylius\PayPalPlugin\Payum\Action\StatusAction;
27+
use Symfony\Component\Console\Attribute\AsCommand;
2728
use Symfony\Component\Console\Command\Command;
2829
use Symfony\Component\Console\Input\InputInterface;
2930
use Symfony\Component\Console\Output\OutputInterface;
3031

32+
#[AsCommand(
33+
name: 'sylius-paypal:complete-payments',
34+
description: 'Completes payments for completed PayPal orders',
35+
)]
3136
final class CompletePaidPaymentsCommand extends Command
3237
{
3338
public function __construct(
@@ -40,14 +45,6 @@ public function __construct(
4045
parent::__construct();
4146
}
4247

43-
protected function configure(): void
44-
{
45-
$this
46-
->setName('sylius:pay-pal-plugin:complete-payments')
47-
->setDescription('Completes payments for completed PayPal orders')
48-
;
49-
}
50-
5148
protected function execute(InputInterface $input, OutputInterface $output): int
5249
{
5350
$payments = $this->paymentRepository->findBy(['state' => PaymentInterface::STATE_PROCESSING]);

0 commit comments

Comments
 (0)