Skip to content

Commit 534efae

Browse files
committed
stripe v7 compatibility
1 parent 9199acf commit 534efae

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
}
1111
],
1212
"require": {
13+
"php": "^7.1.3",
1314
"laravel/framework": "5.*|6.*",
1415
"stripe/stripe-php": "4.*|5.*|6.*"
1516
},

src/Console/Commands/CreateStripeEndpoints.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function handle()
4646

4747
try {
4848
$this->createEndpoints();
49-
} catch (\Stripe\Error\InvalidRequest $e) {
49+
} catch (\Stripe\Error\InvalidRequest | \Stripe\Exception\InvalidRequest $e) {
5050
$this->error($e->getMessage());
5151
}
5252

@@ -60,7 +60,7 @@ public function handle()
6060
*/
6161
protected function createEndpoints()
6262
{
63-
$endpoint = \Stripe\WebhookEndpoint::create([
63+
\Stripe\WebhookEndpoint::create([
6464
'url' => config('app.url').'/webhook/stripe',
6565
'enabled_events' => [
6666
'customer.subscription.updated',

src/Console/Commands/CreateStripePlans.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function createProduct()
7979
]);
8080

8181
$this->info('Stripe product created: ' . $id);
82-
} catch (\Stripe\Error\InvalidRequest $e) {
82+
} catch (\Stripe\Error\InvalidRequest | \Stripe\Exception\InvalidRequest $e) {
8383
$this->line('Stripe product ' . $id . ' already exists');
8484
}
8585

@@ -111,7 +111,7 @@ protected function createStripePlans($plans)
111111
]);
112112

113113
$this->info('Stripe plan created: ' . $plan->id);
114-
} catch (\Stripe\Error\InvalidRequest $e) {
114+
} catch (\Stripe\Error\InvalidRequest | \Stripe\Exception\InvalidRequest $e) {
115115
$this->line('Stripe plan ' . $plan->id . ' already exists');
116116
}
117117
}

0 commit comments

Comments
 (0)