Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function build(array $buildSubject) |
||
23 | { |
||
24 | if (!isset($buildSubject['payment']) |
||
25 | || !$buildSubject['payment'] instanceof PaymentDataObjectInterface |
||
26 | ) { |
||
27 | throw new \InvalidArgumentException('Payment data object should be provided'); |
||
28 | } |
||
29 | |||
30 | /** @var PaymentDataObjectInterface $paymentDO */ |
||
31 | $paymentDO = $buildSubject['payment']; |
||
32 | $payment = $paymentDO->getPayment(); |
||
33 | |||
34 | $transactionResult = $payment->getAdditionalInformation('transaction_result'); |
||
35 | return [ |
||
36 | self::FORCE_RESULT => $transactionResult === null |
||
37 | ? ClientMock::SUCCESS |
||
38 | : $transactionResult |
||
39 | ]; |
||
42 |