Class: MercadoPago::HandleReceivedNotification

Inherits:
Object
  • Object
show all
Defined in:
app/services/mercado_pago/handle_received_notification.rb

Instance Method Summary collapse

Constructor Details

#initialize(notification) ⇒ HandleReceivedNotification

Returns a new instance of HandleReceivedNotification.



3
4
5
# File 'app/services/mercado_pago/handle_received_notification.rb', line 3

def initialize(notification)
  @notification = notification
end

Instance Method Details

#process!Object

The purpose of this method is to enable async/sync processing of Mercado Pago IPNs. For simplicity processing is synchronous but if you would like to enqueue the processing via Resque/Ost/etc you will be able to do it.



11
12
13
14
15
16
# File 'app/services/mercado_pago/handle_received_notification.rb', line 11

def process!
  # Sync
  ProcessNotification.new(@notification).process!
  # Async Will be configurable via block for example:
  # Resque.enqueue(ProcessNotificationWorker, {id: @notification.id})
end