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\SyliusPrzelewy24Plugin\Form\Type; |
14
|
|
|
|
15
|
|
|
use BitBag\SyliusPrzelewy24Plugin\Bridge\Przelewy24BridgeInterface; |
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 Przelewy24GatewayConfigurationType extends AbstractType |
23
|
|
|
{ |
24
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void |
25
|
|
|
{ |
26
|
|
|
$builder |
27
|
|
|
->add('merchant_id', TextType::class, [ |
28
|
|
|
'label' => 'bitbag_sylius_przelewy24_plugin.ui.merchant_id', |
29
|
|
|
'constraints' => [ |
30
|
|
|
new NotBlank([ |
31
|
|
|
'message' => 'bitbag_sylius_przelewy24_plugin.merchant_id.not_blank', |
32
|
|
|
'groups' => ['sylius'], |
33
|
|
|
]), |
34
|
|
|
], |
35
|
|
|
]) |
36
|
|
|
->add('crc_key', TextType::class, [ |
37
|
|
|
'label' => 'bitbag_sylius_przelewy24_plugin.ui.crc_key', |
38
|
|
|
'constraints' => [ |
39
|
|
|
new NotBlank([ |
40
|
|
|
'message' => 'bitbag_sylius_przelewy24_plugin.crc_key.not_blank', |
41
|
|
|
'groups' => ['sylius'], |
42
|
|
|
]), |
43
|
|
|
], |
44
|
|
|
]) |
45
|
|
|
->add('environment', ChoiceType::class, [ |
46
|
|
|
'choices' => [ |
47
|
|
|
'bitbag_sylius_przelewy24_plugin.ui.sandbox' => Przelewy24BridgeInterface::SANDBOX_ENVIRONMENT, |
48
|
|
|
'bitbag_sylius_przelewy24_plugin.ui.production' => Przelewy24BridgeInterface::PRODUCTION_ENVIRONMENT, |
49
|
|
|
], |
50
|
|
|
'label' => 'bitbag_sylius_przelewy24_plugin.ui.environment', |
51
|
|
|
'constraints' => [ |
52
|
|
|
new NotBlank([ |
53
|
|
|
'message' => 'bitbag_sylius_przelewy24_plugin.environment.not_blank', |
54
|
|
|
'groups' => ['sylius'], |
55
|
|
|
]), |
56
|
|
|
], |
57
|
|
|
]) |
58
|
|
|
; |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|