From df94ef71705506261c7a4586629e4b5116a4c990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Chru=C5=9Bciel?= Date: Thu, 28 Nov 2024 23:29:56 +0100 Subject: [PATCH] [Apple][Google] Add requirement to define apple and google identifiers --- src/ApplePayPayment/Form/Type/GatewayConfigurationType.php | 5 +++++ src/GooglePayPayment/Form/Type/GatewayConfigurationType.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/ApplePayPayment/Form/Type/GatewayConfigurationType.php b/src/ApplePayPayment/Form/Type/GatewayConfigurationType.php index 6d760cbf..48077df1 100644 --- a/src/ApplePayPayment/Form/Type/GatewayConfigurationType.php +++ b/src/ApplePayPayment/Form/Type/GatewayConfigurationType.php @@ -7,6 +7,7 @@ use CommerceWeavers\SyliusTpayPlugin\Form\Type\AbstractTpayGatewayConfigurationType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Validator\Constraints\NotBlank; final class GatewayConfigurationType extends AbstractTpayGatewayConfigurationType { @@ -23,6 +24,10 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'label' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.apple_pay_merchant_id', 'required' => true, 'priority' => -250, + 'constraints' => [ + new NotBlank(allowNull: false, groups: ['sylius']), + ], + 'validation_groups' => ['sylius'], ], ) ; diff --git a/src/GooglePayPayment/Form/Type/GatewayConfigurationType.php b/src/GooglePayPayment/Form/Type/GatewayConfigurationType.php index 3bc9ae8c..d65a901d 100644 --- a/src/GooglePayPayment/Form/Type/GatewayConfigurationType.php +++ b/src/GooglePayPayment/Form/Type/GatewayConfigurationType.php @@ -7,6 +7,7 @@ use CommerceWeavers\SyliusTpayPlugin\Form\Type\AbstractTpayGatewayConfigurationType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Validator\Constraints\NotBlank; final class GatewayConfigurationType extends AbstractTpayGatewayConfigurationType { @@ -23,6 +24,10 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'label' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.google_merchant_id', 'required' => true, 'priority' => -250, + 'constraints' => [ + new NotBlank(allowNull: false, groups: ['sylius']), + ], + 'validation_groups' => ['sylius'], ], ) ;