Total Complexity | 23 |
Total Lines | 198 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class IpnRequestFactory implements IpnRequestFactoryInterface |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var \SprykerEco\Zed\Amazonpay\Dependency\Facade\AmazonpayToOmsInterface $omsFacade |
||
21 | */ |
||
22 | protected $omsFacade; |
||
23 | |||
24 | /** |
||
25 | * @var \SprykerEco\Zed\Amazonpay\Persistence\AmazonpayQueryContainerInterface $amazonpayQueryContainer |
||
26 | */ |
||
27 | protected $amazonpayQueryContainer; |
||
28 | |||
29 | /** |
||
30 | * @var \SprykerEco\Zed\Amazonpay\Business\Payment\Handler\Ipn\Logger\IpnRequestLoggerInterface $ipnRequestLogger |
||
31 | */ |
||
32 | protected $ipnRequestLogger; |
||
33 | |||
34 | /** |
||
35 | * @param \SprykerEco\Zed\Amazonpay\Dependency\Facade\AmazonpayToOmsInterface $omsFacade |
||
36 | * @param \SprykerEco\Zed\Amazonpay\Persistence\AmazonpayQueryContainerInterface $amazonpayQueryContainer |
||
37 | * @param \SprykerEco\Zed\Amazonpay\Business\Payment\Handler\Ipn\Logger\IpnRequestLoggerInterface $ipnRequestLogger |
||
38 | */ |
||
39 | public function __construct( |
||
40 | AmazonpayToOmsInterface $omsFacade, |
||
41 | AmazonpayQueryContainerInterface $amazonpayQueryContainer, |
||
42 | IpnRequestLoggerInterface $ipnRequestLogger |
||
43 | ) { |
||
44 | $this->omsFacade = $omsFacade; |
||
45 | $this->amazonpayQueryContainer = $amazonpayQueryContainer; |
||
46 | $this->ipnRequestLogger = $ipnRequestLogger; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer | \Generated\Shared\Transfer\AmazonpayIpnPaymentAuthorizeRequestTransfer $ipnRequest |
||
1 ignored issue
–
show
|
|||
51 | * |
||
52 | * @throws IpnHandlerNotFoundException |
||
53 | * |
||
54 | * @return \SprykerEco\Zed\Amazonpay\Business\Payment\Handler\Ipn\IpnRequestHandlerInterface |
||
55 | */ |
||
56 | public function createConcreteIpnRequestHandler(AbstractTransfer $ipnRequest) |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer | \Generated\Shared\Transfer\AmazonpayIpnPaymentAuthorizeRequestTransfer $ipnRequest |
||
78 | * |
||
79 | * @throws IpnHandlerNotFoundException |
||
80 | * |
||
81 | * @return \SprykerEco\Zed\Amazonpay\Business\Payment\Handler\Ipn\IpnRequestHandlerInterface |
||
82 | */ |
||
83 | protected function createIpnPaymentAuthorizeHandler(AbstractTransfer $ipnRequest) |
||
113 | } |
||
114 | |||
115 | /** |
||
116 | * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer | \Generated\Shared\Transfer\AmazonpayIpnPaymentCaptureRequestTransfer $ipnRequest |
||
1 ignored issue
–
show
|
|||
117 | * |
||
118 | * @throws IpnHandlerNotFoundException |
||
119 | * |
||
120 | * @return \SprykerEco\Zed\Amazonpay\Business\Payment\Handler\Ipn\IpnRequestHandlerInterface |
||
121 | */ |
||
122 | protected function createIpnPaymentCaptureHandler(AbstractTransfer $ipnRequest) |
||
123 | { |
||
124 | if ($ipnRequest->getCaptureDetails()->getCaptureStatus()->getIsDeclined()) { |
||
125 | return new IpnPaymentCaptureDeclineHandler( |
||
126 | $this->omsFacade, |
||
127 | $this->amazonpayQueryContainer, |
||
128 | $this->ipnRequestLogger |
||
129 | ); |
||
130 | } elseif ($ipnRequest->getCaptureDetails()->getCaptureStatus()->getIsCompleted()) { |
||
131 | return new IpnPaymentCaptureCompletedHandler( |
||
132 | $this->omsFacade, |
||
133 | $this->amazonpayQueryContainer, |
||
134 | $this->ipnRequestLogger |
||
135 | ); |
||
136 | } elseif ($ipnRequest->getCaptureDetails()->getCaptureStatus()->getIsClosed()) { |
||
137 | return new IpnEmptyHandler(); |
||
138 | } |
||
139 | |||
140 | throw new IpnHandlerNotFoundException('No IPN handler for capture and status ' . |
||
141 | $ipnRequest->getCaptureDetails()->getCaptureStatus()->getState()); |
||
142 | } |
||
143 | |||
144 | /** |
||
145 | * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer | \Generated\Shared\Transfer\AmazonpayIpnPaymentRefundRequestTransfer $ipnRequest |
||
1 ignored issue
–
show
|
|||
146 | * |
||
147 | * @throws IpnHandlerNotFoundException |
||
148 | * |
||
149 | * @return \SprykerEco\Zed\Amazonpay\Business\Payment\Handler\Ipn\IpnRequestHandlerInterface |
||
150 | */ |
||
151 | protected function createIpnPaymentRefundHandler(AbstractTransfer $ipnRequest) |
||
169 | } |
||
170 | |||
171 | /** |
||
172 | * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer | \Generated\Shared\Transfer\AmazonpayIpnOrderReferenceNotificationTransfer $ipnRequest |
||
1 ignored issue
–
show
|
|||
173 | * |
||
174 | * @throws IpnHandlerNotFoundException |
||
175 | * |
||
176 | * @return \SprykerEco\Zed\Amazonpay\Business\Payment\Handler\Ipn\IpnRequestHandlerInterface |
||
177 | */ |
||
178 | protected function createIpnOrderReferenceHandler(AbstractTransfer $ipnRequest) |
||
217 |
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