Class: NotificationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/e4commerce/notifications_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/e4commerce/notifications_controller.rb', line 4

def create
  transaction = PagSeguro::Transaction.find_by_notification_code(params[:notificationCode])

  if transaction.errors.empty?
    # Processa a notificação. A melhor maneira de se fazer isso é realizar
    # o processamento em background. Uma boa alternativa para isso é a
    # biblioteca Sidekiq.
  end

  render nothing: true, status: 200
end