|
19 | 19 | use Symfony\Component\Form\FormBuilderInterface; |
20 | 20 | use Symfony\Component\Form\FormEvent; |
21 | 21 | use Symfony\Component\Form\FormEvents; |
| 22 | +use Symfony\Component\Validator\Constraints\NotBlank; |
22 | 23 |
|
23 | 24 | final class PayPalConfigurationType extends AbstractType |
24 | 25 | { |
@@ -48,9 +49,18 @@ public function buildForm(FormBuilderInterface $builder, array $options): void |
48 | 49 | $form |
49 | 50 | ->add('sylius_merchant_id', HiddenType::class, ['data' => self::SANDBOX_SYLIUS_MERCHANT_ID, 'attr' => ['readonly' => true]]) |
50 | 51 | ->add('partner_attribution_id', HiddenType::class, ['data' => self::SANDBOX_ATTRIBUTION_ID, 'attr' => ['readonly' => true]]) |
51 | | - ->add('client_id', TextType::class, ['label' => 'sylius.pay_pal.client_id']) |
52 | | - ->add('client_secret', TextType::class, ['label' => 'sylius.pay_pal.client_secret']) |
53 | | - ->add('merchant_id', TextType::class, ['label' => 'sylius.pay_pal.merchant_id']) |
| 52 | + ->add('client_id', TextType::class, [ |
| 53 | + 'label' => 'sylius.pay_pal.client_id', |
| 54 | + 'constraints' => [new NotBlank(['groups' => 'sylius'])], |
| 55 | + ]) |
| 56 | + ->add('client_secret', TextType::class, [ |
| 57 | + 'label' => 'sylius.pay_pal.client_secret', |
| 58 | + 'constraints' => [new NotBlank(['groups' => 'sylius'])], |
| 59 | + ]) |
| 60 | + ->add('merchant_id', TextType::class, [ |
| 61 | + 'label' => 'sylius.pay_pal.merchant_id', |
| 62 | + 'constraints' => [new NotBlank(['groups' => 'sylius'])], |
| 63 | + ]) |
54 | 64 | ; |
55 | 65 | } else { |
56 | 66 | $form |
|
0 commit comments