bitbag / amazon-pay-plugin
Amazon pay plugin.
Installs: 10 377
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 8
Forks: 6
Open Issues: 3
Type:sylius-plugin
Requires
- php: ^8.0
- amzn/amazon-pay-sdk-php: ^3.7
- sylius/sylius: ~1.11.0 || ~1.12.0
- symfony/webpack-encore-bundle: ^1.14
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- bitbag/coding-standard: ^1.0
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: 0.12.85
- phpstan/phpstan-doctrine: 0.12.33
- phpstan/phpstan-strict-rules: ^0.12.0
- phpstan/phpstan-webmozart-assert: 0.12.12
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- symfony/browser-kit: ^5.4 || ^6.0
- symfony/debug-bundle: ^5.4 || ^6.0
- symfony/dotenv: ^5.4 || ^6.0
- symfony/intl: ^5.4 || ^6.0
- symfony/web-profiler-bundle: ^5.4 || ^6.0
- vimeo/psalm: 4.7.1 || ^5.0
This package is auto-updated.
Last update: 2024-03-29 14:29:49 UTC
README
BitBag SyliusAmazonPayPlugin
At BitBag we do believe in open source. However, we are able to do it just because of our awesome clients, who are kind enough to share some parts of our work with the community. Therefore, if you feel like there is a possibility for us to work together, feel free to reach out. You will find out more about our professional services, technologies, and contact details at https://bitbag.io/.
Like what we do? Want to join us? Check out our job listings on our career page. Not familiar with Symfony & Sylius yet, but still want to start with us? Join our academy!
Table of Content
Overview
This plugin allows you to integrate AmazonPay payment with Sylius platform app.
We are here to help
This open-source plugin was developed to help the Sylius community. If you have any additional questions, would like help with installing or configuring the plugin, or need any assistance with your Sylius project - let us know!
Installation
-
Require plugin with composer:
$ composer require bitbag/amazon-pay-plugin
-
Add plugin class to your bundles.php file:
$bundles = [ BitBag\SyliusAmazonPayPlugin\BitBagSyliusAmazonPayPlugin::class => ['all' => true], ];
-
Import routing on top of your config/routes.yaml file:
bitbag_sylius_amazon_pay_plugin: resource: "@BitBagSyliusAmazonPayPlugin/Resources/config/routing.yml" prefix: /
-
Add routing to sylius_shop.yml:
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})?$
-
Please add the Webpack build configuration to your
config/packages/webpack_encore.yaml
file:webpack_encore: builds: shop: '%kernel.project_dir%/public/build/shop' admin: '%kernel.project_dir%/public/build/admin'
-
Copy Sylius templates overridden by plug-in to your templates directory (
templates/bundles/
):mkdir -p templates/bundles/SyliusAdminBundle/ mkdir -p templates/bundles/SyliusShopBundle/ cp -R vendor/bitbag/amazon-pay-plugin/tests/Application/templates/bundles/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/ cp -R vendor/bitbag/amazon-pay-plugin/tests/Application/templates/bundles/SyliusShopBundle/* templates/bundles/SyliusShopBundle/
-
Install assets:
bin/console assets:install
-
Install theme assets (only if using a theme):
bin/console sylius:theme:assets:install
Note. When you use
--symlink
option, it has to be passed both in points 7 and 8. -
Clear cache:
bin/console cache:clear
Change the order of steps in the checkout
Add checkout resolver to _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_complete
Add state machine in _sylius.yml:
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: completed
Cron job
Cron refreshes the status of AmazonPay
for example:
*/5 * * * * bin/console bitbag:amazon-pay:update-payment-state
Fixtures
Example 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: de
Configure config/packages/webpack_encore.yaml
builds: *: * shop: '%kernel.project_dir%/public/build/shop' admin: '%kernel.project_dir%/public/build/admin'
Testing
Copy Sylius templates overridden by plug-in to your templates directory (templates/bundles/
):
mkdir -p templates/bundles/SyliusAdminBundle/ mkdir -p templates/bundles/SyliusShopBundle/ cp -R vendor/bitbag/amazon-pay-plugin/tests/Application/templates/bundles/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/ cp -R vendor/bitbag/amazon-pay-plugin/tests/Application/templates/bundles/SyliusShopBundle/* templates/bundles/SyliusShopBundle/
Then please run the commands below:
$ composer 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 run
About us
BitBag is a company of people who love what they do and do it right. We fulfill the eCommerce technology stack with Sylius, Shopware, Akeneo, and Pimcore for PIM, eZ Platform for CMS, and VueStorefront for PWA. Our goal is to provide real digital transformation with an agile solution that scales with the clients’ needs. Our main area of expertise includes eCommerce consulting and development for B2C, B2B, and Multi-vendor Marketplaces.
We are advisers in the first place. We start each project with a diagnosis of problems, and an analysis of the needs and goals that the client wants to achieve.
We build unforgettable, consistent digital customer journeys on top of the best technologies. Based on a detailed analysis of the goals and needs of a given organization, we create dedicated systems and applications that let businesses grow.
Our team is fluent in Polish, English, German and, French. That is why our cooperation with clients from all over the world is smooth.
Some numbers from BitBag regarding Sylius:
- 50+ experts including consultants, UI/UX designers, Sylius trained front-end and back-end developers,
- 120+ projects delivered on top of Sylius,
- 25+ countries of BitBag’s customers,
- 4+ years in the Sylius ecosystem.
Our services:
- Business audit/Consulting in the field of strategy development,
- Data/shop migration,
- Headless eCommerce,
- Personalized software development,
- Project maintenance and long term support,
- Technical support.
Key clients: Mollie, Guave, P24, Folkstar, i-LUNCH, Elvi Project, WestCoast Gifts.
If you need some help with Sylius development, don't be hesitated to contact us directly. You can fill the form on this site or send us an e-mail at hello@bitbag.io!
Community
For online communication, we invite you to chat with us & other users on Sylius Slack.
Demo Sylius Shop
We created a demo app with some useful use-cases of plugins!
Visit sylius-demo.bitbag.io to take a look at it. The admin can be accessed under
sylius-demo.bitbag.io/admin/login link and bitbag: bitbag
credentials.
Plugins that we have used in the demo:
If you need an overview of Sylius' capabilities, schedule a consultation with our expert.
Additional resources for developers
To learn more about our contribution workflow and more, we encourage you to use the following resources:
License
This plugin's source code is completely free and released under the terms of the MIT license.
Contact
If you want to contact us, the best way is to fill the form on our website or send us an e-mail to hello@bitbag.io with your question(s). We guarantee that we answer as soon as we can!