hraph / sylius-paygreen-plugin
Sylius integration for Paygreen.io payment provider
Installs: 508
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 1
Open Issues: 1
Type:sylius-plugin
Requires
- php: ^7.4
- hraph/paygreen-api-php: ^1.1.1
- sylius/sylius: ~1.8.0 || ~1.9.0
- symfony/doctrine-bridge: ^4.4 || ^5.2
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- 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-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
- friendsofsymfony/oauth-server-bundle: ^1.6 || >2.0.0-alpha.0 ^2.0@dev
- lakion/mink-debug-extension: ^2.0.0
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: 0.12.88
- phpstan/phpstan-doctrine: 0.12.37
- phpstan/phpstan-strict-rules: ^0.12.0
- phpstan/phpstan-webmozart-assert: 0.12.12
- phpunit/phpunit: ^9.5
- sensiolabs/security-checker: ^6.0
- sylius-labs/coding-standard: ^3.1
- symfony/browser-kit: ^4.4 || ^5.2
- symfony/debug-bundle: ^4.4 || ^5.2
- symfony/dotenv: ^4.4 || ^5.2
- symfony/intl: ^4.4 || ^5.2
- symfony/web-profiler-bundle: ^4.4 || ^5.2
- vimeo/psalm: 4.6.4
Conflicts
- api-platform/core: ^2.6
This package is auto-updated.
Last update: 2024-03-23 17:28:28 UTC
README
Sylius plugin for Paygreen.io payment provider
Installation
Requirements
Package | Version |
---|---|
PHP | ^7.4 |
sylius/sylius | ^1.8 || ^1.9 |
Instructions
-
Install plugin using
composer
:$ composer require hraph/sylius-paygreen-plugin
-
Import config:
# config/packages/_sylius.yaml imports: # ... - { resource: "@SyliusPaygreenPlugin/Resources/config/app/config.yaml" }
-
Import routing:
# config/routes.yaml hraph_sylius_paygreen_plugin_admin: resource: "@SyliusPaygreenPlugin/Resources/config/admin_routing.yaml" prefix: /admin
-
Update your schema (for existing project):
# Generate and edit migration bin/console doctrine:migrations:diff # Then apply migration bin/console doctrine:migrations:migrate
Plugin configuration
# config/packages/sylius_paygreen.yaml sylius_paygreen: api: username: PaygreenUsername api_key: API_KEY sandbox: true force_use_authorize: true # All payments will be executed using authorize (fingerprint) use_insite_mode: true # Use iframe mode
Views customization
You can customize the payment view by creating a custom file in templates/bundles/SyliusPaygreenPlugin/Checkout/payment.html.twig
:
{% block content %} <iframe src="{{ execute_url ~ "?display=insite" }}" style="border: 0;width: 100%; height: 600px"></iframe> {% endblock %}
Plugin extension
The following plugin entities can be extended using Sylius documentation guidelines:
paygreen_shop
paygreen_transfer
Example:
sylius_paygreen: resources: paygreen_shop: classes: interface: App\Entity\PaymentProvider\CustomPaymentProviderShopInterface model: App\Entity\PaymentProvider\CustomPaymentProviderShop factory: App\Entity\PaymentProvider\CustomPaymentProviderShopFactory
Contribution
Installation:
$ (cd tests/Application && yarn install) $ (cd tests/Application && yarn build) $ (cd tests/Application && APP_ENV=test bin/console assets:install public) $ (cd tests/Application && APP_ENV=test bin/console doctrine:database:create) $ (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)
To be able to setup a plugin's database, remember to configure you database credentials in tests/Application/.env
and tests/Application/.env.test
.
Running plugin tests
-
PHPSpec
$ composer phpspec
-
Behat
$ composer behat
-
All tests (phpspec & behat)
$ composer test