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