| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function handle(array $handlingSubject, array $response) |
||
| 23 | { |
||
| 24 | if (!isset($handlingSubject['payment']) |
||
| 25 | || !$handlingSubject['payment'] instanceof PaymentDataObjectInterface |
||
| 26 | ) { |
||
| 27 | throw new \InvalidArgumentException('Payment data object should be provided'); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** @var PaymentDataObjectInterface $paymentDO */ |
||
| 31 | $paymentDO = $handlingSubject['payment']; |
||
| 32 | |||
| 33 | $payment = $paymentDO->getPayment(); |
||
| 34 | |||
| 35 | /** @var $payment \Magento\Sales\Model\Order\Payment */ |
||
| 36 | $payment->setTransactionId($response[self::TXN_ID]); |
||
| 37 | $payment->setIsTransactionClosed(false); |
||
| 38 | } |
||
| 40 |