| Conditions | 5 |
| Paths | 6 |
| Total Lines | 24 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function execute(AmazonpayCallTransfer $amazonpayCallTransfer) |
||
| 22 | { |
||
| 23 | $amazonpayCallTransfer = parent::execute($amazonpayCallTransfer); |
||
| 24 | |||
| 25 | if ($this->paymentEntity) { |
||
| 26 | $isPartialProcessing = $this->isPartialProcessing($this->paymentEntity, $amazonpayCallTransfer); |
||
| 27 | |||
| 28 | if (!$this->apiResponse->getHeader()->getIsSuccess()) { |
||
| 29 | return $amazonpayCallTransfer; |
||
| 30 | } |
||
| 31 | |||
| 32 | if ($isPartialProcessing) { |
||
| 33 | $this->paymentEntity = $this->duplicatePaymentEntity($this->paymentEntity); |
||
| 34 | } |
||
| 35 | |||
| 36 | $this->paymentEntity->setStatus(AmazonpayConstants::OMS_STATUS_CANCELLED); |
||
| 37 | $this->paymentEntity->save(); |
||
| 38 | |||
| 39 | if ($isPartialProcessing) { |
||
| 40 | $this->assignAmazonpayPaymentToItemsIfNew($this->paymentEntity, $amazonpayCallTransfer); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | return $amazonpayCallTransfer; |
||
| 45 | } |
||
| 56 |