Skip to content

Commit

Permalink
Update StripeWebhook.php
Browse files Browse the repository at this point in the history
Reassign canceled subscription to "registered" role
  • Loading branch information
produktive authored Feb 4, 2025
1 parent c4fcbff commit f16b383
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wave/src/Http/Controllers/Billing/Webhooks/StripeWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public function handler(Request $request)
// this would be true if the user decides to cancel their subscription
if(is_null($stripeSubscription->cancel_at)){
$subscription->ends_at = NULL;
$subscription->user->syncRoles([]);
$subscription->user->assignRole('registered');
} else {
$subscription->ends_at = \Carbon\Carbon::createFromTimestamp($stripeSubscription->cancel_at)->toDateTimeString();
}
Expand Down

0 comments on commit f16b383

Please sign in to comment.