diff --git a/src/Console/WebhookCommand.php b/src/Console/WebhookCommand.php index 02b1f6c5..fb043d08 100644 --- a/src/Console/WebhookCommand.php +++ b/src/Console/WebhookCommand.php @@ -4,7 +4,6 @@ use Illuminate\Console\Command; use Laravel\Cashier\Cashier; -use Stripe\WebhookEndpoint; class WebhookCommand extends Command { @@ -32,7 +31,7 @@ class WebhookCommand extends Command */ public function handle() { - $endpoint = WebhookEndpoint::create([ + $endpoint = Cashier::stripe()->webhookEndpoints->create([ 'enabled_events' => [ 'customer.subscription.created', 'customer.subscription.updated', @@ -43,12 +42,12 @@ public function handle() ], 'url' => $this->option('url') ?? route('cashier.webhook'), 'api_version' => $this->option('api-version') ?? Cashier::STRIPE_VERSION, - ], Cashier::stripeOptions()); + ]); $this->info('The Stripe webhook was created successfully. Retrieve the webhook secret in your Stripe dashboard and define it as an environment variable.'); if ($this->option('disabled')) { - WebhookEndpoint::update($endpoint->id, ['disabled' => true], Cashier::stripeOptions()); + $endpoint->update($endpoint->id, ['disabled' => true]); $this->info('The Stripe webhook was disabled as requested. You may enable the webhook via the Stripe dashboard when needed.'); }