Completed
Pull Request — master (#1)
by Dmitry
02:28
created

Invoice::getClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace hiqdev\php\merchant;
4
5
use Money\Currency;
6
use Money\Money;
7
8
/**
9
 * Class Invoice.
10
 *
11
 * Many methods depend on [[amount]], so make sure to set as early as possible.
12
 *
13
 * @author Dmytro Naumenko <[email protected]>
14
 */
15
final class Invoice implements InvoiceInterface
16
{
17
    protected $id;
18
    protected $client;
19
    protected $amount;
20
    protected $description;
21
    protected $returnUrl;
22
    protected $notifyUrl;
23
    protected $cancelUrl;
24
    protected $returnMethod;
25
    protected $notifyMethod;
26
    protected $cancelMethod;
27
    protected $currency;
28
29
    /**
30
     * @return string
31
     */
32
    public function getId()
33
    {
34
        return $this->id;
35
    }
36
37
    /**
38
     * @param string $id
39
     * @return Invoice
40 1
     */
41
    public function setId($id)
42 1
    {
43
        $this->id = (string)$id;
44
45
        return $this;
46
    }
47
48
    public function getClient()
49 1
    {
50
        return $this->client;
51 1
    }
52
53 1
    public function setClient($client)
54
    {
55
        $this->client = (string)$client;
56 1
57
        return $this;
58 1
    }
59
60
    public function getAmount(): Money
61 1
    {
62
        return $this->amount;
63 1
    }
64
65 1
    public function setAmount(Money $amount)
66
    {
67
        $this->amount = $amount;
68
        $this->currency = $amount->getCurrency();
69
70
        return $this;
71
    }
72
73
    public function getDescription()
74
    {
75
        return $this->description;
76
    }
77
78
    public function setDescription($description)
79
    {
80
        $this->description = (string)$description;
81
82
        return $this;
83
    }
84
85
    public function getReturnUrl()
86
    {
87
        return $this->returnUrl;
88
    }
89
90
    public function setReturnUrl($returnUrl)
91
    {
92
        $this->returnUrl = $returnUrl;
93
94
        return $this;
95
    }
96
97
    public function getNotifyUrl()
98
    {
99
        return $this->notifyUrl;
100
    }
101
102
    public function setNotifyUrl($notifyUrl)
103
    {
104
        $this->notifyUrl = $notifyUrl;
105
106
        return $this;
107
    }
108
109
    public function getCancelUrl()
110
    {
111
        return $this->cancelUrl;
112
    }
113
114
    public function setCancelUrl($cancelUrl)
115
    {
116
        $this->cancelUrl = $cancelUrl;
117
118
        return $this;
119
    }
120
121
    /**
122
     * @return Currency
123
     */
124
    public function getCurrency(): Currency
125
    {
126
        return $this->currency;
127
    }
128
129
    /**
130
     * @return string
131
     */
132
    public function getReturnMethod()
133
    {
134
        return $this->returnMethod;
135
    }
136
137
    /**
138
     * @param string $returnMethod
139
     * @return InvoiceInterface
140
     */
141
    public function setReturnMethod($returnMethod)
142
    {
143
        $this->returnMethod = $returnMethod;
144
145
        return $this;
146
    }
147
148
    /**
149
     * @return string
150
     */
151
    public function getNotifyMethod()
152
    {
153
        return $this->notifyMethod;
154
    }
155
156
    /**
157
     * @param string $notifyMethod
158
     * @return InvoiceInterface
159
     */
160
    public function setNotifyMethod($notifyMethod)
161
    {
162
        $this->notifyMethod = $notifyMethod;
163
164
        return $this;
165
    }
166
167
    /**
168
     * @return string
169
     */
170
    public function getCancelMethod()
171
    {
172
        return $this->cancelMethod;
173
    }
174
175
    /**
176
     * @param string $cancelMethod
177
     * @return InvoiceInterface
178
     */
179
    public function setCancelMethod($cancelMethod)
180
    {
181
        $this->cancelMethod = $cancelMethod;
182
183
        return $this;
184
    }
185
}
186