paygreen/sylius-paygreen-plugin

Sylius 的 Paygreen 插件。

1.2.2 2022-07-18 15:31 UTC

This package is auto-updated.

Last update: 2024-09-18 20:19:49 UTC


README

paygreen logo

sylius logo

Sylius 支付模块,集成了 Paygreen

安装

需要插件

composer require paygreen/sylius-paygreen-plugin
  1. 您的 ProductVariant 实体需要实现 MealVoucherAwareInterface 并使用 MealVoucherAwareTrait
  2. 您的 Order 实体需要实现 MealVoucherableInterface 并使用 MealVoucherableTrait
  3. 您需要运行 doctrine 迁移的差异比较: bin/console doctrine:migrations:diff。别忘了运行它!(《bin/console doctrine:migrations:migrate》)
  4. 复制模板(我们更新了产品和产品变体的表单)
    mkdir -p templates/bundles/SyliusAdminBundle
    cp -Rv vendor/paygreen/sylius-paygreen-plugin/src/Resources/views/SyliusAdminBundle/ templates/bundles/
    

配置

Gateway configuration

使用您的公钥和私钥连接您的 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/.envtests/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