Completed
Push — master ( 374367...b950ab )
by Vladimir
09:30
created

PaymentStatusByCfResponse::setExtendedStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AcquiroPay\Gateway\Responses;
6
7
use Carbon\Carbon;
8
use Illuminate\Contracts\Support\Arrayable;
9
10
class PaymentStatusByCfResponse implements Arrayable
11
{
12
    private $paymentId;
13
    private $status;
14
    private $extendedId;
15
    private $extendedStatus;
16
    private $transactionStatus;
17
    private $datetime;
18
    private $duplicate;
19
    private $additional;
20
21
    public function getPaymentId(): ?string
22
    {
23
        return $this->paymentId;
24
    }
25
26
    public function setPaymentId(string $paymentId): PaymentStatusByCfResponse
27
    {
28
        $this->paymentId = $paymentId;
29
30
        return $this;
31
    }
32
33
    public function getStatus(): ?string
34
    {
35
        return $this->status;
36
    }
37
38
    public function setStatus(string $status): PaymentStatusByCfResponse
39
    {
40
        $this->status = $status;
41
42
        return $this;
43
    }
44
45
    public function getExtendedId(): ?string
46
    {
47
        return $this->extendedId;
48
    }
49
50
    public function setExtendedId(string $extendedId): PaymentStatusByCfResponse
51
    {
52
        $this->extendedId = $extendedId;
53
54
        return $this;
55
    }
56
57
    public function getExtendedStatus(): ?string
58
    {
59
        return $this->extendedStatus;
60
    }
61
62
    public function setExtendedStatus(string $extendedStatus): PaymentStatusByCfResponse
63
    {
64
        $this->extendedStatus = $extendedStatus;
65
66
        return $this;
67
    }
68
69
    public function getTransactionStatus(): ?string
70
    {
71
        return $this->transactionStatus;
72
    }
73
74
    public function setTransactionStatus(string $transactionStatus): PaymentStatusByCfResponse
75
    {
76
        $this->transactionStatus = $transactionStatus;
77
78
        return $this;
79
    }
80
81
    public function getDatetime(): ?Carbon
82
    {
83
        return $this->datetime;
84
    }
85
86
    public function setDatetime(string $datetime): PaymentStatusByCfResponse
87
    {
88
        $this->datetime = Carbon::parse($datetime);
89
90
        return $this;
91
    }
92
93
    public function getDuplicate(): bool
94
    {
95
        return $this->duplicate;
96
    }
97
98
    public function setDuplicate(string $duplicate): PaymentStatusByCfResponse
99
    {
100
        $this->duplicate = $duplicate === 'true';
101
102
        return $this;
103
    }
104
105
    public function getAdditional(): ?array
106
    {
107
        return $this->additional;
108
    }
109
110
    public function setAdditional(array $additional): PaymentStatusByCfResponse
111
    {
112
        $this->additional = $additional;
113
114
        return $this;
115
    }
116
117
    /**
118
     * Get the instance as an array.
119
     *
120
     * @return array
121
     */
122
    public function toArray(): array
123
    {
124
        return [
125
            'payment_id' => $this->paymentId,
126
            'status' => $this->status,
127
            'extended_id' => $this->extendedId,
128
            'extended_status' => $this->extendedStatus,
129
            'transaction_status' => $this->transactionStatus,
130
            'datetime' => $this->datetime,
131
            'duplicate' => $this->duplicate,
132
            'additional' => $this->additional,
133
        ];
134
    }
135
}