Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class Serializer implements Serializable |
||
9 | { |
||
10 | /** |
||
11 | * @var Transaction |
||
12 | */ |
||
13 | protected $transaction; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $action; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $operation; |
||
24 | |||
25 | public function __construct(Transaction $transaction, $action, $operation) |
||
26 | { |
||
27 | $this->transaction = $transaction; |
||
28 | $this->action = $action; |
||
29 | $this->operation = $operation; |
||
30 | } |
||
31 | |||
32 | public function serialize() |
||
33 | { |
||
34 | return [ |
||
35 | 'identificacao' => urlencode($this->transaction->getIpag()->getAuthentication()->getIdentification()), |
||
36 | 'transId' => urlencode($this->transaction->getTid()), |
||
37 | 'retorno_tipo' => urlencode('xml'), |
||
38 | ]; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return Transaction |
||
43 | */ |
||
44 | public function getTransaction() |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getAction() |
||
53 | { |
||
54 | return $this->action; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getOperation() |
||
63 | } |
||
64 | } |
||
65 |