Class: AwsTickwork::SnsEndpointController

Inherits:
ApplicationController show all
Defined in:
app/controllers/aws_tickwork/sns_endpoint_controller.rb

Instance Method Summary collapse

Instance Method Details

#notifyObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/aws_tickwork/sns_endpoint_controller.rb', line 12

def notify
  body = JSON.parse(request.raw_post)
  case message_type
  when "SubscriptionConfirmation"
    handle_subscription_confirmation(body)
  when "Notification"
    handle_notification(body)
  else
    # uncrecognized type or type missing
    Rails.logger.warn "Unrecognized message type: #{message_type}"
  end
  head :ok
end