Conditions | 3 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
54 | public function build(array $buildSubject) |
||
55 | { |
||
56 | if (!isset($buildSubject['payment']) |
||
57 | || !$buildSubject['payment'] instanceof PaymentDataObjectInterface |
||
58 | ) { |
||
59 | throw new InvalidArgumentException('Payment data object should be provided'); |
||
60 | } |
||
61 | |||
62 | $paymentDO = $this->subjectReader->readPayment($buildSubject); |
||
63 | |||
64 | $result = []; |
||
65 | |||
66 | $order = $paymentDO->getOrder(); |
||
67 | |||
68 | $grandTotal = $order->getGrandTotalAmount(); |
||
69 | |||
70 | $result[self::AMOUNT] = $this->config->formatPrice($grandTotal); |
||
71 | |||
72 | return $result; |
||
73 | } |
||
75 |