| Conditions | 5 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function handle(array $handlingSubject, array $response) |
||
| 24 | { |
||
| 25 | if (!isset($response[self::FRAUD_MSG_LIST]) || !is_array($response[self::FRAUD_MSG_LIST])) { |
||
| 26 | return; |
||
| 27 | } |
||
| 28 | |||
| 29 | if (!isset($handlingSubject['payment']) |
||
| 30 | || !$handlingSubject['payment'] instanceof PaymentDataObjectInterface |
||
| 31 | ) { |
||
| 32 | throw new \InvalidArgumentException('Payment data object should be provided'); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** @var PaymentDataObjectInterface $paymentDO */ |
||
| 36 | $paymentDO = $handlingSubject['payment']; |
||
| 37 | $payment = $paymentDO->getPayment(); |
||
| 38 | |||
| 39 | $payment->setAdditionalInformation( |
||
| 40 | self::FRAUD_MSG_LIST, |
||
| 41 | (array)$response[self::FRAUD_MSG_LIST] |
||
|
|
|||
| 42 | ); |
||
| 43 | |||
| 44 | /** @var $payment Payment */ |
||
| 45 | $payment->setIsTransactionPending(true); |
||
| 46 | $payment->setIsFraudDetected(true); |
||
| 47 | } |
||
| 49 |