diff --git a/app/Http/Controllers/Backstage/StripeConnectController.php b/app/Http/Controllers/Backstage/StripeConnectController.php new file mode 100644 index 0000000..2bd71ac --- /dev/null +++ b/app/Http/Controllers/Backstage/StripeConnectController.php @@ -0,0 +1,23 @@ + 'code', + 'scope' => 'read_write', + 'client_id' => config('services.stripe.client_id'), + ]), + ]); + + return redirect($url); + } +} diff --git a/config/services.php b/config/services.php index 4460f0e..cc95d52 100644 --- a/config/services.php +++ b/config/services.php @@ -33,6 +33,7 @@ return [ 'model' => App\User::class, 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), + 'client_id' => env('STRIPE_CLIENT_ID') ], ]; diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 1432265..c068785 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -17,6 +17,8 @@ class CreateUsersTable extends Migration $table->increments('id'); $table->string('email')->unique(); $table->string('password'); + $table->string('stripe_account_id')->nullable(); + $table->string('stripe_access_token')->nullable(); $table->rememberToken(); $table->timestamps(); }); diff --git a/routes/web.php b/routes/web.php index 7d511f6..d9ee811 100644 --- a/routes/web.php +++ b/routes/web.php @@ -35,5 +35,7 @@ Route::group(['middleware' => 'auth', 'prefix' => 'backstage', 'namespace' => 'B Route::get('/concerts/{id}/messages/new', 'ConcertMessagesController@create')->name('backstage.concert-messages.new'); Route::post('/concerts/{id}/messages', 'ConcertMessagesController@store')->name('backstage.concert-messages.store'); + + Route::get('/stripe-connect/authorize', 'StripeConnectController@authorizeRedirect'); }); diff --git a/tests/Browser/ConnectWithStripeTest.php b/tests/Browser/ConnectWithStripeTest.php index 16a62c4..ef5a3bc 100644 --- a/tests/Browser/ConnectWithStripeTest.php +++ b/tests/Browser/ConnectWithStripeTest.php @@ -9,6 +9,8 @@ use Illuminate\Foundation\Testing\DatabaseMigrations; class ConnectWithStripeTest extends DuskTestCase { + use DatabaseMigrations; + /** @test */ public function connecting_a_stripe_account_successfully() {