1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Integracao\ControlPay\Model; |
4
|
|
|
use Integracao\ControlPay\Helpers\SerializerHelper; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* Class PagamentoExterno |
8
|
|
|
* @package Integracao\ControlPay\Model |
9
|
|
|
*/ |
10
|
|
|
class PagamentoExterno implements \JsonSerializable |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var integer |
14
|
|
|
*/ |
15
|
|
|
private $id; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @var integer |
19
|
|
|
*/ |
20
|
|
|
private $tipo; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var integer |
24
|
|
|
*/ |
25
|
|
|
private $origem; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var integer |
29
|
|
|
*/ |
30
|
|
|
private $tipoParcelamento; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var PagamentoExternoStatus |
34
|
|
|
*/ |
35
|
|
|
private $pagamentoExternoStatus; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var Pessoa |
39
|
|
|
*/ |
40
|
|
|
private $pessoa; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var IntencaoVenda |
44
|
|
|
*/ |
45
|
|
|
private $intencoesVenda; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var Terminal |
49
|
|
|
*/ |
50
|
|
|
private $terminal; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var integer |
54
|
|
|
*/ |
55
|
|
|
private $nsuTid; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var string |
59
|
|
|
*/ |
60
|
|
|
private $autorizacao; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var string |
64
|
|
|
*/ |
65
|
|
|
private $adquirente; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var string |
69
|
|
|
*/ |
70
|
|
|
private $codigoRespostaAdquirente; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @var string |
74
|
|
|
*/ |
75
|
|
|
private $mensagemRespostaAdquirente; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @var \DateTime |
79
|
|
|
*/ |
80
|
|
|
private $dataAdquirente; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @var string |
84
|
|
|
*/ |
85
|
|
|
private $respostaAdquirente; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @var string |
89
|
|
|
*/ |
90
|
|
|
private $comprovanteAdquirente; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @var array |
94
|
|
|
*/ |
95
|
|
|
private $comprovanteAdquirenteLinhas; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* PagamentoExterno constructor. |
99
|
|
|
*/ |
100
|
|
|
public function __construct() |
101
|
|
|
{ |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @return int |
106
|
|
|
*/ |
107
|
|
|
public function getId() |
108
|
|
|
{ |
109
|
|
|
return $this->id; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @param int $id |
114
|
|
|
* @return PagamentoExterno |
115
|
|
|
*/ |
116
|
|
|
public function setId($id) |
117
|
|
|
{ |
118
|
|
|
$this->id = $id; |
119
|
|
|
return $this; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @return int |
124
|
|
|
*/ |
125
|
|
|
public function getTipo() |
126
|
|
|
{ |
127
|
|
|
return $this->tipo; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @param int $tipo |
132
|
|
|
* @return PagamentoExterno |
133
|
|
|
*/ |
134
|
|
|
public function setTipo($tipo) |
135
|
|
|
{ |
136
|
|
|
$this->tipo = $tipo; |
137
|
|
|
return $this; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* @return int |
142
|
|
|
*/ |
143
|
|
|
public function getOrigem() |
144
|
|
|
{ |
145
|
|
|
return $this->origem; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* @param int $origem |
150
|
|
|
* @return PagamentoExterno |
151
|
|
|
*/ |
152
|
|
|
public function setOrigem($origem) |
153
|
|
|
{ |
154
|
|
|
$this->origem = $origem; |
155
|
|
|
return $this; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @return int |
160
|
|
|
*/ |
161
|
|
|
public function getTipoParcelamento() |
162
|
|
|
{ |
163
|
|
|
return $this->tipoParcelamento; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* @param int $tipoParcelamento |
168
|
|
|
* @return PagamentoExterno |
169
|
|
|
*/ |
170
|
|
|
public function setTipoParcelamento($tipoParcelamento) |
171
|
|
|
{ |
172
|
|
|
$this->tipoParcelamento = $tipoParcelamento; |
173
|
|
|
return $this; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @return PagamentoExternoStatus |
178
|
|
|
*/ |
179
|
|
|
public function getPagamentoExternoStatus() |
180
|
|
|
{ |
181
|
|
|
return $this->pagamentoExternoStatus; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @param PagamentoExternoStatus $pagamentoExternoStatus |
186
|
|
|
* @return PagamentoExterno |
187
|
|
|
*/ |
188
|
|
|
public function setPagamentoExternoStatus($pagamentoExternoStatus) |
189
|
|
|
{ |
190
|
|
|
$this->pagamentoExternoStatus = $pagamentoExternoStatus; |
191
|
|
|
|
192
|
|
|
if(is_array($this->pagamentoExternoStatus)) |
193
|
|
|
$this->pagamentoExternoStatus = SerializerHelper::denormalize( |
194
|
|
|
$this->pagamentoExternoStatus, PagamentoExternoStatus::class); |
195
|
|
|
|
196
|
|
|
return $this; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @return Pessoa |
201
|
|
|
*/ |
202
|
|
|
public function getPessoa() |
203
|
|
|
{ |
204
|
|
|
return $this->pessoa; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* @param Pessoa $pessoa |
209
|
|
|
* @return PagamentoExterno |
210
|
|
|
*/ |
211
|
|
|
public function setPessoa($pessoa) |
212
|
|
|
{ |
213
|
|
|
$this->pessoa = $pessoa; |
214
|
|
|
|
215
|
|
|
if(is_array($this->pessoa)) |
216
|
|
|
$this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
217
|
|
|
|
218
|
|
|
return $this; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* @return IntencaoVenda |
223
|
|
|
*/ |
224
|
|
|
public function getIntencoesVenda() |
225
|
|
|
{ |
226
|
|
|
return $this->intencoesVenda; |
227
|
|
|
} |
228
|
|
|
|
229
|
|
|
/** |
230
|
|
|
* @param IntencaoVenda $intencoesVenda |
231
|
|
|
* @return PagamentoExterno |
232
|
|
|
*/ |
233
|
|
|
public function setIntencoesVenda($intencoesVenda) |
234
|
|
|
{ |
235
|
|
|
$this->intencoesVenda = $intencoesVenda; |
236
|
|
|
|
237
|
|
|
if(is_array($this->intencoesVenda)) |
238
|
|
|
$this->intencoesVenda = SerializerHelper::denormalize($this->intencoesVenda, IntencaoVenda::class); |
239
|
|
|
|
240
|
|
|
return $this; |
241
|
|
|
} |
242
|
|
|
|
243
|
|
|
/** |
244
|
|
|
* @return Terminal |
245
|
|
|
*/ |
246
|
|
|
public function getTerminal() |
247
|
|
|
{ |
248
|
|
|
return $this->terminal; |
249
|
|
|
} |
250
|
|
|
|
251
|
|
|
/** |
252
|
|
|
* @param Terminal $terminal |
253
|
|
|
* @return PagamentoExterno |
254
|
|
|
*/ |
255
|
|
|
public function setTerminal($terminal) |
256
|
|
|
{ |
257
|
|
|
$this->terminal = $terminal; |
258
|
|
|
|
259
|
|
|
if(is_array($this->terminal)) |
260
|
|
|
$this->terminal = SerializerHelper::denormalize($this->terminal, Terminal::class); |
261
|
|
|
|
262
|
|
|
return $this; |
263
|
|
|
} |
264
|
|
|
|
265
|
|
|
/** |
266
|
|
|
* @return int |
267
|
|
|
*/ |
268
|
|
|
public function getNsuTid() |
269
|
|
|
{ |
270
|
|
|
return $this->nsuTid; |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
/** |
274
|
|
|
* @param int $nsuTid |
275
|
|
|
* @return PagamentoExterno |
276
|
|
|
*/ |
277
|
|
|
public function setNsuTid($nsuTid) |
278
|
|
|
{ |
279
|
|
|
$this->nsuTid = $nsuTid; |
280
|
|
|
return $this; |
281
|
|
|
} |
282
|
|
|
|
283
|
|
|
/** |
284
|
|
|
* @return string |
285
|
|
|
*/ |
286
|
|
|
public function getAutorizacao() |
287
|
|
|
{ |
288
|
|
|
return $this->autorizacao; |
289
|
|
|
} |
290
|
|
|
|
291
|
|
|
/** |
292
|
|
|
* @param string $autorizacao |
293
|
|
|
* @return PagamentoExterno |
294
|
|
|
*/ |
295
|
|
|
public function setAutorizacao($autorizacao) |
296
|
|
|
{ |
297
|
|
|
$this->autorizacao = $autorizacao; |
298
|
|
|
return $this; |
299
|
|
|
} |
300
|
|
|
|
301
|
|
|
/** |
302
|
|
|
* @return string |
303
|
|
|
*/ |
304
|
|
|
public function getAdquirente() |
305
|
|
|
{ |
306
|
|
|
return $this->adquirente; |
307
|
|
|
} |
308
|
|
|
|
309
|
|
|
/** |
310
|
|
|
* @param string $adquirente |
311
|
|
|
* @return PagamentoExterno |
312
|
|
|
*/ |
313
|
|
|
public function setAdquirente($adquirente) |
314
|
|
|
{ |
315
|
|
|
$this->adquirente = $adquirente; |
316
|
|
|
return $this; |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* @return string |
321
|
|
|
*/ |
322
|
|
|
public function getCodigoRespostaAdquirente() |
323
|
|
|
{ |
324
|
|
|
return $this->codigoRespostaAdquirente; |
325
|
|
|
} |
326
|
|
|
|
327
|
|
|
/** |
328
|
|
|
* @param string $codigoRespostaAdquirente |
329
|
|
|
* @return PagamentoExterno |
330
|
|
|
*/ |
331
|
|
|
public function setCodigoRespostaAdquirente($codigoRespostaAdquirente) |
332
|
|
|
{ |
333
|
|
|
$this->codigoRespostaAdquirente = $codigoRespostaAdquirente; |
334
|
|
|
return $this; |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
/** |
338
|
|
|
* @return string |
339
|
|
|
*/ |
340
|
|
|
public function getMensagemRespostaAdquirente() |
341
|
|
|
{ |
342
|
|
|
return $this->mensagemRespostaAdquirente; |
343
|
|
|
} |
344
|
|
|
|
345
|
|
|
/** |
346
|
|
|
* @param string $mensagemRespostaAdquirente |
347
|
|
|
* @return PagamentoExterno |
348
|
|
|
*/ |
349
|
|
|
public function setMensagemRespostaAdquirente($mensagemRespostaAdquirente) |
350
|
|
|
{ |
351
|
|
|
$this->mensagemRespostaAdquirente = $mensagemRespostaAdquirente; |
352
|
|
|
return $this; |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
/** |
356
|
|
|
* @return \DateTime |
357
|
|
|
*/ |
358
|
|
|
public function getDataAdquirente() |
359
|
|
|
{ |
360
|
|
|
return $this->dataAdquirente; |
361
|
|
|
} |
362
|
|
|
|
363
|
|
|
/** |
364
|
|
|
* @param \DateTime $dataAdquirente |
365
|
|
|
* @return PagamentoExterno |
366
|
|
|
*/ |
367
|
|
|
public function setDataAdquirente($dataAdquirente) |
368
|
|
|
{ |
369
|
|
|
$this->dataAdquirente = $dataAdquirente; |
370
|
|
|
return $this; |
371
|
|
|
} |
372
|
|
|
|
373
|
|
|
/** |
374
|
|
|
* @return string |
375
|
|
|
*/ |
376
|
|
|
public function getRespostaAdquirente() |
377
|
|
|
{ |
378
|
|
|
return $this->respostaAdquirente; |
379
|
|
|
} |
380
|
|
|
|
381
|
|
|
/** |
382
|
|
|
* @param string $respostaAdquirente |
383
|
|
|
* @return PagamentoExterno |
384
|
|
|
*/ |
385
|
|
|
public function setRespostaAdquirente($respostaAdquirente) |
386
|
|
|
{ |
387
|
|
|
$this->respostaAdquirente = $respostaAdquirente; |
388
|
|
|
return $this; |
389
|
|
|
} |
390
|
|
|
|
391
|
|
|
/** |
392
|
|
|
* @return string |
393
|
|
|
*/ |
394
|
|
|
public function getComprovanteAdquirente() |
395
|
|
|
{ |
396
|
|
|
return $this->comprovanteAdquirente; |
397
|
|
|
} |
398
|
|
|
|
399
|
|
|
/** |
400
|
|
|
* @param string $comprovanteAdquirente |
401
|
|
|
* @return PagamentoExterno |
402
|
|
|
*/ |
403
|
|
|
public function setComprovanteAdquirente($comprovanteAdquirente) |
404
|
|
|
{ |
405
|
|
|
$this->comprovanteAdquirente = $comprovanteAdquirente; |
406
|
|
|
|
407
|
|
|
/** |
408
|
|
|
* Divide comprovante en linhas para facilitar uso |
409
|
|
|
*/ |
410
|
|
|
$this->comprovanteAdquirenteLinhas = explode(PHP_EOL, $comprovanteAdquirente); |
411
|
|
|
|
412
|
|
|
return $this; |
413
|
|
|
} |
414
|
|
|
|
415
|
|
|
/** |
416
|
|
|
* @return array |
417
|
|
|
*/ |
418
|
|
|
public function getComprovanteAdquirenteLinhas() |
419
|
|
|
{ |
420
|
|
|
return $this->comprovanteAdquirenteLinhas; |
421
|
|
|
} |
422
|
|
|
|
423
|
|
|
/** |
424
|
|
|
* @param array $comprovanteAdquirenteLinhas |
425
|
|
|
* @return PagamentoExterno |
426
|
|
|
*/ |
427
|
|
|
public function setComprovanteAdquirenteLinhas($comprovanteAdquirenteLinhas) |
428
|
|
|
{ |
429
|
|
|
$this->comprovanteAdquirenteLinhas = $comprovanteAdquirenteLinhas; |
430
|
|
|
return $this; |
431
|
|
|
} |
432
|
|
|
|
433
|
|
|
function jsonSerialize() |
434
|
|
|
{ |
435
|
|
|
return [ |
436
|
|
|
'id' => $this->id, |
437
|
|
|
'terminal' => $this->terminal, |
438
|
|
|
'tipo' => $this->tipo, |
439
|
|
|
'origem' => $this->origem, |
440
|
|
|
'tipoParcelamento' => $this->tipoParcelamento, |
441
|
|
|
'pagamentoExternoStatus' => $this->pagamentoExternoStatus, |
442
|
|
|
'intencoesVenda' => $this->intencoesVenda, |
443
|
|
|
'nsuTid' => $this->nsuTid, |
444
|
|
|
'autorizacao' => $this->autorizacao, |
445
|
|
|
'adquirente' => $this->adquirente, |
446
|
|
|
'codigoRespostaAdquirente' => $this->codigoRespostaAdquirente, |
447
|
|
|
'mensagemRespostaAdquirente' => $this->mensagemRespostaAdquirente, |
448
|
|
|
'dataAdquirente' => $this->dataAdquirente, |
449
|
|
|
'respostaAdquirente' => $this->respostaAdquirente, |
450
|
|
|
'comprovanteAdquirente' => $this->comprovanteAdquirente |
451
|
|
|
]; |
452
|
|
|
} |
453
|
|
|
|
454
|
|
|
|
455
|
|
|
} |