Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function build(Request $request) |
||
13 | { |
||
14 | $data = array_merge( |
||
15 | $this->buildBaseRequest($request), |
||
16 | [ |
||
17 | self::TRANSACTION_TYPE => array_merge( |
||
18 | [ |
||
19 | 'amount' => $this->amountFormatter->format($request->getAmount()), |
||
20 | 'currencyCode' => $this->currencyCodeFormatter->format($request->getCurrency()), |
||
21 | 'orderID' => $this->orderIdFormatter->format($request->getOrderId()) |
||
22 | ], |
||
23 | $this->buildCard($request->getResource()) |
||
24 | ) |
||
25 | ] |
||
26 | ); |
||
27 | |||
28 | if ($request->getInstallment()) { |
||
29 | $data[self::TRANSACTION_TYPE]['installment'] = $this->installmentFormatter->format( |
||
30 | $request->getInstallment() |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | $serializer = new Serializer(Serializer::XML); |
||
35 | return $serializer->serialize($data, ['root_name' => self::ENVELOPE_NAME]); |
||
36 | } |
||
38 |