Class: Orders::AcknowledgeWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
app/workers/orders/acknowledge_worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(order_id, error = nil, percent = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'app/workers/orders/acknowledge_worker.rb', line 9

def perform(order_id, error=nil, percent=nil)
  order = Order.find(order_id)

  response = RestClient.post "#{Terminal.config.host}/terminal_orders/#{order.foreign_id}/acknowledge",
    :terminal => Terminal.keyword,
    :error    => error,
    :percent  => percent

  order.acknowledged!
end