Sha256: 0fb7aee924adf23ef0d1f19767be4ac3a7bf6a5d94e0e2a0f1b870fb68b6dfa7

Contents?: true

Size: 568 Bytes

Versions: 34

Compression:

Stored size: 568 Bytes

Contents

module Payments
  class CollectWorker
    include Sidekiq::Worker

    sidekiq_options :queue => :payments

    def perform(collection_id)
      collection = Collection.find(collection_id)

      response = RestClient.post "#{Terminal.config.host}/collections",
        :terminal => Terminal.config.keyword,
        :collection => {
          :banknotes => collection.banknotes,
          :collected_at => collection.created_at,
          :session_ids => collection.payment_ids
        }

      collection.update_attribute(:reported_at, DateTime.now)
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
smartkiosk-client-0.2.1 app/workers/payments/collect_worker.rb
smartkiosk-client-0.2 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.19 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.18 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.17 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.16 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.15 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.14 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.13 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.12 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.11 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.10 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.9 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.8 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.7 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.6 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.5 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.4 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.3 app/workers/payments/collect_worker.rb
smartkiosk-client-0.1.2 app/workers/payments/collect_worker.rb