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\Afterpay\Form; |
9
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\AfterpayPaymentTransfer; |
|
|
|
|
11
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\AbstractSubFormType; |
12
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface; |
13
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\SubFormProviderNameInterface; |
14
|
|
|
use SprykerEco\Shared\Afterpay\AfterpayConfig; |
15
|
|
|
use SprykerEco\Shared\Afterpay\AfterpayConstants; |
16
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
17
|
|
|
|
18
|
|
|
class InvoiceSubForm extends AbstractSubFormType implements SubFormInterface, SubFormProviderNameInterface |
19
|
|
|
{ |
20
|
|
|
public const PAYMENT_METHOD = AfterpayConfig::PAYMENT_METHOD_INVOICE; |
21
|
|
|
public const PAYMENT_PROVIDER = AfterpayConfig::PROVIDER_NAME; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver |
25
|
|
|
* |
26
|
|
|
* @return void |
27
|
|
|
*/ |
28
|
|
|
public function configureOptions(OptionsResolver $resolver): void |
29
|
|
|
{ |
30
|
|
|
$resolver->setDefaults([ |
31
|
|
|
'data_class' => AfterpayPaymentTransfer::class, |
32
|
|
|
SubFormInterface::OPTIONS_FIELD_NAME => [], |
33
|
|
|
]); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Specifies the property name of the payment transfer object to access the default form data. |
38
|
|
|
* Form data will be obtained from QuoteTransfer->getPayment()->getAfterpaySofort() |
39
|
|
|
* |
40
|
|
|
* @return string |
41
|
|
|
*/ |
42
|
|
|
public function getPropertyPath(): string |
43
|
|
|
{ |
44
|
|
|
return static::PAYMENT_METHOD; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Using this key, the subform will be registered inside of the twig provider and will be called |
49
|
|
|
* in payment.twig template. |
50
|
|
|
* |
51
|
|
|
* @return string |
52
|
|
|
*/ |
53
|
|
|
public function getName(): string |
54
|
|
|
{ |
55
|
|
|
return static::PAYMENT_METHOD; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Path to the form template |
60
|
|
|
* |
61
|
|
|
* @return string |
62
|
|
|
*/ |
63
|
|
|
public function getTemplatePath(): string |
64
|
|
|
{ |
65
|
|
|
return static::PAYMENT_PROVIDER . '/' . static::PAYMENT_METHOD; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return string |
70
|
|
|
*/ |
71
|
|
|
public function getProviderName(): string |
72
|
|
|
{ |
73
|
|
|
return AfterpayConfig::PROVIDER_NAME; |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|
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