|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file has been created by developers from BitBag. |
|
5
|
|
|
* Feel free to contact us once you face any issues or want to start |
|
6
|
|
|
* another great project. |
|
7
|
|
|
* You can find more information about us on https://bitbag.shop and write us |
|
8
|
|
|
* an email on [email protected]. |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
declare(strict_types=1); |
|
12
|
|
|
|
|
13
|
|
|
namespace BitBag\SyliusAdyenPlugin\Form\Type; |
|
14
|
|
|
|
|
15
|
|
|
use BitBag\SyliusAdyenPlugin\Bridge\AdyenBridgeInterface; |
|
16
|
|
|
use Symfony\Component\Form\AbstractType; |
|
17
|
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
|
18
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
19
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
|
20
|
|
|
use Symfony\Component\Validator\Constraints\NotBlank; |
|
21
|
|
|
|
|
22
|
|
|
final class AdyenGatewayConfigurationType extends AbstractType |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* {@inheritdoc} |
|
26
|
|
|
*/ |
|
27
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void |
|
28
|
|
|
{ |
|
29
|
|
|
$builder |
|
30
|
|
|
->add('environment', ChoiceType::class, [ |
|
31
|
|
|
'choices' => [ |
|
32
|
|
|
'bitbag_sylius_adyen_plugin.ui.test_platform' => AdyenBridgeInterface::TEST_ENVIRONMENT, |
|
33
|
|
|
'bitbag_sylius_adyen_plugin.ui.live_platform' => AdyenBridgeInterface::LIVE_ENVIRONMENT, |
|
34
|
|
|
], |
|
35
|
|
|
'label' => 'bitbag_sylius_adyen_plugin.ui.platform', |
|
36
|
|
|
'constraints' => [ |
|
37
|
|
|
new NotBlank([ |
|
38
|
|
|
'message' => 'bitbag_sylius_adyen_plugin.environment.not_blank', |
|
39
|
|
|
'groups' => ['sylius'], |
|
40
|
|
|
]) |
|
41
|
|
|
], |
|
42
|
|
|
]) |
|
43
|
|
|
->add('merchantAccount', TextType::class, [ |
|
44
|
|
|
'label' => 'bitbag_sylius_adyen_plugin.ui.merchant_account', |
|
45
|
|
|
'constraints' => [ |
|
46
|
|
|
new NotBlank([ |
|
47
|
|
|
'message' => 'bitbag_sylius_adyen_plugin.merchant_account.not_blank', |
|
48
|
|
|
'groups' => ['sylius'], |
|
49
|
|
|
]) |
|
50
|
|
|
], |
|
51
|
|
|
]) |
|
52
|
|
|
->add('hmacKey', TextType::class, [ |
|
53
|
|
|
'label' => 'bitbag_sylius_adyen_plugin.ui.hmac_key', |
|
54
|
|
|
'constraints' => [ |
|
55
|
|
|
new NotBlank([ |
|
56
|
|
|
'message' => 'bitbag_sylius_adyen_plugin.hmac_key.not_blank', |
|
57
|
|
|
'groups' => ['sylius'], |
|
58
|
|
|
]) |
|
59
|
|
|
], |
|
60
|
|
|
]) |
|
61
|
|
|
->add('hmacNotification', TextType::class, [ |
|
62
|
|
|
'label' => 'bitbag_sylius_adyen_plugin.ui.hmac_notification', |
|
63
|
|
|
'constraints' => [ |
|
64
|
|
|
new NotBlank([ |
|
65
|
|
|
'message' => 'bitbag_sylius_adyen_plugin.hmac_notification.not_blank', |
|
66
|
|
|
'groups' => ['sylius'], |
|
67
|
|
|
]) |
|
68
|
|
|
], |
|
69
|
|
|
]) |
|
70
|
|
|
->add('skinCode', TextType::class, [ |
|
71
|
|
|
'label' => 'bitbag_sylius_adyen_plugin.ui.skin_code', |
|
72
|
|
|
'constraints' => [ |
|
73
|
|
|
new NotBlank([ |
|
74
|
|
|
'message' => 'bitbag_sylius_adyen_plugin.skin_code.not_blank', |
|
75
|
|
|
'groups' => ['sylius'], |
|
76
|
|
|
]) |
|
77
|
|
|
], |
|
78
|
|
|
]) |
|
79
|
|
|
->add('wsUser', TextType::class, [ |
|
80
|
|
|
'label' => 'bitbag_sylius_adyen_plugin.ui.ws_user', |
|
81
|
|
|
'constraints' => [ |
|
82
|
|
|
new NotBlank([ |
|
83
|
|
|
'message' => 'bitbag_sylius_adyen_plugin.ws_user.not_blank', |
|
84
|
|
|
'groups' => ['sylius'], |
|
85
|
|
|
]) |
|
86
|
|
|
], |
|
87
|
|
|
]) |
|
88
|
|
|
->add('wsUserPassword', TextType::class, [ |
|
89
|
|
|
'label' => 'bitbag_sylius_adyen_plugin.ui.ws_user_password', |
|
90
|
|
|
'constraints' => [ |
|
91
|
|
|
new NotBlank([ |
|
92
|
|
|
'message' => 'bitbag_sylius_adyen_plugin.ws_user_password.not_blank', |
|
93
|
|
|
'groups' => ['sylius'], |
|
94
|
|
|
]) |
|
95
|
|
|
], |
|
96
|
|
|
]) |
|
97
|
|
|
; |
|
98
|
|
|
} |
|
99
|
|
|
} |
|
100
|
|
|
|