diff --git a/composer.json b/composer.json index 4c6c2d4b8c..08a33c4d2f 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ ], "require": { "php": "^8.2", + "sylius/paypal-plugin": "^2.0", "sylius/sylius": "~2.0.0", "symfony/dotenv": "^6.4 || ^7.1", "symfony/flex": "^2.4", diff --git a/config/bundles.php b/config/bundles.php index 07b811b9ec..c49d0abce2 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -60,4 +60,6 @@ Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true], Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true], Symfony\UX\Icons\UXIconsBundle::class => ['all' => true], + FOS\RestBundle\FOSRestBundle::class => ['all' => true], + Sylius\PayPalPlugin\SyliusPayPalPlugin::class => ['all' => true], ]; diff --git a/config/packages/fos_rest.yaml b/config/packages/fos_rest.yaml new file mode 100644 index 0000000000..ee7f4fc5a4 --- /dev/null +++ b/config/packages/fos_rest.yaml @@ -0,0 +1,25 @@ +fos_rest: + exception: true + view: + formats: + json: true + xml: true + empty_content: 204 + format_listener: + rules: + - { path: '^/api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true } + - { path: '^/', stop: true } + +# param_fetcher_listener: true +# allowed_methods_listener: true + routing_loader: false +# view: +# view_response_listener: true +# exception: +# codes: +# App\Exception\MyException: 403 +# messages: +# App\Exception\MyException: Forbidden area. +# format_listener: +# rules: +# - { path: ^/api, prefer_extension: true, fallback_format: json, priorities: [ json, html ] } diff --git a/config/packages/sylius_paypal.yaml b/config/packages/sylius_paypal.yaml new file mode 100644 index 0000000000..9a0676b019 --- /dev/null +++ b/config/packages/sylius_paypal.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: "@SyliusPayPalPlugin/config/config.yaml" } diff --git a/config/routes/sylius_paypal.yaml b/config/routes/sylius_paypal.yaml new file mode 100644 index 0000000000..a531c2f615 --- /dev/null +++ b/config/routes/sylius_paypal.yaml @@ -0,0 +1,2 @@ +sylius_paypal: + resource: "@SyliusPayPalPlugin/config/routes.yaml" diff --git a/symfony.lock b/symfony.lock index 321f019066..f8be99e695 100644 --- a/symfony.lock +++ b/symfony.lock @@ -61,6 +61,18 @@ "ref": "1e012e04f573524ca83795cd19df9ea690adb604" } }, + "friendsofsymfony/rest-bundle": { + "version": "3.8", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "3.0", + "ref": "3762cc4e4f2d6faabeca5a151b41c8c791bd96e5" + }, + "files": [ + "config/packages/fos_rest.yaml" + ] + }, "knplabs/knp-gaufrette-bundle": { "version": "v0.9.0" }, @@ -187,6 +199,19 @@ "sylius/mailer-bundle": { "version": "v2.1.0" }, + "sylius/paypal-plugin": { + "version": "2.0", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "2.0", + "ref": "57902d9acd42347cbd964c996e75df0ac9028c9b" + }, + "files": [ + "config/packages/sylius_paypal.yaml", + "config/routes/sylius_paypal.yaml" + ] + }, "sylius/resource-bundle": { "version": "1.12", "recipe": {