-
Notifications
You must be signed in to change notification settings - Fork 730
[17.x] Flexible Billing Support for Laravel Cashier #1772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Diddyy
wants to merge
23
commits into
laravel:develop
Choose a base branch
from
Diddyy:feature/flexible-billing
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
0336bd5
Add trial_ends_at and stripe_id fields to User model - fixes failing …
Diddyy 78d6e01
Add support for flexible billing mode in subscriptions and quotes
Diddyy d63d95f
Merge branch '16.x' into feature/flexible-billing
Diddyy 0081ce5
Refactor code style and formatting across multiple files
Diddyy bbfa927
Standardize code formatting and add missing newlines across multiple …
Diddyy a1cf0bf
Merge branch 'laravel:16.x' into feature/flexible-billing
Diddyy 18e3455
Merge branch '16.x' into feature/flexible-billing
crynobone 5ed947b
Requires `stripe/stripe-php` 18.1.0
crynobone 2ad2899
wip
crynobone 62f41fa
formatting
crynobone 342ed32
remove deprecated method usage
crynobone 9502e9a
wip
crynobone ea3b24c
wip
crynobone fb8aae2
wip
crynobone 64f021a
wip
crynobone b407740
wip
crynobone f2e23da
wip
crynobone 398d988
wip
crynobone 2302a55
wip
crynobone d6fdeef
wip
crynobone 234e87d
formatting
crynobone d0267e4
wip
crynobone c624c6c
wip
crynobone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
database/migrations/2019_05_03_000002_create_subscription_schedules_table.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| <?php | ||
|
|
||
| use Illuminate\Database\Migrations\Migration; | ||
| use Illuminate\Database\Schema\Blueprint; | ||
| use Illuminate\Support\Facades\Schema; | ||
|
|
||
| return new class extends Migration | ||
| { | ||
| /** | ||
| * Run the migrations. | ||
| */ | ||
| public function up(): void | ||
| { | ||
| Schema::create('subscription_schedules', function (Blueprint $table) { | ||
| $table->id(); | ||
| $table->unsignedBigInteger('user_id'); | ||
| $table->string('stripe_id')->unique(); | ||
| $table->string('stripe_status'); | ||
| $table->string('subscription_id')->nullable(); | ||
| $table->timestamp('current_phase_started_at')->nullable(); | ||
| $table->timestamp('current_phase_ends_at')->nullable(); | ||
| $table->timestamp('canceled_at')->nullable(); | ||
| $table->timestamp('completed_at')->nullable(); | ||
| $table->timestamp('released_at')->nullable(); | ||
| $table->json('metadata')->nullable(); | ||
| $table->timestamps(); | ||
|
|
||
| $table->index(['user_id', 'stripe_status']); | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Reverse the migrations. | ||
| */ | ||
| public function down(): void | ||
| { | ||
| Schema::dropIfExists('subscription_schedules'); | ||
| } | ||
| }; |
40 changes: 40 additions & 0 deletions
40
database/migrations/2019_05_03_000003_create_quotes_table.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <?php | ||
|
|
||
| use Illuminate\Database\Migrations\Migration; | ||
| use Illuminate\Database\Schema\Blueprint; | ||
| use Illuminate\Support\Facades\Schema; | ||
|
|
||
| return new class extends Migration | ||
| { | ||
| /** | ||
| * Run the migrations. | ||
| */ | ||
| public function up(): void | ||
| { | ||
| Schema::create('quotes', function (Blueprint $table) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a high possibility that |
||
| $table->id(); | ||
| $table->unsignedBigInteger('user_id'); | ||
| $table->string('stripe_id')->unique(); | ||
| $table->string('status'); | ||
| $table->string('number')->nullable(); | ||
| $table->integer('amount_subtotal')->nullable(); | ||
| $table->integer('amount_total')->nullable(); | ||
| $table->string('currency'); | ||
| $table->timestamp('expires_at')->nullable(); | ||
| $table->timestamp('status_transitions_finalized_at')->nullable(); | ||
| $table->timestamp('status_transitions_accepted_at')->nullable(); | ||
| $table->timestamp('status_transitions_canceled_at')->nullable(); | ||
| $table->timestamps(); | ||
|
|
||
| $table->index(['user_id', 'status']); | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Reverse the migrations. | ||
| */ | ||
| public function down(): void | ||
| { | ||
| Schema::dropIfExists('quotes'); | ||
| } | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this should be a configuration or something that we configure in a service provider: