From 8d1e463929f2dc247eb368ea13048cf1bc0b8ea6 Mon Sep 17 00:00:00 2001 From: Nicolas MELONI Date: Fri, 19 Nov 2021 16:45:15 +0100 Subject: [PATCH 001/404] SYL-129 - activate oney with and w/o fees --- rulesets/phpstan.neon | 1 + src/Form/Extension/PaymentTypeExtension.php | 18 ++-- .../Type/OneyGatewayConfigurationType.php | 15 ++- src/Gateway/OneyGatewayFactory.php | 21 +++++ src/Handler/PaymentNotificationHandler.php | 14 +-- .../OneySimulationDataProvider.php | 17 ++-- .../OneySupportedPaymentChoiceProvider.php | 50 ++++++++++ src/Repository/PaymentMethodRepository.php | 91 +++++++++++++++++++ .../PaymentMethodRepositoryInterface.php | 13 +++ src/Resources/config/services.xml | 10 ++ .../Order/Show/_payment.html.twig | 2 +- src/Twig/OneySimulationExtension.php | 15 ++- 12 files changed, 240 insertions(+), 27 deletions(-) create mode 100644 src/Provider/OneySupportedPaymentChoiceProvider.php create mode 100644 src/Repository/PaymentMethodRepository.php create mode 100644 src/Repository/PaymentMethodRepositoryInterface.php diff --git a/rulesets/phpstan.neon b/rulesets/phpstan.neon index 703aa833..a1bcb7c0 100644 --- a/rulesets/phpstan.neon +++ b/rulesets/phpstan.neon @@ -6,6 +6,7 @@ parameters: excludes_analyse: # Makes PHPStan crash - ../src/DependencyInjection/Configuration.php + - ../src/Repository/PaymentMethodRepository.php - ../src/Migrations/ # Test dependencies diff --git a/src/Form/Extension/PaymentTypeExtension.php b/src/Form/Extension/PaymentTypeExtension.php index 2a4fa5fd..a7563d89 100644 --- a/src/Form/Extension/PaymentTypeExtension.php +++ b/src/Form/Extension/PaymentTypeExtension.php @@ -7,6 +7,7 @@ use PayPlug\SyliusPayPlugPlugin\Checker\OneyOrderChecker; use PayPlug\SyliusPayPlugPlugin\Gateway\OneyGatewayFactory; use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory; +use PayPlug\SyliusPayPlugPlugin\Provider\OneySupportedPaymentChoiceProvider; use Payum\Core\Model\GatewayConfigInterface; use Sylius\Bundle\CoreBundle\Form\Type\Checkout\PaymentType; use Sylius\Component\Core\Model\OrderInterface; @@ -31,28 +32,31 @@ final class PaymentTypeExtension extends AbstractTypeExtension /** @var \PayPlug\SyliusPayPlugPlugin\Checker\OneyOrderChecker */ private $orderChecker; + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider; + public function __construct( SessionInterface $session, TranslatorInterface $translator, - OneyOrderChecker $orderChecker + OneyOrderChecker $orderChecker, + OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider ) { $this->session = $session; $this->translator = $translator; $this->orderChecker = $orderChecker; + $this->oneySupportedPaymentChoiceProvider = $oneySupportedPaymentChoiceProvider; } /** * @inheritdoc */ - public function buildForm(FormBuilderInterface $builder, array $options): void - { + public function buildForm( + FormBuilderInterface $builder, + array $options + ): void { $builder ->add('oney_payment_choice', ChoiceType::class, [ 'mapped' => false, - 'choices' => [ - '3x' => 'oney_x3_with_fees', - '4x' => 'oney_x4_with_fees', - ], + 'choices' => $this->oneySupportedPaymentChoiceProvider->getSupportedPaymentChoices(true), ]) ->add('payplug_card_choice', TextType::class, [ 'mapped' => false, diff --git a/src/Gateway/Form/Type/OneyGatewayConfigurationType.php b/src/Gateway/Form/Type/OneyGatewayConfigurationType.php index 6eaa2aa7..6ec35e0e 100644 --- a/src/Gateway/Form/Type/OneyGatewayConfigurationType.php +++ b/src/Gateway/Form/Type/OneyGatewayConfigurationType.php @@ -8,6 +8,7 @@ use PayPlug\SyliusPayPlugPlugin\Gateway\Validator\Constraints\IsOneyEnabled; use PayPlug\SyliusPayPlugPlugin\Gateway\Validator\Constraints\IsPayPlugSecretKeyValid; use Sylius\Component\Core\Model\ChannelInterface; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormError; @@ -38,6 +39,18 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'help' => $this->translator->trans('payplug_sylius_payplug_plugin.ui.retrieve_secret_key_in_api_configuration_portal'), 'help_html' => true, ]) + ->add('fees_for', ChoiceType::class, [ + 'label' => 'Les frais sont : ', + 'choices' => [ + 'Répartis entre vous et le client' => 'client', + 'A votre charge' => 'merchant', + ], + 'expanded' => true, + 'validation_groups' => $validationGroups, + 'constraints' => [ + new NotBlank([]), + ], + ]) ->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event): void { $this->checkCreationRequirements( OneyGatewayFactory::FACTORY_TITLE, @@ -55,7 +68,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void continue; } $baseCurrencyCode = $baseCurrency->getCode(); - if ($baseCurrencyCode !== OneyGatewayFactory::BASE_CURRENCY_CODE) { + if (OneyGatewayFactory::BASE_CURRENCY_CODE !== $baseCurrencyCode) { $message = $this->translator->trans( 'payplug_sylius_payplug_plugin.form.base_currency_not_euro', [ diff --git a/src/Gateway/OneyGatewayFactory.php b/src/Gateway/OneyGatewayFactory.php index 7516c8f7..3fb7184f 100644 --- a/src/Gateway/OneyGatewayFactory.php +++ b/src/Gateway/OneyGatewayFactory.php @@ -10,12 +10,33 @@ final class OneyGatewayFactory extends AbstractGatewayFactory public const FACTORY_TITLE = 'Oney by PayPlug'; + public const MERCHANT_FEES = 'merchant'; + + public const CLIENT_FEES = 'client'; + public const MAX_ITEMS = 999; public const REFUND_WAIT_TIME_IN_HOURS = 48; + public const ONEY_WITH_FEES_CHOICES = [ + 'x3_with_fees', + 'x4_with_fees', + ]; + + public const ONEY_WITHOUT_FEES_CHOICES = [ + 'x3_without_fees', + 'x4_without_fees', + ]; + + public const PAYMENT_CHOICES_FEES_FOR = [ + 'merchant' => self::ONEY_WITHOUT_FEES_CHOICES, + 'client' => self::ONEY_WITH_FEES_CHOICES, + ]; + public const PAYMENT_CHOICES = [ 'oney_x3_with_fees', 'oney_x4_with_fees', + 'oney_x3_without_fees', + 'oney_x4_without_fees', ]; } diff --git a/src/Handler/PaymentNotificationHandler.php b/src/Handler/PaymentNotificationHandler.php index e0493a64..893f87d0 100644 --- a/src/Handler/PaymentNotificationHandler.php +++ b/src/Handler/PaymentNotificationHandler.php @@ -89,7 +89,7 @@ public function treat(Generic $request, IVerifiableAPIResource $paymentResource, 'message' => $paymentResource->failure->message ?? '', ]; - if ($details['status'] === PayPlugApiClientInterface::INTERNAL_STATUS_ONE_CLICK) { + if (PayPlugApiClientInterface::INTERNAL_STATUS_ONE_CLICK === $details['status']) { $this->flashBag->add('error', 'payplug_sylius_payplug_plugin.error.transaction_failed_1click'); } @@ -125,7 +125,7 @@ private function saveCard(PaymentInterface $payment, IVerifiableAPIResource $pay } // Payment has been successfully made, but card was not saved - if ($paymentResource->__get('card')->id === null) { + if (null === $paymentResource->__get('card')->id) { $this->flashBag->add('info', 'payplug_sylius_payplug_plugin.warning.payment_success_no_card_saved'); return; @@ -168,15 +168,15 @@ private function isResourceIsAuthorized(IVerifiableAPIResource $paymentResource) // Oney is reviewing the payer’s file if ($paymentResource->__isset('payment_method') && - $paymentResource->__get('payment_method') !== null && - $paymentResource->__get('payment_method')['is_pending'] === true) { + null !== $paymentResource->__get('payment_method') && + true === $paymentResource->__get('payment_method')['is_pending']) { return true; } $now = new DateTimeImmutable(); if ($paymentResource->__isset('authorization') && $paymentResource->__get('authorization') instanceof PaymentAuthorization && - $paymentResource->__get('authorization')->__get('expires_at') !== null && + null !== $paymentResource->__get('authorization')->__get('expires_at') && $now < $now->setTimestamp($paymentResource->__get('authorization')->__get('expires_at'))) { return true; } @@ -193,8 +193,8 @@ private function isRefusedOneyPayment(IVerifiableAPIResource $paymentResource): // Oney has reviewed the payer’s file and refused it if (!$paymentResource->is_paid && $paymentResource->__isset('payment_method') && - $paymentResource->__get('payment_method') !== null && - $paymentResource->__get('payment_method')['is_pending'] === false && + null !== $paymentResource->__get('payment_method') && + false === $paymentResource->__get('payment_method')['is_pending'] && \in_array($paymentResource->__get('payment_method')['type'], OneyGatewayFactory::PAYMENT_CHOICES, true) ) { return true; diff --git a/src/Provider/OneySimulation/OneySimulationDataProvider.php b/src/Provider/OneySimulation/OneySimulationDataProvider.php index babb6d8f..0b0f1b9a 100644 --- a/src/Provider/OneySimulation/OneySimulationDataProvider.php +++ b/src/Provider/OneySimulation/OneySimulationDataProvider.php @@ -6,23 +6,25 @@ use Payplug\OneySimulation; use PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface; +use PayPlug\SyliusPayPlugPlugin\Provider\OneySupportedPaymentChoiceProvider; use Psr\Log\LoggerInterface; use Sylius\Component\Core\Model\OrderInterface; final class OneySimulationDataProvider implements OneySimulationDataProviderInterface { - /** @var \PayPlug\SyliusPayPlugPlugin\ApiClient\PayPlugApiClientInterface */ - private $oneyClient; + private PayPlugApiClientInterface $oneyClient; + private LoggerInterface $payplugLogger; - /** @var \Psr\Log\LoggerInterface */ - private $payplugLogger; + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider; public function __construct( PayPlugApiClientInterface $oneyClient, - LoggerInterface $payplugLogger + LoggerInterface $payplugLogger, + OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider ) { $this->oneyClient = $oneyClient; $this->payplugLogger = $payplugLogger; + $this->oneySupportedPaymentChoiceProvider = $oneySupportedPaymentChoiceProvider; } public function getForCart(OrderInterface $cart): array @@ -32,10 +34,7 @@ public function getForCart(OrderInterface $cart): array $data = [ 'amount' => $cart->getTotal(), 'country' => $country, - 'operations' => [ - 'x3_with_fees', - 'x4_with_fees', - ], + 'operations' => $this->oneySupportedPaymentChoiceProvider->getSupportedPaymentChoices(), ]; $this->payplugLogger->debug('[PayPlug] Call oney simulation with following data', $data); diff --git a/src/Provider/OneySupportedPaymentChoiceProvider.php b/src/Provider/OneySupportedPaymentChoiceProvider.php new file mode 100644 index 00000000..36c6320f --- /dev/null +++ b/src/Provider/OneySupportedPaymentChoiceProvider.php @@ -0,0 +1,50 @@ +paymentMethodRepository = $paymentMethodRepository; + } + + public function getSupportedPaymentChoices(bool $useOneyPrefix = false): array + { + try{ + $paymentMethod = $this->paymentMethodRepository->findOneByGatewayName(OneyGatewayFactory::FACTORY_NAME); + + if (!$paymentMethod instanceof PaymentMethodInterface) { + return []; + } + + /** @var GatewayConfigInterface $gateway */ + $gateway = $paymentMethod->getGatewayConfig(); + + $config = $gateway->getConfig(); + + $values = OneyGatewayFactory::PAYMENT_CHOICES_FEES_FOR[$config['fees_for'] ?? OneyGatewayFactory::CLIENT_FEES]; + + if (!$useOneyPrefix) { + return $values; + } + + $values = array_map(function ($data): string { + return 'oney_' . $data; + }, $values); + + return $values; + } catch(\Exception $exception) { + return []; + } + } +} diff --git a/src/Repository/PaymentMethodRepository.php b/src/Repository/PaymentMethodRepository.php new file mode 100644 index 00000000..6befa61e --- /dev/null +++ b/src/Repository/PaymentMethodRepository.php @@ -0,0 +1,91 @@ +decorated = $decorated; + } + + public function findOneByGatewayName(string $gatewayFactoryName): ?PaymentMethodInterface + { + return $this->decorated->createQueryBuilder('o') + ->innerJoin('o.gatewayConfig', 'gatewayConfig') + ->where('gatewayConfig.factoryName = :gatewayFactoryName') + ->setParameter('gatewayFactoryName', $gatewayFactoryName) + ->getQuery() + ->setMaxResults(1) + ->getSingleResult() + ; + } + + /** + * @inheritdoc + */ + public function find($id) + { + return $this->decorated->find($id); + } + + public function findAll() + { + return $this->decorated->findAll(); + } + + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) + { + return $this->decorated->findBy($criteria, $orderBy, $limit, $offset); + } + + public function findOneBy(array $criteria) + { + return $this->decorated->findOneBy($criteria); + } + + public function getClassName() + { + return $this->getClassName(); + } + + public function createListQueryBuilder(string $locale): QueryBuilder + { + return $this->decorated->createListQueryBuilder($locale); + } + + public function findEnabledForChannel(ChannelInterface $channel): array + { + return $this->decorated->findEnabledForChannel($channel); + } + + public function findByName(string $name, string $locale): array + { + return $this->decorated->findByName($name, $locale); + } + + public function createPaginator(array $criteria = [], array $sorting = []): iterable + { + return $this->decorated->createPaginator($criteria, $sorting); + } + + public function add(ResourceInterface $resource): void + { + $this->decorated->add($resource); + } + + public function remove(ResourceInterface $resource): void + { + $this->decorated->remove($resource); + } +} diff --git a/src/Repository/PaymentMethodRepositoryInterface.php b/src/Repository/PaymentMethodRepositoryInterface.php new file mode 100644 index 00000000..54f8c2e9 --- /dev/null +++ b/src/Repository/PaymentMethodRepositoryInterface.php @@ -0,0 +1,13 @@ + + + + + + diff --git a/src/Resources/views/SyliusAdminBundle/Order/Show/_payment.html.twig b/src/Resources/views/SyliusAdminBundle/Order/Show/_payment.html.twig index 8fe665bf..0433037d 100755 --- a/src/Resources/views/SyliusAdminBundle/Order/Show/_payment.html.twig +++ b/src/Resources/views/SyliusAdminBundle/Order/Show/_payment.html.twig @@ -20,7 +20,7 @@
{{ 'payplug_sylius_payplug_plugin.ui.payplug_id'|trans({'%paymentId%': payment.details.payment_id}) }} {% if payment.method.gatewayConfig.factoryName == constant('\\PayPlug\\SyliusPayPlugPlugin\\Gateway\\OneyGatewayFactory::FACTORY_NAME') %} -
{{ 'payplug_sylius_payplug_plugin.ui.oney'|trans }} +
{{ 'payplug_sylius_payplug_plugin.ui.oney'|trans }} {% if payment.details.payment_method is defined %}({{ payment.details.payment_method }}){% endif %} {% endif %} {% if payment.details.is_live is defined and payment.details.is_live == false %}
{{ 'payplug_sylius_payplug_plugin.ui.test_mode'|trans }} diff --git a/src/Twig/OneySimulationExtension.php b/src/Twig/OneySimulationExtension.php index 6f2d7097..b3822cfc 100644 --- a/src/Twig/OneySimulationExtension.php +++ b/src/Twig/OneySimulationExtension.php @@ -5,6 +5,7 @@ namespace PayPlug\SyliusPayPlugPlugin\Twig; use PayPlug\SyliusPayPlugPlugin\Provider\OneySimulation\OneySimulationDataProviderInterface; +use PayPlug\SyliusPayPlugPlugin\Provider\OneySupportedPaymentChoiceProvider; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Repository\OrderRepositoryInterface; use Sylius\Component\Order\Context\CartContextInterface; @@ -27,22 +28,27 @@ final class OneySimulationExtension extends AbstractExtension /** @var \Sylius\Component\Core\Repository\OrderRepositoryInterface */ private $orderRepository; + private OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider; + public function __construct( CartContextInterface $cartContext, OneySimulationDataProviderInterface $oneySimulationDataProvider, RequestStack $requestStack, - OrderRepositoryInterface $orderRepository + OrderRepositoryInterface $orderRepository, + OneySupportedPaymentChoiceProvider $oneySupportedPaymentChoiceProvider ) { $this->cartContext = $cartContext; $this->oneySimulationDataProvider = $oneySimulationDataProvider; $this->requestStack = $requestStack; $this->orderRepository = $orderRepository; + $this->oneySupportedPaymentChoiceProvider = $oneySupportedPaymentChoiceProvider; } public function getFunctions(): array { return [ new TwigFunction('oney_simulation_data', [$this, 'getSimulationData']), + new TwigFunction('oney_supported_choices', [$this, 'getSupportedPaymentChoices']), ]; } @@ -55,7 +61,7 @@ private function getCartOrOrder(): OrderInterface { $currentRequest = $this->requestStack->getCurrentRequest(); - if (!$currentRequest instanceof Request || $currentRequest->get('_route') !== 'sylius_shop_order_show') { + if (!$currentRequest instanceof Request || 'sylius_shop_order_show' !== $currentRequest->get('_route')) { /** @var OrderInterface $cart */ $cart = $this->cartContext->getCart(); @@ -70,4 +76,9 @@ private function getCartOrOrder(): OrderInterface return $order; } + + public function getSupportedPaymentChoices(): array + { + return $this->oneySupportedPaymentChoiceProvider->getSupportedPaymentChoices(); + } } From e114e9766d74a57b2006947299f4b85f9042e4b9 Mon Sep 17 00:00:00 2001 From: maxperei Date: Fri, 26 Nov 2021 10:33:40 +0100 Subject: [PATCH 002/404] exclude popped project folder from git --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f3101a24..88b66083 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ /etc/build/* !/etc/build/.gitignore -/tests/Application/yarn.lock +/tests/Application/* /behat.yml /phpspec.yml From c9a5d62a4b530751d03c4bc80999468ca39ce6fa Mon Sep 17 00:00:00 2001 From: maxperei Date: Fri, 26 Nov 2021 10:33:51 +0100 Subject: [PATCH 003/404] stylize oney gateway config type rows w/ wording --- .../Type/OneyGatewayConfigurationType.php | 8 ++-- src/Resources/translations/messages.en.yml | 8 ++++ src/Resources/translations/messages.fr.yml | 8 ++++ src/Resources/translations/messages.it.yml | 8 ++++ .../form/form_gateway_config_row.html.twig | 38 ++++++++++++++++++- 5 files changed, 64 insertions(+), 6 deletions(-) diff --git a/src/Gateway/Form/Type/OneyGatewayConfigurationType.php b/src/Gateway/Form/Type/OneyGatewayConfigurationType.php index 6ec35e0e..0e2c2abc 100644 --- a/src/Gateway/Form/Type/OneyGatewayConfigurationType.php +++ b/src/Gateway/Form/Type/OneyGatewayConfigurationType.php @@ -36,14 +36,14 @@ public function buildForm(FormBuilderInterface $builder, array $options): void new IsPayPlugSecretKeyValid(), new IsOneyEnabled(), ], - 'help' => $this->translator->trans('payplug_sylius_payplug_plugin.ui.retrieve_secret_key_in_api_configuration_portal'), + 'help' => 'payplug_sylius_payplug_plugin.ui.retrieve_secret_key_in_api_configuration_portal', 'help_html' => true, ]) ->add('fees_for', ChoiceType::class, [ - 'label' => 'Les frais sont : ', + 'label' => 'payplug_sylius_payplug_plugin.ui.oney_gateway_config.fees_for.title', 'choices' => [ - 'Répartis entre vous et le client' => 'client', - 'A votre charge' => 'merchant', + 'payplug_sylius_payplug_plugin.ui.oney_gateway_config.fees_for.client' => 'client', + 'payplug_sylius_payplug_plugin.ui.oney_gateway_config.fees_for.merchant' => 'merchant', ], 'expanded' => true, 'validation_groups' => $validationGroups, diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index fb129f59..254937a4 100644 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -71,6 +71,14 @@ payplug_sylius_payplug_plugin: invalid_cart_price: To pay with Oney, the total amount of your cart must be between %min_amount% and %max_amount%. refund_minimum_amount_requirement_not_met: The amount to be refunded must be at least €0.10 oney_unavailable: Your payment schedule simulation is temporarily unavailable. You will find this information at the payment stage. + oney_gateway_config: + info: | + Allow your customers to schedule payments of their orders in 3 or 4 installments starting from 100€ to 3000€. + Find out more. + fees_for: + title: 'Fees for:' + client: Beetween customer and merchant + merchant: At your expense form: oney_error: Some missing information is required to pay using Oney by Payplug complete_info: diff --git a/src/Resources/translations/messages.fr.yml b/src/Resources/translations/messages.fr.yml index a1e62fe4..275fa8c9 100644 --- a/src/Resources/translations/messages.fr.yml +++ b/src/Resources/translations/messages.fr.yml @@ -73,6 +73,14 @@ payplug_sylius_payplug_plugin: invalid_cart_price: Le montant total de votre panier doit être compris entre %min_amount% et %max_amount% pour payer avec Oney. refund_minimum_amount_requirement_not_met: Le montant à rembourser doit être d'au moins 0.10€ oney_unavailable: La simulation de votre échéancier est temporairement indisponible. Vous retrouverez cette information à l'étape du paiement. + oney_gateway_config: + info: | + Permettez à vos clients d’échelonner le paiement de leurs commandes en 3x, 4x à partir de 100€ jusqu’à 3000€. + En savoir plus. + fees_for: + title: 'Les frais sont :' + client: Répartis entre vous et le client + merchant: À votre charge form: oney_error: Il y a des informations manquantes pour pouvoir payer en utilisant Oney by Payplug complete_info: diff --git a/src/Resources/translations/messages.it.yml b/src/Resources/translations/messages.it.yml index 891a93e7..48bd2705 100644 --- a/src/Resources/translations/messages.it.yml +++ b/src/Resources/translations/messages.it.yml @@ -71,6 +71,14 @@ payplug_sylius_payplug_plugin: invalid_cart_price: L’importo totale del tuo carrello deve essere compreso tra %min_amount% e %max_amount% per poter pagare con Oney. refund_minimum_amount_requirement_not_met: L’importo da rimborsare non può essere inferiore a 0.10€ oney_unavailable: La simulazione del tuo piano di finanziamento non è per il momento disponibile. Queste informazioni ti saranno fornite al momento del pagamento. + oney_gateway_config: + info: | + Permetti ai tuoi clienti di pagare i loro acquisti in 3x, 4x a partire da 100€ fino a 3000€. + Per saperne di più. + fees_for: + title: 'Le spece sono :' + client: Spartite tra te e il tuo cliente + merchant: Al tuo carico form: oney_error: Mancano alcune informazioni per poter pagare con “Oney by Payplug” complete_info: diff --git a/src/Resources/views/form/form_gateway_config_row.html.twig b/src/Resources/views/form/form_gateway_config_row.html.twig index 010c66b8..f9a27e4a 100644 --- a/src/Resources/views/form/form_gateway_config_row.html.twig +++ b/src/Resources/views/form/form_gateway_config_row.html.twig @@ -1,4 +1,18 @@ +{% block _sylius_payment_method_gatewayConfig_factoryName_row %} +
+
+
+
{{ ('payplug_sylius_payplug_plugin.ui.oney_gateway_config.info')|trans({'%link%': 'https://github.com/paylpug/SyliusPayPlugPlugin'})|raw }}
+
+
+
+
+ {{- form_row(form) -}} +
+{% endblock %} + {% block _sylius_payment_method_gatewayConfig_config_secretKey_row %} +
{# close previous to avoid 2 columns #}
{{- form_label(form) -}} {{- form_widget(form) -}} @@ -7,6 +21,26 @@ {{- form_errors(form) -}}
+
+{% endblock %} + +{% block _sylius_payment_method_gatewayConfig_config_fees_for_row %} +
+
+
+ {{ form_label(form) }} +
+ {%- for child in form %} +
+
+ {{- form_label(child, null, {translation_domain: choice_translation_domain}) -}} + {{- form_widget(child, sylius_test_form_attribute('option')) -}} +
+
+ {% endfor -%} +
+ {{- form_errors(form) -}} +
{% endblock %} {% block _sylius_payment_method_gatewayConfig_config_oneClick_row %} @@ -71,9 +105,9 @@ >