Skip to content

Commit

Permalink
Modify key syntax (forem#21188)
Browse files Browse the repository at this point in the history
  • Loading branch information
benhalpern authored Jul 30, 2024
1 parent 5bcc6a4 commit 767e394
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/incoming_webhooks/stripe_events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def create

def handle_checkout_session_completed(invoice)
metadata = extract_metadata(invoice)
return unless metadata&.key?("user_id")
return unless metadata["user_id"]

user_id = metadata["user_id"]
user = User.find_by(id: user_id)
Expand All @@ -60,7 +60,7 @@ def handle_checkout_session_completed(invoice)

def handle_subscription_created(subscription)
metadata = extract_metadata(subscription)
return unless metadata&.key?("user_id")
return unless metadata["user_id"]

user_id = metadata["user_id"]
user = User.find_by(id: user_id)
Expand All @@ -71,7 +71,7 @@ def handle_subscription_created(subscription)

def handle_subscription_updated(subscription)
metadata = extract_metadata(subscription)
return unless metadata&.key?("user_id")
return unless metadata["user_id"]

user_id = metadata["user_id"]
user = User.find_by(id: user_id)
Expand All @@ -82,7 +82,7 @@ def handle_subscription_updated(subscription)

def handle_subscription_deleted(subscription)
metadata = extract_metadata(subscription)
return unless metadata&.key?("user_id")
return unless metadata["user_id"]

user_id = metadata["user_id"]
user = User.find_by(id: user_id)
Expand Down

0 comments on commit 767e394

Please sign in to comment.