{{ method.description }}
+diff --git a/composer.json b/composer.json index 5c2c226094..aad086d035 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ ], "require": { "php": "^8.1", + "sylius/paypal-plugin": "^1.7.x-dev", "sylius/sylius": "~1.14.0", "symfony/dotenv": "^5.4 || ^6.4", "symfony/flex": "^2.4", diff --git a/config/bundles.php b/config/bundles.php index a211a992e2..754403fa82 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -60,4 +60,5 @@ SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], + Sylius\PayPalPlugin\SyliusPayPalPlugin::class => ['all' => true], ]; diff --git a/config/packages/_sylius.yaml b/config/packages/_sylius.yaml index 6d5fbf8988..74c4dc0f7d 100644 --- a/config/packages/_sylius.yaml +++ b/config/packages/_sylius.yaml @@ -5,6 +5,7 @@ imports: - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" } - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" } + - { resource: "@SyliusPayPalPlugin/Resources/config/config.yaml" } - { resource: "../parameters.yaml" } diff --git a/config/packages/http_discovery.yaml b/config/packages/http_discovery.yaml new file mode 100644 index 0000000000..2a789e73c9 --- /dev/null +++ b/config/packages/http_discovery.yaml @@ -0,0 +1,10 @@ +services: + Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory' + + http_discovery.psr17_factory: + class: Http\Discovery\Psr17Factory diff --git a/config/routes.yaml b/config/routes.yaml index e69de29bb2..b69bca4578 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -0,0 +1,2 @@ +sylius_paypal_webhook: + resource: "@SyliusPayPalPlugin/Resources/config/webhook_routing.yaml" diff --git a/config/routes/sylius_admin.yaml b/config/routes/sylius_admin.yaml index b9c12c2244..7d3f858119 100644 --- a/config/routes/sylius_admin.yaml +++ b/config/routes/sylius_admin.yaml @@ -1,3 +1,7 @@ sylius_admin: resource: "@SyliusAdminBundle/Resources/config/routing.yml" prefix: '/%sylius_admin.path_name%' + +sylius_paypal_admin: + resource: "@SyliusPayPalPlugin/Resources/config/admin_routing.yml" + prefix: '/%sylius_admin.path_name%' diff --git a/config/routes/sylius_shop.yaml b/config/routes/sylius_shop.yaml index 22e7a4a9a9..eefe9454e5 100644 --- a/config/routes/sylius_shop.yaml +++ b/config/routes/sylius_shop.yaml @@ -21,3 +21,9 @@ sylius_shop_request_password_reset_token_redirect: defaults: route: sylius_shop_request_password_reset_token permanent: false + +sylius_paypal: + resource: "@SyliusPayPalPlugin/Resources/config/shop_routing.yaml" + prefix: /{_locale} + requirements: + _locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$ diff --git a/symfony.lock b/symfony.lock index 947947f06c..6843d333fe 100644 --- a/symfony.lock +++ b/symfony.lock @@ -326,6 +326,18 @@ "phar-io/version": { "version": "1.0.1" }, + "php-http/discovery": { + "version": "1.20", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.18", + "ref": "f45b5dd173a27873ab19f5e3180b2f661c21de02" + }, + "files": [ + "config/packages/http_discovery.yaml" + ] + }, "php-http/httplug": { "version": "v1.1.0" }, @@ -518,6 +530,9 @@ "sylius/mailer-bundle": { "version": "v1.4.4" }, + "sylius/paypal-plugin": { + "version": "1.7.x-dev" + }, "sylius/registry": { "version": "v1.4.1" }, diff --git a/templates/bundles/SyliusAdminBundle/PaymentMethod/Gateways/paymentGateways.html.twig b/templates/bundles/SyliusAdminBundle/PaymentMethod/Gateways/paymentGateways.html.twig new file mode 100644 index 0000000000..ea0e1d4b95 --- /dev/null +++ b/templates/bundles/SyliusAdminBundle/PaymentMethod/Gateways/paymentGateways.html.twig @@ -0,0 +1,5 @@ +{% for name, gateway in gatewayFactories %} + + {{ gateway|trans }} + +{% endfor %} diff --git a/templates/bundles/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig b/templates/bundles/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig new file mode 100644 index 0000000000..6b23abe8a0 --- /dev/null +++ b/templates/bundles/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig @@ -0,0 +1,18 @@ +
{{ method.description }}
+