Conditions | 5 |
Paths | 6 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | protected function updatePaymentEntity(AmazonpayCallTransfer $amazonPayCallTransfer) |
||
35 | { |
||
36 | if (!$this->paymentEntity) { |
||
37 | return; |
||
38 | } |
||
39 | |||
40 | $isPartialProcessing = $this->isPartialProcessing($this->paymentEntity, $amazonPayCallTransfer); |
||
41 | |||
42 | if (!$this->apiResponse->getResponseHeader()->getIsSuccess()) { |
||
43 | return; |
||
44 | } |
||
45 | |||
46 | if ($isPartialProcessing) { |
||
47 | $this->paymentEntity = $this->paymentProcessor->duplicatePaymentEntity($this->paymentEntity); |
||
48 | } |
||
49 | |||
50 | $this->paymentEntity->setStatus(AmazonPayConfig::STATUS_CANCELLED); |
||
51 | $this->paymentEntity->save(); |
||
52 | |||
53 | if ($isPartialProcessing) { |
||
54 | $this->paymentProcessor->assignAmazonpayPaymentToItems($this->paymentEntity, $amazonPayCallTransfer); |
||
55 | } |
||
66 |