1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Integracao\ControlPay\Contracts\Pedido; |
4
|
|
|
|
5
|
|
|
use Integracao\ControlPay\Helpers\SerializerHelper; |
6
|
|
|
use Integracao\ControlPay\Model\Produto; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class InserirRequest |
10
|
|
|
* @package Integracao\ControlPay\Contracts\IntencaoVenda |
11
|
|
|
*/ |
12
|
|
|
class InserirRequest implements \JsonSerializable |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* @var integer |
16
|
|
|
*/ |
17
|
|
|
private $pedidoId; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @var string |
21
|
|
|
*/ |
22
|
|
|
private $referencia; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var double |
26
|
|
|
*/ |
27
|
|
|
private $valorTotalPedido; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
private $urlRetorno; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var Produto |
36
|
|
|
*/ |
37
|
|
|
private $produtosPedido; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @return int |
41
|
|
|
*/ |
42
|
|
|
public function getPedidoId() |
43
|
|
|
{ |
44
|
|
|
return $this->pedidoId; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @param int $pedidoId |
49
|
|
|
* @return InserirRequest |
50
|
|
|
*/ |
51
|
|
|
public function setPedidoId($pedidoId) |
52
|
|
|
{ |
53
|
|
|
$this->pedidoId = $pedidoId; |
54
|
|
|
return $this; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @return string |
59
|
|
|
*/ |
60
|
|
|
public function getReferencia() |
61
|
|
|
{ |
62
|
|
|
return $this->referencia; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @param string $referencia |
67
|
|
|
* @return InserirRequest |
68
|
|
|
*/ |
69
|
|
|
public function setReferencia($referencia) |
70
|
|
|
{ |
71
|
|
|
$this->referencia = $referencia; |
72
|
|
|
return $this; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @return float |
77
|
|
|
*/ |
78
|
|
|
public function getValorTotalPedido() |
79
|
|
|
{ |
80
|
|
|
return $this->valorTotalPedido; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @param float $valorTotalPedido |
85
|
|
|
* @return InserirRequest |
86
|
|
|
*/ |
87
|
|
|
public function setValorTotalPedido($valorTotalPedido) |
88
|
|
|
{ |
89
|
|
|
$this->valorTotalPedido = $valorTotalPedido; |
90
|
|
|
return $this; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @return string |
95
|
|
|
*/ |
96
|
|
|
public function getUrlRetorno() |
97
|
|
|
{ |
98
|
|
|
return $this->urlRetorno; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @param string $urlRetorno |
103
|
|
|
* @return InserirRequest |
104
|
|
|
*/ |
105
|
|
|
public function setUrlRetorno($urlRetorno) |
106
|
|
|
{ |
107
|
|
|
$this->urlRetorno = $urlRetorno; |
108
|
|
|
return $this; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @return Produto |
113
|
|
|
*/ |
114
|
|
|
public function getProdutosPedido() |
115
|
|
|
{ |
116
|
|
|
return $this->produtosPedido; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @param Produto $produtosPedido |
121
|
|
|
* @return InserirRequest |
122
|
|
|
*/ |
123
|
|
|
public function setProdutosPedido($produtosPedido) |
124
|
|
|
{ |
125
|
|
|
$this->produtosPedido = $produtosPedido; |
126
|
|
|
return $this; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @return array |
131
|
|
|
*/ |
132
|
|
|
function jsonSerialize() |
|
|
|
|
133
|
|
|
{ |
134
|
|
|
return [ |
135
|
|
|
'pedidoId' => $this->pedidoId, |
136
|
|
|
'referencia' => $this->referencia, |
137
|
|
|
'ValorTotalPedido' => $this->valorTotalPedido, |
138
|
|
|
'urlRetorno' => $this->urlRetorno, |
139
|
|
|
'produtosPedido' => $this->produtosPedido, |
140
|
|
|
]; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
} |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.