PHP code example of infuse / billing
1. Go to this page and download the library: Download infuse/billing library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
infuse / billing example snippets
'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' => [
// ...
'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
]
]
'routes' => [
// ...
'POST /billing/webhook' => [
'Infuse\Billing\Libs\StripeWebhook',
'webhook'
]
]