bitbag / amazon-pay-plugin
Amazon Pay Plugin.
Installs: 105
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 1
Open Issues: 1
Type:sylius-plugin
Requires
- php: ^7.2
- ext-json: *
- amzn/amazon-pay-sdk-php: ^3.4
- guzzlehttp/guzzle: ^6.3
- sylius/sylius: ^1.4
- symfony/asset: ^4.2
Requires (Dev)
- behat/behat: ^3.4
- behat/mink: ^1.7@dev
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.0
- friends-of-behat/variadic-extension: ^1.1
- lakion/mink-debug-extension: ^1.2.3
- phpspec/phpspec: ^5.0
- phpstan/phpstan-doctrine: ^0.10
- phpstan/phpstan-shim: ^0.10
- phpstan/phpstan-symfony: ^0.10
- phpstan/phpstan-webmozart-assert: ^0.10
- phpunit/phpunit: ^6.5
- sensiolabs/security-checker: ^5.0
- sylius-labs/coding-standard: ^2.0
- symfony/browser-kit: ^3.4|^4.1
- symfony/debug-bundle: ^3.4|^4.1
- symfony/dotenv: ^4.2
- symfony/intl: ^3.4|^4.1
- symfony/web-profiler-bundle: ^3.4|^4.1
- symfony/web-server-bundle: ^3.4|^4.1
Conflicts
- symfony/browser-kit: 4.1.8
- symfony/dependency-injection: 4.1.8
- symfony/dom-crawler: 4.1.8
- symfony/routing: 4.1.8
- symfony/symfony: 4.1.8
This package is auto-updated.
Last update: 2021-02-08 19:24:46 UTC
README
Support
You can order our support on this page.
We work on amazing eCommerce projects on top of Sylius and Pimcore. Need some help or additional resources for a project? Write us an email on mikolaj.krol@bitbag.pl or visit our website! 🚀
BitBag SyliusAmazonPayPlugin
This plugin allows you to integrate AmazonPay payment with Sylius platform app.
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})?$
-
Install assets:
bin/console assets:install --symlink
-
Install theme assets (only if using a theme):
bin/console sylius:theme:assets:install
-
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
Testing
$ composer install $ cd tests/Application $ yarn install $ yarn run gulp $ 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