Completed
Push — master ( 9bb41e...bd50f4 )
by Orkhan
01:11
created

ResultCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Orkhanahmadov\LaravelGoldenpay\Commands;
4
5
use Illuminate\Console\Command;
6
use Orkhanahmadov\LaravelGoldenpay\Goldenpay;
7
use Orkhanahmadov\LaravelGoldenpay\Models\Payment;
8
9
class ResultCommand extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'goldenpay:result {paymentKey?}';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Checks payment result for given or all pending payments';
24
25
    /**
26
     * Execute the console command.
27
     *
28
     * @param Goldenpay $goldenpay
29
     */
30
    public function handle(Goldenpay $goldenpay): void
31
    {
32
        $payment = Payment::wherePaymentKey($this->argument('paymentKey'))->firstOrFail();
33
34
        $goldenpay->result($payment);
35
    }
36
}
37