1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* MIT License |
5
|
|
|
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\Computop\Business\Payment\Handler\Saver\Init; |
9
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\ComputopPayuCeeSingleInitResponseTransfer; |
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\QuoteTransfer; |
|
|
|
|
12
|
|
|
use SprykerEco\Zed\Computop\ComputopConfig; |
13
|
|
|
use SprykerEco\Zed\Computop\Dependency\Facade\ComputopToOmsFacadeInterface; |
14
|
|
|
use SprykerEco\Zed\Computop\Persistence\ComputopEntityManagerInterface; |
15
|
|
|
use SprykerEco\Zed\Computop\Persistence\ComputopQueryContainerInterface; |
16
|
|
|
|
17
|
|
|
class PayuCeeSingleResponseSaver extends AbstractResponseSaver |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @var \SprykerEco\Zed\Computop\Persistence\ComputopEntityManagerInterface |
21
|
|
|
*/ |
22
|
|
|
protected $computopEntityManager; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @param \SprykerEco\Zed\Computop\Persistence\ComputopQueryContainerInterface $queryContainer |
26
|
|
|
* @param \SprykerEco\Zed\Computop\Dependency\Facade\ComputopToOmsFacadeInterface $omsFacade |
27
|
|
|
* @param \SprykerEco\Zed\Computop\ComputopConfig $config |
28
|
|
|
* @param \SprykerEco\Zed\Computop\Persistence\ComputopEntityManagerInterface $computopEntityManager |
29
|
|
|
*/ |
30
|
|
|
public function __construct( |
31
|
|
|
ComputopQueryContainerInterface $queryContainer, |
32
|
|
|
ComputopToOmsFacadeInterface $omsFacade, |
33
|
|
|
ComputopConfig $config, |
34
|
|
|
ComputopEntityManagerInterface $computopEntityManager |
35
|
|
|
) { |
36
|
|
|
parent::__construct($queryContainer, $omsFacade, $config); |
37
|
|
|
$this->computopEntityManager = $computopEntityManager; |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
42
|
|
|
* |
43
|
|
|
* @return \Generated\Shared\Transfer\QuoteTransfer |
44
|
|
|
*/ |
45
|
|
|
public function save(QuoteTransfer $quoteTransfer): QuoteTransfer |
46
|
|
|
{ |
47
|
|
|
if ( |
48
|
|
|
!$quoteTransfer->getPayment() || |
49
|
|
|
!$quoteTransfer->getPayment()->getComputopPayuCeeSingle() || |
50
|
|
|
!$quoteTransfer->getPayment()->getComputopPayuCeeSingle()->getPayuCeeSingleInitResponse() |
51
|
|
|
) { |
52
|
|
|
return $quoteTransfer; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
$computopPayuCeeSingleInitResponse = $quoteTransfer->getPayment()->getComputopPayuCeeSingle()->getPayuCeeSingleInitResponse(); |
56
|
|
|
if ($computopPayuCeeSingleInitResponse->getHeader()->getIsSuccess()) { |
57
|
|
|
$this->handleSaveTransaction($computopPayuCeeSingleInitResponse); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
return $quoteTransfer; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @param \Generated\Shared\Transfer\ComputopPayuCeeSingleInitResponseTransfer $computopPayuCeeSingleInitResponseTransfer |
65
|
|
|
* |
66
|
|
|
* @return void |
67
|
|
|
*/ |
68
|
|
|
protected function handleSaveTransaction(ComputopPayuCeeSingleInitResponseTransfer $computopPayuCeeSingleInitResponseTransfer): void |
69
|
|
|
{ |
70
|
|
|
$this->getTransactionHandler()->handleTransaction(function () use ($computopPayuCeeSingleInitResponseTransfer) { |
71
|
|
|
$this->executeSavePaymentResponseTransaction($computopPayuCeeSingleInitResponseTransfer); |
72
|
|
|
}); |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @param \Generated\Shared\Transfer\ComputopPayuCeeSingleInitResponseTransfer $computopPayuCeeSingleInitResponseTransfer |
77
|
|
|
* |
78
|
|
|
* @return void |
79
|
|
|
*/ |
80
|
|
|
protected function executeSavePaymentResponseTransaction(ComputopPayuCeeSingleInitResponseTransfer $computopPayuCeeSingleInitResponseTransfer): void |
81
|
|
|
{ |
82
|
|
|
$this->computopEntityManager->saveComputopPayuCeeSingleInitResponse($computopPayuCeeSingleInitResponseTransfer); |
83
|
|
|
} |
84
|
|
|
} |
85
|
|
|
|
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