diff --git a/src/Resources/config/config.yaml b/src/Resources/config/config.yaml index ad3e4c63..f8df9f79 100644 --- a/src/Resources/config/config.yaml +++ b/src/Resources/config/config.yaml @@ -29,6 +29,7 @@ sylius_grid: templates: action: download_report: "@SyliusPayPalPlugin/Grid/downloadReport.html.twig" + enable_pay_pal: "@SyliusPayPalPlugin/Grid/enablePayPal.html.twig" grids: sylius_admin_payment_method: actions: @@ -42,6 +43,9 @@ sylius_grid: route: sylius_paypal_plugin_admin_download_payouts_report parameters: id: resource.id + main: + enable_pay_pal: + type: enable_pay_pal sylius_ui: events: diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index 766eb7f9..1742401e 100644 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -4,6 +4,7 @@ sylius: client_id: 'Client ID' client_secret: 'Client Secret' different_amount: 'This is the authorized price. As you have modified the order after authorization, you will pay the amount displayed as Total' + enable_paypal: 'Enable PayPal' label: 'PayPal' report: 'Report' sftp_username: 'SFTP Username' diff --git a/src/Resources/views/Grid/enablePayPal.html.twig b/src/Resources/views/Grid/enablePayPal.html.twig new file mode 100644 index 00000000..d1b8f8e7 --- /dev/null +++ b/src/Resources/views/Grid/enablePayPal.html.twig @@ -0,0 +1,7 @@ +{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} + +{% set path = path('sylius_admin_payment_method_create', {'factory': 'sylius.pay_pal'}) %} + +
+ {{ buttons.default(path, 'sylius.pay_pal.enable_paypal'|trans , null, null) }} +