ergosarapu/donation-bundle

捐赠套餐允许轻松创建面向开发者的捐赠网站

安装: 21

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:symfony-bundle

0.1.0 2024-09-13 10:58 UTC

This package is auto-updated.

Last update: 2024-09-25 06:32:33 UTC


README

捐赠套餐允许轻松创建基于Symfony的捐赠网站

安装

打开命令行,进入您的项目目录并执行

composer require ergosarapu/donation-bundle

要初始化数据库,首先生成迁移文件...

bin/console doctrine:migrations:diff

...然后运行迁移以创建数据库表

bin/console doctrine:migrations:migrate

注册套餐路由

// config/routes.yaml

donation_bundle_routes:
    # loads routes from the given routing file stored in bundle
    resource: '@DonationBundle/config/routes.xml'

创建管理员用户

php bin/console donation:add-user [email] [givenname] [familyname] --admin

如果您在本地主机上运行应用程序,则管理员面板可以通过https:///admin 访问。

注册Payum网关工厂

该套餐使用Payum进行支付网关抽象。为了使用网关,注册Payum网关工厂,例如

// config/services.yaml

app.montonio_gateway_factory:
    class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder
    arguments: [ErgoSarapu\PayumMontonio\MontonioGatewayFactory]
    tags:
        - { name: payum.gateway_factory_builder, factory: montonio }

然后配置PayumBundle和网关。

配置

以下配置选项适用于捐赠套餐

# config/packages/donation.yaml

donation:

    # Payments configuration.
    payments:
        onetime:
            bank:

                # Prototype
                country_code:
                    gateways:

                        # Prototype: Name of a Payum gateway
                        name:

                            # Payment method label as shown to the end user
                            label:                ~ # Required

                            # Payment method icon shown to the end user
                            image:                ~
            card:
                gateways:

                    # Prototype: Name of a Payum gateway
                    name:

                        # Payment method label as shown to the end user
                        label:                ~ # Required

                        # Payment method icon shown to the end user
                        image:                ~
        monthly:
            bank:

                # Prototype
                country_code:
                    gateways:

                        # Prototype: Name of a Payum gateway
                        name:

                            # Payment method label as shown to the end user
                            label:                ~ # Required

                            # Payment method icon shown to the end user
                            image:                ~
            card:
                gateways:

                    # Prototype: Name of a Payum gateway
                    name:

                        # Payment method label as shown to the end user
                        label:                ~ # Required

                        # Payment method icon shown to the end user
                        image:                ~

重置密码功能

重置密码功能使用SymfonyCastsResetPasswordBundle,请检查其配置以修改其行为。

为了使用重置密码功能,请将Mailer组件安装到您的应用程序中,并配置全局发送者

# config/packages/mailer.yaml

mailer:
    envelope:
        sender: 'donations@example.com'
    headers:
        From: 'Donations <donations@example.com>'

开发

使用DDEV设置开发环境

ddev start

安装依赖项

要限制安装到特定Symfony版本的包,请全局安装symfony/flex并指定您想要的Symfony版本

composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-interaction --no-progress symfony/flex:^2.4
composer config extra.symfony.require "7.1"

测试

使用以下脚本运行数据库迁移和测试

./run_tests.sh

设置应用程序集成开发环境

TODO:描述如何使用此套餐设置带有Symfony应用程序的开发环境。虽然可以在不设置应用程序本身的情况下开发套餐,但验证一切按预期工作是有用的。