paygreen / sylius-paygreen-plugin
Sylius 的 Paygreen 插件。
1.2.2
2022-07-18 15:31 UTC
Requires
- php: ^7.3 || ^8.0
- ext-json: *
- nyholm/psr7: ^1.4
- paygreen/paygreen-php: ^1.1
- sylius/sylius: ~1.8 || ~1.9 || ~1.10
- symfony/http-client: ^5.4
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-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
- friendsofsymfony/oauth-server-bundle: ^1.6 || >2.0.0-alpha.0 ^2.0@dev
- overtrue/phplint: ^2.0
- 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
- sensiolabs/security-checker: ^6.0
- sylius-labs/coding-standard: ^4.0
- sylius/admin-api-bundle: ^1.10
- 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/monolog-bundle: ^3.7
- symfony/web-profiler-bundle: ^4.4 || ^5.2
- vimeo/psalm: 4.7.1
README
Sylius 支付模块,集成了 Paygreen
安装
需要插件
composer require paygreen/sylius-paygreen-plugin
- 您的
ProductVariant
实体需要实现MealVoucherAwareInterface
并使用MealVoucherAwareTrait
。 - 您的
Order
实体需要实现MealVoucherableInterface
并使用MealVoucherableTrait
。 - 您需要运行 doctrine 迁移的差异比较:
bin/console doctrine:migrations:diff
。别忘了运行它!(《bin/console doctrine:migrations:migrate》) - 复制模板(我们更新了产品和产品变体的表单)
mkdir -p templates/bundles/SyliusAdminBundle cp -Rv vendor/paygreen/sylius-paygreen-plugin/src/Resources/views/SyliusAdminBundle/ templates/bundles/
配置
使用您的公钥和私钥连接您的 Paygreen 账户。
要激活站内支付界面,必须通过您的 PayGreen 后台激活站内模块。此外,您必须使用 HTTPS。
在 .env
文件中,您需要根据您的客户账户配置 PAYGREEN_API_SERVER
(生产或沙盒)。
PAYGREEN_API_SERVER=PRODUCTION
食谱
贡献
安装
$ composer install $ (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) $ (cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load)
为了能够设置插件的数据库,请记得在 tests/Application/.env
和 tests/Application/.env.test
中配置您的数据库凭据。
启动本地服务器
$ (cd tests/Application && APP_ENV=test php -S localhost:8080 -t public)
运行插件测试
-
PHPSpec
$ composer phpspec
-
Behat
$ composer behat
-
所有测试(phpspec & behat)
$ composer test