|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* MIT License |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Yves\Heidelpay\CheckoutPage\Process\Steps; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Shared\Kernel\Transfer\AbstractTransfer; |
|
11
|
|
|
use Spryker\Yves\StepEngine\Dependency\Step\StepWithExternalRedirectInterface; |
|
12
|
|
|
use SprykerEco\Shared\Heidelpay\HeidelpayConfig; |
|
13
|
|
|
use SprykerShop\Yves\CheckoutPage\Process\Steps\AbstractBaseStep; |
|
14
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
15
|
|
|
|
|
16
|
|
|
class HeidelpayEasycreditStep extends AbstractBaseStep implements StepWithExternalRedirectInterface |
|
17
|
|
|
{ |
|
18
|
|
|
/** |
|
19
|
|
|
* @var string |
|
20
|
|
|
*/ |
|
21
|
|
|
protected $externalRedirectUrl; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer $quoteTransfer |
|
25
|
|
|
* |
|
26
|
|
|
* @return bool |
|
27
|
|
|
*/ |
|
28
|
|
|
public function requireInput(AbstractTransfer $quoteTransfer) |
|
29
|
|
|
{ |
|
30
|
|
|
return false; |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param \Symfony\Component\HttpFoundation\Request $request |
|
35
|
|
|
* @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
|
|
|
|
|
|
36
|
|
|
* |
|
37
|
|
|
* @return \Generated\Shared\Transfer\QuoteTransfer|\Spryker\Shared\Kernel\Transfer\AbstractTransfer |
|
38
|
|
|
*/ |
|
39
|
|
|
public function execute(Request $request, AbstractTransfer $quoteTransfer) |
|
40
|
|
|
{ |
|
41
|
|
|
if ($this->isEasyCreditPaymentMethod($quoteTransfer) === false) { |
|
42
|
|
|
return $quoteTransfer; |
|
|
|
|
|
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
$this->externalRedirectUrl = $quoteTransfer->getHeidelpayPayment()->getExternalRedirectUrl(); |
|
|
|
|
|
|
46
|
|
|
|
|
47
|
|
|
return $quoteTransfer; |
|
|
|
|
|
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @return string |
|
52
|
|
|
*/ |
|
53
|
|
|
public function getExternalRedirectUrl() |
|
54
|
|
|
{ |
|
55
|
|
|
return $this->externalRedirectUrl; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer|\Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
|
60
|
|
|
* |
|
61
|
|
|
* @return bool |
|
62
|
|
|
*/ |
|
63
|
|
|
public function postCondition(AbstractTransfer $quoteTransfer) |
|
64
|
|
|
{ |
|
65
|
|
|
return true; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
|
70
|
|
|
* |
|
71
|
|
|
* @return bool |
|
72
|
|
|
*/ |
|
73
|
|
|
protected function isEasyCreditPaymentMethod(AbstractTransfer $quoteTransfer): bool |
|
74
|
|
|
{ |
|
75
|
|
|
$result = ($quoteTransfer->getPayment() !== null |
|
|
|
|
|
|
76
|
|
|
&& $quoteTransfer->getPayment()->getPaymentSelection() === HeidelpayConfig::PAYMENT_METHOD_EASY_CREDIT); |
|
77
|
|
|
|
|
78
|
|
|
return $result; |
|
79
|
|
|
} |
|
80
|
|
|
} |
|
81
|
|
|
|
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