Class: MercadoPago::HandleReceivedNotification
- Inherits:
-
Object
- Object
- MercadoPago::HandleReceivedNotification
- Defined in:
- app/services/mercado_pago/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.
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 |