Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 6 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function handle(YandexCheckoutService $yandexCheckoutService): void |
||
31 | { |
||
32 | if ($paymentId = $this->argument('paymentId')) { |
||
33 | $payment = YandexCheckout::where('payment_id', $paymentId)->firstOrFail(); |
||
34 | |||
35 | $yandexCheckoutService->paymentInfo($payment); |
||
36 | |||
37 | $this->output->success("Finished checking Yandex Checkout with payment ID: {$paymentId}"); |
||
38 | |||
39 | return; |
||
40 | } |
||
41 | |||
42 | $pendingCheckouts = YandexCheckout::pending()->get(); |
||
43 | $progressBar = $this->output->createProgressBar($pendingCheckouts->count()); |
||
44 | $progressBar->start(); |
||
45 | |||
46 | foreach ($pendingCheckouts as $yandexCheckout) { |
||
47 | $yandexCheckoutService->paymentInfo($yandexCheckout); |
||
48 | $progressBar->advance(); |
||
49 | } |
||
50 | |||
51 | $progressBar->finish(); |
||
52 | $this->output->success('Finished checking all pending Yandex Checkouts'); |
||
53 | } |
||
55 |