|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Apache OSL-2 |
|
5
|
|
|
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\AmazonPay\Business\Payment\Handler\Transaction; |
|
9
|
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\AmazonpayCallTransfer; |
|
|
|
|
|
|
11
|
|
|
use SprykerEco\Shared\AmazonPay\AmazonPayConfig; |
|
12
|
|
|
|
|
13
|
|
|
class RefundOrderTransaction extends AbstractAmazonpayTransaction |
|
14
|
|
|
{ |
|
15
|
|
|
/** |
|
16
|
|
|
* @param \Generated\Shared\Transfer\AmazonpayCallTransfer $amazonPayCallTransfer |
|
17
|
|
|
* |
|
18
|
|
|
* @return \Generated\Shared\Transfer\AmazonpayCallTransfer |
|
19
|
|
|
*/ |
|
20
|
|
|
public function execute(AmazonpayCallTransfer $amazonPayCallTransfer) |
|
21
|
|
|
{ |
|
22
|
|
|
if (!$amazonPayCallTransfer->getAmazonpayPayment() |
|
23
|
|
|
->getCaptureDetails() |
|
24
|
|
|
->getAmazonCaptureId() |
|
25
|
|
|
) { |
|
26
|
|
|
return $amazonPayCallTransfer; |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
$amazonPayCallTransfer->getAmazonpayPayment()->getRefundDetails()->setRefundReferenceId( |
|
30
|
|
|
$this->generateOperationReferenceId($amazonPayCallTransfer) |
|
31
|
|
|
); |
|
32
|
|
|
|
|
33
|
|
|
$amazonPayCallTransfer = parent::execute($amazonPayCallTransfer); |
|
34
|
|
|
|
|
35
|
|
|
if (!$this->apiResponse->getResponseHeader()->getIsSuccess()) { |
|
36
|
|
|
return $amazonPayCallTransfer; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
$isPartialProcessing = $this->isPartialProcessing($this->paymentEntity, $amazonPayCallTransfer); |
|
40
|
|
|
|
|
41
|
|
|
if ($isPartialProcessing) { |
|
42
|
|
|
$this->paymentEntity = $this->paymentProcessor->duplicatePaymentEntity($this->paymentEntity); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
$this->paymentEntity->setStatus(AmazonPayConfig::STATUS_PENDING); |
|
46
|
|
|
$this->paymentEntity->setAmazonRefundId($this->apiResponse->getRefundDetails()->getAmazonRefundId()); |
|
47
|
|
|
$this->paymentEntity->setRefundReferenceId($this->apiResponse->getRefundDetails()->getRefundReferenceId()); |
|
48
|
|
|
$this->paymentEntity->save(); |
|
49
|
|
|
|
|
50
|
|
|
if ($isPartialProcessing) { |
|
51
|
|
|
$this->paymentProcessor->assignAmazonpayPaymentToItems( |
|
52
|
|
|
$this->paymentEntity, |
|
53
|
|
|
$amazonPayCallTransfer |
|
54
|
|
|
); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
return $amazonPayCallTransfer; |
|
58
|
|
|
} |
|
59
|
|
|
} |
|
60
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths