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