infuse / billing
由 Stripe 驱动的 Infuse 框架订阅会员模块
2.0
2017-12-03 03:15 UTC
Requires
- php: >=7.0.0
- stripe/stripe-php: ~3.0|~4.0|~5.0
Requires (Dev)
- infuse/infuse: ~1.6
- mockery/mockery: ~1.0
- phpunit/phpunit: 6.0.*
- pulsar/pulsar: ~0.6
- robmorgan/phinx: ~0.5
- satooshi/php-coveralls: 0.6.1
This package is auto-updated.
Last update: 2024-09-20 15:56:28 UTC
README
由 Stripe 驱动的 Infuse 框架订阅会员模块
安装
-
使用 composer 安装包
composer require infuse/billing
-
在你的应用程序配置中添加计费部分
'billing' => [ 'model' => 'App\Users\Models\User', 'emails' => [ 'trial_will_end' => true, 'trial_ended' => true, 'failed_payment' => true, 'payment_receipt' => true, 'subscription_canceled' => true ], 'defaultPlan' => 'default_plan', 'trialWillEndReminderDays' => 3 ]
-
将控制台命令添加到你的应用程序配置中的
console.commands
'console' => [ // ... 'commands' => [ // ... 'Infuse\Billing\Console\ExtendTrialCommand', 'Infuse\Billing\Console\SyncStripeSubscriptionsCommand', 'Infuse\Billing\Console\SyncStripeProfilesCommand' ] ]
-
将迁移添加到你的应用程序配置中
'modules' => [ 'migrations' => [ // ... 'Billing' ], 'migrationPaths' => [ // ... 'Billing' => 'vendor/infuse/billing/src/migrations' ] ]
-
(可选) 将以下计划任务添加到你的应用程序配置中
'cron' => [ // ... [ 'id' => 'billing:sendTrialReminders', 'class' => 'Infuse\Billing\Jobs\SendTrialReminders', 'minute' => 0, 'expires' => 1800 // 30 minutes ] ]
-
(可选) 在路由表中添加一个端点以接收 Stripe Webhooks
'routes' => [ // ... 'POST /billing/webhook' => [ 'Infuse\Billing\Libs\StripeWebhook', 'webhook' ] ]