Class: Mercadopago::HandleReceivedNotification
- Inherits:
-
Object
- Object
- Mercadopago::HandleReceivedNotification
- Defined in:
- app/services/mercadopago/handle_received_notification.rb
Instance Method Summary collapse
-
#initialize(notification) ⇒ HandleReceivedNotification
constructor
A new instance of HandleReceivedNotification.
-
#process! ⇒ Object
The purpose of this method is to enable async/sync processing of Mercado Pago IPNs.
Constructor Details
#initialize(notification) ⇒ HandleReceivedNotification
Returns a new instance of HandleReceivedNotification.
5 6 7 |
# File 'app/services/mercadopago/handle_received_notification.rb', line 5 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.
13 14 15 16 17 18 |
# File 'app/services/mercadopago/handle_received_notification.rb', line 13 def process! # Sync ProcessNotification.new(@notification).process! # Async Will be configurable via block for example: # Resque.enqueue(ProcessNotificationWorker, {id: @notification.id}) end |