| Conditions | 2 | 
| Paths | 2 | 
| Total Lines | 21 | 
| Code Lines | 11 | 
| 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 => [ | ||
| 18 | 'amount' => $this->amountFormatter->format($request->getAmount()), | ||
| 19 | 'currencyCode' => $this->currencyCodeFormatter->format($request->getCurrency()), | ||
| 20 | 'hostLogKey' => $request->getTransactionId() | ||
| 21 | ] | ||
| 22 | ] | ||
| 23 | ); | ||
| 24 | |||
| 25 |         if ($request->getInstallment()) { | ||
| 26 | $data[self::TRANSACTION_TYPE]['installment'] = $this->installmentFormatter->format( | ||
| 27 | $request->getInstallment() | ||
| 28 | ); | ||
| 29 | } | ||
| 30 | |||
| 31 | $serializer = new Serializer(Serializer::XML); | ||
| 32 | return $serializer->serialize($data, ['root_name' => self::ENVELOPE_NAME]); | ||
| 33 | } | ||
| 35 |