infuse / billing
Subscription membership module for Infuse Framework powered by Stripe
Installs: 2 141
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
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-11-20 16:23:09 UTC
README
Subscription membership module for Infuse Framework powered by Stripe
Installation
-
Install the package with composer:
composer require infuse/billing
-
Add a billing section in your app's configuration:
'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 ]
-
Add the console command to run jobs to
console.commands
in your app's configuration:'console' => [ // ... 'commands' => [ // ... 'Infuse\Billing\Console\ExtendTrialCommand', 'Infuse\Billing\Console\SyncStripeSubscriptionsCommand', 'Infuse\Billing\Console\SyncStripeProfilesCommand' ] ]
-
Add the migration to your app's configuration:
'modules' => [ 'migrations' => [ // ... 'Billing' ], 'migrationPaths' => [ // ... 'Billing' => 'vendor/infuse/billing/src/migrations' ] ]
-
(optional) Add the following scheduled job to your app's configuration:
'cron' => [ // ... [ 'id' => 'billing:sendTrialReminders', 'class' => 'Infuse\Billing\Jobs\SendTrialReminders', 'minute' => 0, 'expires' => 1800 // 30 minutes ] ]
-
(optional) Add an endpoint to your routing table to receive Stripe webhooks:
'routes' => [ // ... 'POST /billing/webhook' => [ 'Infuse\Billing\Libs\StripeWebhook', 'webhook' ] ]