diff --git a/assets/admin/js/test_payment_method_connection.js b/assets/admin/js/test_payment_method_connection.js index 1f101703..9b185a0e 100644 --- a/assets/admin/js/test_payment_method_connection.js +++ b/assets/admin/js/test_payment_method_connection.js @@ -91,13 +91,6 @@ function convertTpayChannelIdInputIntoSelect(channels) { tpayChannelIdFormType.innerHTML = ''; - const displayAllOption = document.createElement('option'); - displayAllOption.value = ''; - console.log(tpayChannelIdFormType.dataset); - displayAllOption.text = tpayChannelIdFormType.dataset.displayAllLabel; - - tpayChannelIdFormType.appendChild(displayAllOption); - for (const [id, name] of Object.entries(channels)) { const option = document.createElement('option'); option.value = id; diff --git a/config/config/sylius_fixtures.php b/config/config/sylius_fixtures.php index 08814a06..ebe78f4b 100644 --- a/config/config/sylius_fixtures.php +++ b/config/config/sylius_fixtures.php @@ -119,9 +119,9 @@ ], 'pbl_channel' => [ 'code' => 'tpay_pbl_channel', - 'name' => 'Pay-by-link one channel (Tpay)', - 'gatewayFactory' => 'tpay_pbl', - 'gatewayName' => 'tpay_pbl', + 'name' => 'Pay-by-link single channel (Tpay)', + 'gatewayFactory' => 'tpay_pbl_channel', + 'gatewayName' => 'tpay_pbl_channel', 'gatewayConfig' => $tpayConfig + [ 'tpay_channel_id' => '%env(string:TPAY_PBL_CHANNEL_ID)%', ], diff --git a/config/config/sylius_template_events.php b/config/config/sylius_template_events.php index f2737518..74e3894f 100644 --- a/config/config/sylius_template_events.php +++ b/config/config/sylius_template_events.php @@ -41,6 +41,10 @@ 'template' => '@CommerceWeaversSyliusTpayPlugin/shop/order/pay/_payByLink.html.twig', 'priority' => 10, ], + 'pay_by_link_channel' => [ + 'template' => '@CommerceWeaversSyliusTpayPlugin/shop/order/pay/_payByLinkChannel.html.twig', + 'priority' => 10, + ], 'google_pay' => [ 'template' => '@CommerceWeaversSyliusTpayPlugin/shop/order/pay/_google_pay_regulations.html.twig', 'priority' => 5, @@ -69,6 +73,10 @@ 'template' => '@CommerceWeaversSyliusTpayPlugin/shop/cart/complete/_payByLink.html.twig', 'priority' => 5, ], + 'pay_by_link_channel' => [ + 'template' => '@CommerceWeaversSyliusTpayPlugin/shop/cart/complete/_payByLinkChannel.html.twig', + 'priority' => 5, + ], 'visa_mobile' => [ 'template' => '@CommerceWeaversSyliusTpayPlugin/shop/cart/complete/_visaMobile.html.twig', 'priority' => 5, diff --git a/config/services/pay_by_link_channel_payment/form.php b/config/services/pay_by_link_channel_payment/form.php new file mode 100644 index 00000000..a650bf3e --- /dev/null +++ b/config/services/pay_by_link_channel_payment/form.php @@ -0,0 +1,9 @@ +import('form/**/*.php'); +}; diff --git a/config/services/pay_by_link_channel_payment/form/type.php b/config/services/pay_by_link_channel_payment/form/type.php new file mode 100644 index 00000000..3ccf51df --- /dev/null +++ b/config/services/pay_by_link_channel_payment/form/type.php @@ -0,0 +1,22 @@ +services(); + + $services->set('commerce_weavers_sylius_tpay.pay_by_link_channel_payment.form.type.gateway_configuration', GatewayConfigurationType::class) + ->args([ + service('translator'), + ]) + ->parent('commerce_weavers_sylius_tpay.form.type.abstract_tpay_gateway_configuration') + ->tag('sylius.gateway_configuration_type', ['label' => 'commerce_weavers_sylius_tpay.admin.gateway_name.tpay_channel_pbl', 'type' => GatewayFactory::NAME]) + ->tag('form.type') + ; +}; diff --git a/config/services/pay_by_link_channel_payment/payum.php b/config/services/pay_by_link_channel_payment/payum.php new file mode 100644 index 00000000..cbc99101 --- /dev/null +++ b/config/services/pay_by_link_channel_payment/payum.php @@ -0,0 +1,9 @@ +import('payum/**/*.php'); +}; diff --git a/config/services/pay_by_link_channel_payment/payum/action.php b/config/services/pay_by_link_channel_payment/payum/action.php new file mode 100644 index 00000000..1702d5c8 --- /dev/null +++ b/config/services/pay_by_link_channel_payment/payum/action.php @@ -0,0 +1,24 @@ +services(); + + $services->defaults() + ->public() + ; + + $services->set(CreatePayByLinkTransactionAction::class) + ->args([ + service('commerce_weavers_sylius_tpay.tpay.factory.create_pay_by_link_payment_payload'), + service('commerce_weavers_sylius_tpay.payum.factory.token.notify'), + ]) + ->tag('payum.action', ['factory' => GatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.create_pay_by_link_channel_transaction']) + ; +}; diff --git a/config/services/pay_by_link_channel_payment/payum/factory.php b/config/services/pay_by_link_channel_payment/payum/factory.php new file mode 100644 index 00000000..2bd1b7b0 --- /dev/null +++ b/config/services/pay_by_link_channel_payment/payum/factory.php @@ -0,0 +1,19 @@ +services(); + + $services->set('commerce_weavers_sylius_tpay.pay_by_link_channel_payment.payum.factory.gateway', GatewayFactoryBuilder::class) + ->args([ + GatewayFactory::class, + ]) + ->tag('payum.gateway_factory_builder', ['factory' => GatewayFactory::NAME]) + ; +}; diff --git a/config/services/pay_by_link_payment/form/type.php b/config/services/pay_by_link_payment/form/type.php index ee5ac4fc..41645abd 100644 --- a/config/services/pay_by_link_payment/form/type.php +++ b/config/services/pay_by_link_payment/form/type.php @@ -12,9 +12,6 @@ $services = $container->services(); $services->set('commerce_weavers_sylius_tpay.pay_by_link_payment.form.type.gateway_configuration', GatewayConfigurationType::class) - ->args([ - service('translator'), - ]) ->parent('commerce_weavers_sylius_tpay.form.type.abstract_tpay_gateway_configuration') ->tag('sylius.gateway_configuration_type', ['label' => 'commerce_weavers_sylius_tpay.admin.gateway_name.tpay_pbl', 'type' => GatewayFactory::NAME]) ->tag('form.type') diff --git a/config/services/payum/action.php b/config/services/payum/action.php index 39a55e7b..52a92fd2 100644 --- a/config/services/payum/action.php +++ b/config/services/payum/action.php @@ -9,6 +9,7 @@ use CommerceWeavers\SyliusTpayPlugin\CardPayment\Payum\Factory\GatewayFactory as CardGatewayFactory; use CommerceWeavers\SyliusTpayPlugin\GooglePayPayment\Payum\Factory\GatewayFactory as GooglePayGatewayFactory; use CommerceWeavers\SyliusTpayPlugin\PayByLinkPayment\Payum\Factory\GatewayFactory as PayByLinkGatewayFactory; +use CommerceWeavers\SyliusTpayPlugin\PayByLinkChannelPayment\Payum\Factory\GatewayFactory as PayByLinkChannelGatewayFactory; use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\NotifyAction; use CommerceWeavers\SyliusTpayPlugin\Payum\Action\CaptureAction; use CommerceWeavers\SyliusTpayPlugin\Payum\Action\GetStatusAction; @@ -35,6 +36,7 @@ ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.capture']) ->tag('payum.action', ['factory' => GooglePayGatewayFactory::NAME, 'alias' => 'cw.tpay_google_pay.capture']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.capture']) + ->tag('payum.action', ['factory' => PayByLinkChannelGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl_channel.capture']) ->tag('payum.action', ['factory' => RedirectGatewayFactory::NAME, 'alias' => 'cw.tpay_redirect.capture']) ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.capture']) ; @@ -50,6 +52,7 @@ ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.notify']) ->tag('payum.action', ['factory' => GooglePayGatewayFactory::NAME, 'alias' => 'cw.tpay_google_pay.notify']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.notify']) + ->tag('payum.action', ['factory' => PayByLinkChannelGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl_channel.notify']) ->tag('payum.action', ['factory' => RedirectGatewayFactory::NAME, 'alias' => 'cw.tpay_redirect.notify']) ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.notify']) ; @@ -60,6 +63,7 @@ ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.get_status']) ->tag('payum.action', ['factory' => GooglePayGatewayFactory::NAME, 'alias' => 'cw.tpay_google_pay.get_status']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.get_status']) + ->tag('payum.action', ['factory' => PayByLinkChannelGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl_channel.get_status']) ->tag('payum.action', ['factory' => RedirectGatewayFactory::NAME, 'alias' => 'cw.tpay_redirect.get_status']) ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.get_status']) ; @@ -70,6 +74,7 @@ ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.partial_refund']) ->tag('payum.action', ['factory' => GooglePayGatewayFactory::NAME, 'alias' => 'cw.tpay_google_pay.partial_refund']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.partial_refund']) + ->tag('payum.action', ['factory' => PayByLinkChannelGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl_channel.partial_refund']) ->tag('payum.action', ['factory' => RedirectGatewayFactory::NAME, 'alias' => 'cw.tpay_redirect.partial_refund']) ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.partial_refund']) ; @@ -80,6 +85,7 @@ ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.refund']) ->tag('payum.action', ['factory' => GooglePayGatewayFactory::NAME, 'alias' => 'cw.tpay_google_pay.refund']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.refund']) + ->tag('payum.action', ['factory' => PayByLinkChannelGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl_channel.refund']) ->tag('payum.action', ['factory' => RedirectGatewayFactory::NAME, 'alias' => 'cw.tpay_redirect.refund']) ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.refund']) ; @@ -90,6 +96,7 @@ ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.resolve_next_route']) ->tag('payum.action', ['factory' => GooglePayGatewayFactory::NAME, 'alias' => 'cw.tpay_google_pay.resolve_next_route']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.resolve_next_route']) + ->tag('payum.action', ['factory' => PayByLinkChannelGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl_channel.resolve_next_route']) ->tag('payum.action', ['factory' => RedirectGatewayFactory::NAME, 'alias' => 'cw.tpay_redirect.resolve_next_route']) ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.resolve_next_route']) ; diff --git a/migrations/Version20250120115438.php b/migrations/Version20250120115438.php new file mode 100644 index 00000000..eb47b8ce --- /dev/null +++ b/migrations/Version20250120115438.php @@ -0,0 +1,43 @@ +addSql(" + UPDATE sylius_gateway_config + SET + gateway_name = 'tpay_pbl_channel', + factory_name = 'tpay_pbl_channel' + WHERE gateway_name = 'tpay_pbl' + AND JSON_EXTRACT(config, '$.tpay_channel_id') IS NOT NULL + "); + } + + public function down(Schema $schema): void + { + $this->addSql(" + UPDATE sylius_gateway_config + SET + gateway_name = 'tpay_pbl', + factory_name = 'tpay_pbl' + WHERE gateway_name = 'tpay_pbl_channel' + AND JSON_EXTRACT(config, '$.tpay_channel_id') IS NOT NULL + "); + } +} diff --git a/src/PayByLinkChannelPayment/Form/Type/GatewayConfigurationType.php b/src/PayByLinkChannelPayment/Form/Type/GatewayConfigurationType.php new file mode 100644 index 00000000..70ca58e5 --- /dev/null +++ b/src/PayByLinkChannelPayment/Form/Type/GatewayConfigurationType.php @@ -0,0 +1,44 @@ +add( + 'tpay_channel_id', + TextType::class, + [ + 'empty_data' => '', + 'label' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.tpay_channel_id', + 'validation_groups' => ['sylius'], + 'constraints' => [ + new NotBlank(allowNull: false, groups: ['sylius']), + ], + 'help' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.tpay_channel_id_help', + 'required' => false, + ], + ) + ; + } +} diff --git a/src/PayByLinkChannelPayment/Payum/Action/CreatePayByLinkTransactionAction.php b/src/PayByLinkChannelPayment/Payum/Action/CreatePayByLinkTransactionAction.php new file mode 100644 index 00000000..fd5d643f --- /dev/null +++ b/src/PayByLinkChannelPayment/Payum/Action/CreatePayByLinkTransactionAction.php @@ -0,0 +1,70 @@ +notifyTokenFactory->create($model, $gatewayName, $localeCode); + + $this->do( + fn () => $this->api->transactions()->createTransaction( + $this->createPayByLinkPayloadFactory->createFrom($model, $notifyToken->getTargetUrl(), $localeCode), + ), + onSuccess: function (array $response) use ($paymentDetails) { + $paymentDetails->setTransactionId($response['transactionId']); + $paymentDetails->setStatus($response['status']); + $paymentDetails->setPaymentUrl($response['transactionPaymentUrl']); + }, + onFailure: fn () => $paymentDetails->setStatus(PaymentInterface::STATE_FAILED), + ); + } + + protected function postExecute(PaymentInterface $model, PaymentDetails $paymentDetails, string $gatewayName, string $localeCode): void + { + if ($paymentDetails->getPaymentUrl() !== null) { + throw new HttpRedirect($paymentDetails->getPaymentUrl()); + } + } + + public function supports($request): bool + { + if (!$request instanceof CreateTransaction) { + return false; + } + + $model = $request->getModel(); + + if (!$model instanceof PaymentInterface) { + return false; + } + + $paymentDetails = PaymentDetails::fromArray($model->getDetails()); + + return $paymentDetails->getType() === PaymentType::PAY_BY_LINK; + } +} diff --git a/src/PayByLinkChannelPayment/Payum/Factory/GatewayFactory.php b/src/PayByLinkChannelPayment/Payum/Factory/GatewayFactory.php new file mode 100644 index 00000000..abb95791 --- /dev/null +++ b/src/PayByLinkChannelPayment/Payum/Factory/GatewayFactory.php @@ -0,0 +1,17 @@ +getGatewayConfig(); - if (null === $gatewayConfig || GatewayName::PAY_BY_LINK !== $gatewayConfig->getFactoryName()) { + if (null === $gatewayConfig || (GatewayName::PAY_BY_LINK !== $gatewayConfig->getFactoryName() && GatewayName::PAY_BY_LINK_CHANNEL !== $gatewayConfig->getFactoryName())) { return true; } diff --git a/src/PayByLinkPayment/ContextProvider/BankListContextProvider.php b/src/PayByLinkPayment/ContextProvider/BankListContextProvider.php index b5595385..d2518602 100644 --- a/src/PayByLinkPayment/ContextProvider/BankListContextProvider.php +++ b/src/PayByLinkPayment/ContextProvider/BankListContextProvider.php @@ -4,6 +4,7 @@ namespace CommerceWeavers\SyliusTpayPlugin\PayByLinkPayment\ContextProvider; +use CommerceWeavers\SyliusTpayPlugin\PayByLinkChannelPayment\Payum\Factory\GatewayFactory as PayByLinkChannelGatewayFactory; use CommerceWeavers\SyliusTpayPlugin\PayByLinkPayment\Payum\Factory\GatewayFactory as PayByLinkGatewayFactory; use CommerceWeavers\SyliusTpayPlugin\Tpay\Provider\OrderAwareValidTpayChannelListProviderInterface; use CommerceWeavers\SyliusTpayPlugin\Tpay\Provider\ValidTpayChannelListProviderInterface; @@ -40,7 +41,8 @@ public function provide(array $templateContext, TemplateBlock $templateBlock): a if ( null === $paymentMethod || null === $gatewayConfig || - PayByLinkGatewayFactory::NAME !== $gatewayConfig->getFactoryName() + PayByLinkGatewayFactory::NAME !== $gatewayConfig->getFactoryName() && + PayByLinkChannelGatewayFactory::NAME !== $gatewayConfig->getFactoryName() ) { return $templateContext; } @@ -62,8 +64,7 @@ public function provide(array $templateContext, TemplateBlock $templateBlock): a $templateContext['banks'] = null === $order ? $this->validTpayChannelListProvider->provide() - : $this->orderAwareValidTpayChannelListProvider->provide($order) - ; + : $this->orderAwareValidTpayChannelListProvider->provide($order); } return $templateContext; @@ -72,9 +73,8 @@ public function provide(array $templateContext, TemplateBlock $templateBlock): a public function supports(TemplateBlock $templateBlock): bool { return - 'pay_by_link' === $templateBlock->getName() && - in_array($templateBlock->getEventName(), self::SUPPORTED_TEMPLATE_BLOCK_EVENT_NAMES, true) - ; + ('pay_by_link' === $templateBlock->getName() || 'pay_by_link_channel' === $templateBlock->getName()) && + in_array($templateBlock->getEventName(), self::SUPPORTED_TEMPLATE_BLOCK_EVENT_NAMES, true); } private function resolvePaymentMethod(array $templateContext): ?PaymentMethodInterface diff --git a/src/PayByLinkPayment/Form/Type/GatewayConfigurationType.php b/src/PayByLinkPayment/Form/Type/GatewayConfigurationType.php index b7d315b5..12e605dc 100644 --- a/src/PayByLinkPayment/Form/Type/GatewayConfigurationType.php +++ b/src/PayByLinkPayment/Form/Type/GatewayConfigurationType.php @@ -7,39 +7,13 @@ use CommerceWeavers\SyliusTpayPlugin\Form\EventListener\DecryptGatewayConfigListenerInterface; use CommerceWeavers\SyliusTpayPlugin\Form\EventListener\EncryptGatewayConfigListenerInterface; use CommerceWeavers\SyliusTpayPlugin\Form\Type\AbstractTpayGatewayConfigurationType; -use Symfony\Component\Form\Extension\Core\Type\TextType; -use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Contracts\Translation\TranslatorInterface; final class GatewayConfigurationType extends AbstractTpayGatewayConfigurationType { public function __construct( DecryptGatewayConfigListenerInterface $decryptGatewayConfigListener, EncryptGatewayConfigListenerInterface $encryptGatewayConfigListener, - private readonly TranslatorInterface $translator, ) { parent::__construct($decryptGatewayConfigListener, $encryptGatewayConfigListener); } - - public function buildForm(FormBuilderInterface $builder, array $options): void - { - parent::buildForm($builder, $options); - - $builder - ->add( - 'tpay_channel_id', - TextType::class, - [ - 'empty_data' => '', - 'label' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.tpay_channel_id', - 'help' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.tpay_channel_id_help', - 'required' => false, - 'attr' => [ - 'placeholder' => $this->translator->trans('commerce_weavers_sylius_tpay.admin.gateway_configuration.tpay_display_all_channels', domain: 'messages'), - 'data-display-all-label' => $this->translator->trans('commerce_weavers_sylius_tpay.admin.gateway_configuration.tpay_display_all_channels', domain: 'messages'), - ], - ], - ) - ; - } } diff --git a/src/Tpay/GatewayName.php b/src/Tpay/GatewayName.php index b641e7a4..b287eecd 100644 --- a/src/Tpay/GatewayName.php +++ b/src/Tpay/GatewayName.php @@ -16,6 +16,8 @@ class GatewayName public const PAY_BY_LINK = 'tpay_pbl'; + public const PAY_BY_LINK_CHANNEL = 'tpay_pbl_channel'; + public const REDIRECT = 'tpay_redirect'; public const VISA_MOBILE = 'tpay_visa_mobile'; @@ -31,6 +33,7 @@ public static function all(): array self::CARD, self::GOOGLE_PAY, self::PAY_BY_LINK, + self::PAY_BY_LINK_CHANNEL, self::REDIRECT, self::VISA_MOBILE, ]; diff --git a/templates/shop/cart/complete/_payByLink.html.twig b/templates/shop/cart/complete/_payByLink.html.twig index 0188e246..006e299e 100644 --- a/templates/shop/cart/complete/_payByLink.html.twig +++ b/templates/shop/cart/complete/_payByLink.html.twig @@ -1,5 +1,5 @@ {% set payment = order.lastCartPayment() %} -{% if payment is not null and payment.method.gatewayConfig.gatewayName == 'tpay_pbl' %} +{% if payment is not null and payment.method.gatewayConfig.gatewayName == 'tpay_pbl'%} {% include '@CommerceWeaversSyliusTpayPlugin/shop/payment/_payByLink.html.twig' %} {% endif %} diff --git a/templates/shop/cart/complete/_payByLinkChannel.html.twig b/templates/shop/cart/complete/_payByLinkChannel.html.twig new file mode 100644 index 00000000..ea4b7b33 --- /dev/null +++ b/templates/shop/cart/complete/_payByLinkChannel.html.twig @@ -0,0 +1,5 @@ +{% set payment = order.lastCartPayment() %} + +{% if payment is not null and payment.method.gatewayConfig.gatewayName == 'tpay_pbl_channel'%} + {% include '@CommerceWeaversSyliusTpayPlugin/shop/payment/_payByLinkChannel.html.twig' %} +{% endif %} diff --git a/templates/shop/order/pay/_payByLink.html.twig b/templates/shop/order/pay/_payByLink.html.twig index 60fbb378..39c62e8b 100644 --- a/templates/shop/order/pay/_payByLink.html.twig +++ b/templates/shop/order/pay/_payByLink.html.twig @@ -1,4 +1,4 @@ -{% if method.gatewayConfig.gatewayName == 'tpay_pbl' and form.vars.value.state != 'cart' %} +{% if (method.gatewayConfig.gatewayName == 'tpay_pbl' or method.gatewayConfig.gatewayName == 'tpay_pbl_channel') and form.vars.value.state != 'cart' %}
diff --git a/templates/shop/order/pay/_payByLinkChannel.html.twig b/templates/shop/order/pay/_payByLinkChannel.html.twig new file mode 100644 index 00000000..309c18fd --- /dev/null +++ b/templates/shop/order/pay/_payByLinkChannel.html.twig @@ -0,0 +1,5 @@ +{% if method.gatewayConfig.gatewayName == 'tpay_pbl_channel' and form.vars.value.state != 'cart' %} + +{% endif %} diff --git a/templates/shop/payment/_payByLink.html.twig b/templates/shop/payment/_payByLink.html.twig index 4f346c78..47068202 100644 --- a/templates/shop/payment/_payByLink.html.twig +++ b/templates/shop/payment/_payByLink.html.twig @@ -8,10 +8,8 @@ {% endfor %} - {# many PBL payment methods support #} - {% if not form.tpay.tpay_channel_id.rendered %} - {{ form_row(form.tpay.tpay_channel_id, {'value': defaultTpayChannelId}) }} + {{ form_row(form.tpay.tpay_channel_id) }} {% endif %} {% include '@CommerceWeaversSyliusTpayPlugin/shop/partial/_policies.html.twig' %} diff --git a/templates/shop/payment/_payByLinkChannel.html.twig b/templates/shop/payment/_payByLinkChannel.html.twig new file mode 100644 index 00000000..3aff7350 --- /dev/null +++ b/templates/shop/payment/_payByLinkChannel.html.twig @@ -0,0 +1,8 @@ +