Sylius Core Team’s plugin for PayPal Commerce Platform - the newest and most advanced of PayPal solutions.
- one of the most popular payment methods in the world;
- worldwide network of 280+ millions consumers and 24+ millions merchants;
- bank payouts are available in U.S., U.K., the E.U., Australia, and Canada;
- PCI DSS and 3DS 2.0 compliance
- full risk management, incl. customisable fraud tools & insight and dispute resolution via dynamic APIs.
- official payment integration developed and maintained by the Sylius Core Team;
- global support for over 100 currencies across 200+ markets;
- two-side operations between Sylius & PayPal administration panels (payments, refunds, reports, etc.);
- better conversion thanks to direct checkout from both product & cart page;
- support for all credit & debit cards;
- popular regional payment methods, i.e. iDeal, SEPA, Sofort, eps, Griopay or Przelewy24;
- direct PayPal transactions with PayPal wallet
-
Run
composer require sylius/paypal-plugin
-
Import routes
# config/routes/sylius_shop.yaml 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}))?$ # config/routes/sylius_admin.yaml sylius_paypal_admin: resource: "@SyliusPayPalPlugin/Resources/config/admin_routing.yml" prefix: /admin # config/routes.yaml sylius_paypal_webhook: resource: "@SyliusPayPalPlugin/Resources/config/webhook_routing.yaml"
-
Import configuration
# config/packages/_sylius.yaml imports: # ... - { resource: "@SyliusPayPalPlugin/Resources/config/config.yaml" }
-
Override Sylius' templates
cp -R vendor/sylius/paypal-plugin/src/Resources/views/bundles/* templates/bundles/
-
Copy and apply migrations
cp -R vendor/sylius/paypal-plugin/migrations/ src/Migrations/ bin/console doctrine:migrations:migrate -n
BEWARE!
To make PayPal integration working, your local Sylius URL should be accessible for the PayPal servers. Therefore you can
add the proper directive to your /etc/hosts
(something like 127.0.0.1 sylius.local
) or use a service as ngrok.
By default, plugin operates in the sandbox mode. I means all the transactions would be used with the sandbox URLs and code. To change it, you need to configure the plugin properly:
sylius_pay_pal:
sandbox: false
You can, for example, configure it only for the production environment (e.g. in config/packages/prod/sylius_pay_pal_plugin.yaml
).
To be able to download reports about your payouts, you need to have reports feature enabled on your PayPal account. Also,
it's required to configure SFTP account and set its data in .env
file.
-
Log in to your PayPal account
-
Enter the profile settings
-
Pass to SFTP accounts panel
-
Create a new SFTP account
-
Configure username and password in payment method's configuration
Plugin provides sylius:pay-pal-plugin:complete-payments
command, that should be configured as cron job on the server.
It iterates over processing PayPal payments and completes them if the order is completed in PayPal.
git clone [email protected]:Sylius/PayPalPlugin.git
(cd tests/Application && yarn install)
(cd tests/Application && yarn build)
(cd tests/Application && bin/console assets:install)
(cd tests/Application && bin/console doctrine:database:create)
(cd tests/Application && bin/console doctrine:migrations:migrate -n)
-
Using
test
environment:(cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load) (cd tests/Application && APP_ENV=test symfony serve)
-
Using
dev
environment:(cd tests/Application && bin/console sylius:fixtures:load) (cd tests/Application && symfony serve)