Skip to content

Commit

Permalink
Don’t throw error if its not a plan we care about
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Aug 8, 2024
1 parent ab57ceb commit a5ba58b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/base/SubscriptionGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,9 @@ protected function handlePlanEvent(array $data): void
$plan = $planService->getPlanByReference($data['data']['object']['id']);

if (!$plan) {
throw new InvalidConfigException('Plan with the reference “' . $data['data']['object']['id'] . '” not found when processing webhook ' . $data['id']);
// replace throw with log
Craft::warning('Plan with the reference “' . $data['data']['object']['id'] . '” not found when processing webhook ' . $data['id'], 'stripe');
return;
}

if ($data['type'] == 'plan.deleted') {
Expand Down

0 comments on commit a5ba58b

Please sign in to comment.