|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Getnet\API; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class BoletoResponse |
|
7
|
|
|
* |
|
8
|
|
|
* @package Getnet\API |
|
9
|
|
|
*/ |
|
10
|
|
|
class BoletoResponse extends BaseResponse |
|
11
|
|
|
{ |
|
12
|
|
|
/** @var */ |
|
13
|
|
|
public $boleto_id; |
|
14
|
|
|
|
|
15
|
|
|
/** @var */ |
|
16
|
|
|
public $bank; |
|
17
|
|
|
|
|
18
|
|
|
/** @var */ |
|
19
|
|
|
public $status_label; |
|
20
|
|
|
|
|
21
|
|
|
/** @var */ |
|
22
|
|
|
public $typeful_line; |
|
23
|
|
|
|
|
24
|
|
|
/** @var */ |
|
25
|
|
|
public $bar_code; |
|
26
|
|
|
|
|
27
|
|
|
/** @var */ |
|
28
|
|
|
public $issue_date; |
|
29
|
|
|
|
|
30
|
|
|
/** @var */ |
|
31
|
|
|
public $expiration_date; |
|
32
|
|
|
|
|
33
|
|
|
/** @var */ |
|
34
|
|
|
public $our_number; |
|
35
|
|
|
|
|
36
|
|
|
/** @var */ |
|
37
|
|
|
public $document_number; |
|
38
|
|
|
|
|
39
|
|
|
/** @var */ |
|
40
|
|
|
public $boleto_pdf; |
|
41
|
|
|
|
|
42
|
|
|
/** @var */ |
|
43
|
|
|
public $boleto_html; |
|
44
|
|
|
|
|
45
|
|
|
/** @var */ |
|
46
|
|
|
private $base_url; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @param $base_url |
|
50
|
|
|
* @return $this |
|
51
|
|
|
*/ |
|
52
|
|
|
public function setBaseUrl($base_url) |
|
53
|
|
|
{ |
|
54
|
|
|
$this->base_url = $base_url; |
|
55
|
|
|
|
|
56
|
|
|
return $this; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @return void |
|
61
|
|
|
*/ |
|
62
|
|
|
public function generateLinks() |
|
63
|
|
|
{ |
|
64
|
|
|
if ($this->getPaymentId()) { |
|
65
|
|
|
$this->boleto_pdf = $this->base_url."/v1/payments/boleto/".$this->getPaymentId()."/pdf"; |
|
66
|
|
|
$this->boleto_html = $this->base_url."/v1/payments/boleto/".$this->getPaymentId()."/html"; |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @return mixed |
|
72
|
|
|
*/ |
|
73
|
|
|
public function getBoletoPdf() |
|
74
|
|
|
{ |
|
75
|
|
|
return $this->boleto_pdf; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* @return mixed |
|
80
|
|
|
*/ |
|
81
|
|
|
public function getBoletoHtml() |
|
82
|
|
|
{ |
|
83
|
|
|
return $this->boleto_html; |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @return mixed |
|
88
|
|
|
*/ |
|
89
|
|
|
public function getDocumentNumber() |
|
90
|
|
|
{ |
|
91
|
|
|
return $this->document_number; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* @param mixed $document_number |
|
96
|
|
|
* @return BoletoResponse |
|
97
|
|
|
*/ |
|
98
|
|
|
public function setDocumentNumber($document_number) |
|
99
|
|
|
{ |
|
100
|
|
|
$this->document_number = $document_number; |
|
101
|
|
|
|
|
102
|
|
|
return $this; |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
/** |
|
106
|
|
|
* @return mixed |
|
107
|
|
|
*/ |
|
108
|
|
|
public function getDescription() |
|
109
|
|
|
{ |
|
110
|
|
|
return $this->description; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* @param mixed $description |
|
115
|
|
|
* @return BaseResponse |
|
116
|
|
|
*/ |
|
117
|
|
|
public function setDescription($description) |
|
118
|
|
|
{ |
|
119
|
|
|
$this->description = $description; |
|
120
|
|
|
|
|
121
|
|
|
return $this; |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
/** |
|
125
|
|
|
* @return mixed |
|
126
|
|
|
*/ |
|
127
|
|
|
public function getBoletoId() |
|
128
|
|
|
{ |
|
129
|
|
|
return $this->boleto_id; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
/** |
|
133
|
|
|
* @param mixed $boleto_id |
|
134
|
|
|
* @return BoletoResponse |
|
135
|
|
|
*/ |
|
136
|
|
|
public function setBoletoId($boleto_id) |
|
137
|
|
|
{ |
|
138
|
|
|
$this->boleto_id = $boleto_id; |
|
139
|
|
|
|
|
140
|
|
|
return $this; |
|
141
|
|
|
} |
|
142
|
|
|
|
|
143
|
|
|
/** |
|
144
|
|
|
* @return mixed |
|
145
|
|
|
*/ |
|
146
|
|
|
public function getBank() |
|
147
|
|
|
{ |
|
148
|
|
|
return $this->bank; |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
/** |
|
152
|
|
|
* @param mixed $bank |
|
153
|
|
|
* @return BoletoResponse |
|
154
|
|
|
*/ |
|
155
|
|
|
public function setBank($bank) |
|
156
|
|
|
{ |
|
157
|
|
|
$this->bank = $bank; |
|
158
|
|
|
|
|
159
|
|
|
return $this; |
|
160
|
|
|
} |
|
161
|
|
|
|
|
162
|
|
|
/** |
|
163
|
|
|
* |
|
164
|
|
|
* @return mixed |
|
165
|
|
|
*/ |
|
166
|
|
|
public function getStatusLabel() |
|
167
|
|
|
{ |
|
168
|
|
|
return $this->status_label; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
/** |
|
172
|
|
|
* @param mixed $status_label |
|
173
|
|
|
* @return BoletoResponse |
|
174
|
|
|
*/ |
|
175
|
|
|
public function setStatusLabel($status_label) |
|
176
|
|
|
{ |
|
177
|
|
|
$this->status_label = $status_label; |
|
178
|
|
|
|
|
179
|
|
|
return $this; |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
/** |
|
183
|
|
|
* @return mixed |
|
184
|
|
|
*/ |
|
185
|
|
|
public function getTypefulLine() |
|
186
|
|
|
{ |
|
187
|
|
|
return $this->typeful_line; |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
/** |
|
191
|
|
|
* @param $typeful_line |
|
192
|
|
|
* @return $this |
|
193
|
|
|
*/ |
|
194
|
|
|
public function setTypefulLine($typeful_line) |
|
195
|
|
|
{ |
|
196
|
|
|
$this->typeful_line = $typeful_line; |
|
197
|
|
|
|
|
198
|
|
|
return $this; |
|
199
|
|
|
} |
|
200
|
|
|
|
|
201
|
|
|
/** |
|
202
|
|
|
* |
|
203
|
|
|
* @return mixed |
|
204
|
|
|
*/ |
|
205
|
|
|
public function getBarCode() |
|
206
|
|
|
{ |
|
207
|
|
|
return $this->bar_code; |
|
208
|
|
|
} |
|
209
|
|
|
|
|
210
|
|
|
/** |
|
211
|
|
|
* @param $bar_code |
|
212
|
|
|
* @return $this |
|
213
|
|
|
*/ |
|
214
|
|
|
public function setBarCode($bar_code) |
|
215
|
|
|
{ |
|
216
|
|
|
$this->bar_code = $bar_code; |
|
217
|
|
|
|
|
218
|
|
|
return $this; |
|
219
|
|
|
} |
|
220
|
|
|
|
|
221
|
|
|
/** |
|
222
|
|
|
* @return mixed |
|
223
|
|
|
*/ |
|
224
|
|
|
public function getIssueDate() |
|
225
|
|
|
{ |
|
226
|
|
|
return $this->issue_date; |
|
227
|
|
|
} |
|
228
|
|
|
|
|
229
|
|
|
/** |
|
230
|
|
|
* @param $issue_date |
|
231
|
|
|
* @return $this |
|
232
|
|
|
*/ |
|
233
|
|
|
public function setIssueDate($issue_date) |
|
234
|
|
|
{ |
|
235
|
|
|
$this->issue_date = $issue_date; |
|
236
|
|
|
|
|
237
|
|
|
return $this; |
|
238
|
|
|
} |
|
239
|
|
|
|
|
240
|
|
|
/** |
|
241
|
|
|
* @return mixed |
|
242
|
|
|
*/ |
|
243
|
|
|
public function getExpirationDate() |
|
244
|
|
|
{ |
|
245
|
|
|
return $this->expiration_date; |
|
246
|
|
|
} |
|
247
|
|
|
|
|
248
|
|
|
/** |
|
249
|
|
|
* @param $expiration_date |
|
250
|
|
|
* @return $this |
|
251
|
|
|
*/ |
|
252
|
|
|
public function setExpirationDate($expiration_date) |
|
253
|
|
|
{ |
|
254
|
|
|
$this->expiration_date = $expiration_date; |
|
255
|
|
|
|
|
256
|
|
|
return $this; |
|
257
|
|
|
} |
|
258
|
|
|
|
|
259
|
|
|
/** |
|
260
|
|
|
* @return mixed |
|
261
|
|
|
*/ |
|
262
|
|
|
public function getOurNumber() |
|
263
|
|
|
{ |
|
264
|
|
|
return $this->our_number; |
|
265
|
|
|
} |
|
266
|
|
|
|
|
267
|
|
|
/** |
|
268
|
|
|
* @param $our_number |
|
269
|
|
|
* @return $this |
|
270
|
|
|
*/ |
|
271
|
|
|
public function setOurNumber($our_number) |
|
272
|
|
|
{ |
|
273
|
|
|
$this->our_number = $our_number; |
|
274
|
|
|
|
|
275
|
|
|
return $this; |
|
276
|
|
|
} |
|
277
|
|
|
} |
|
278
|
|
|
|