GENERAL
FRONTEND
ADDITIONAL
We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.
| Package | Version |
|---|---|
| PHP | >8.0 |
| sylius/sylius | 1.12.x - 1.13.x |
| MySQL | >= 5.7 |
| NodeJS | >= 18.x |
composer require bitbag/amazon-pay-pluginAdd plugin dependencies to your config/bundles.php file:
# config/bundles.php
return [
...
BitBag\SyliusAmazonPayPlugin\BitBagSyliusAmazonPayPlugin::class => ['all' => true],
];Add routing to your config/routes.yaml file:
# config/routes.yaml
bitbag_sylius_amazon_pay_plugin:
resource: "@BitBagSyliusAmazonPayPlugin/Resources/config/routing.yml"
prefix: /Add routing to your config/routes/sylius_shop.yaml file:
# config/routes/sylius_shop.yaml
sylius_shop_checkout_start:
path: /{_locale}/checkout-start
methods: [GET]
defaults:
_controller: bitbag_sylius_amazon_pay_plugin.controller.action.checkout_start
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$ Add checkout resolver to config/_sylius.yml:
sylius_shop:
checkout_resolver:
pattern: /checkout/.+
route_map:
empty_order:
route: sylius_shop_cart_summary
cart:
route: sylius_shop_checkout_address
addressed:
route: sylius_shop_checkout_select_payment
payment_selected:
route: sylius_shop_checkout_select_shipping
payment_skipped:
route: sylius_shop_checkout_select_shipping
shipping_selected:
route: sylius_shop_checkout_complete
shipping_skipped:
route: sylius_shop_checkout_completeAdd state machine configuration for example to config/packages/state_machine.yaml:
# config/packages/state_machine.yaml
winzou_state_machine:
sylius_order_checkout:
transitions:
select_payment:
from: [payment_selected, shipping_skipped, shipping_selected, addressed]
to: payment_selected
complete:
from: [payment_selected, payment_skipped, shipping_selected, shipping_skipped]
to: completedCopy required templates into correct directories in your project.
ShopBundle (templates/bundles/SyliusShopBundle):
vendor/bitbag/amazon-pay-plugin/tests/Application/templates/bundles/SyliusShopBundle/Checkout/SelectPayment/_navigation.html.twig
vendor/bitbag/amazon-pay-plugin/tests/Application/templates/bundles/SyliusShopBundle/Checkout/SelectShipping/_navigation.html.twig
vendor/bitbag/amazon-pay-plugin/tests/Application/templates/bundles/SyliusShopBundle/Checkout/_steps.html.twig
bin/console assets:install ... or if using theme:
bin/console sylius:theme:assets:installyarn install
yarn encore dev # or prod, depends on your environmentbin/console cache:clearNote: If you are running it on production, add the -e prod flag to this command.
Cron refreshes the status of AmazonPay
- for example:
*/5 * * * * bin/console bitbag:amazon-pay:update-payment-stateExample fixture configuration:
sylius_fixtures:
suites:
default:
fixtures:
payment_method:
options:
custom:
amazon_pay:
code: "amazon_pay"
name: "Amazon pay"
channels:
- "US_WEB"
enabled: true
gatewayFactory: amazonpay
gatewayName: Amazon pay
gatewayConfig:
payum.http_client: '@bitbag.sylius_amazon_pay_plugin.amazon_pay_api_client'
buttonColor: Gold
buttonSize: Large
buttonType: PwA
buttonLanguage: de-DE
environment: sandbox
merchantId: "test"
accessKey: "test"
secretKey: "test"
clientId: "test"
region: decomposer install
cd tests/Application
yarn install
yarn encore dev
bin/console assets:install web -e test
bin/console doctrine:database:create -e test
bin/console doctrine:schema:create -e test
bin/console server:run 127.0.0.1:8080 -d web -e test
open http://localhost:8080
bin/behat
bin/phpspec runFor incorrectly displayed translations, execute the command:
bin/console cache:clearNote: If you are running it on production, add the -e prod flag to this command.