Sha256: 3bd7b751770f7cc0d7a31616c40dc20040e563512e6d81239b1eade9f75d79f9

Contents?: true

Size: 1023 Bytes

Versions: 6

Compression:

Stored size: 1023 Bytes

Contents

require_relative '../resource'

module Tickethub
  class Channel::Order < Resource
    path '/channel/orders'

    require_relative 'customer'
    require_relative 'booking'
    require_relative 'payment'

    require_relative 'customer'
    require_relative 'session'

    require_relative 'answer'
    require_relative '../address'

    collection :bookings, Channel::Booking
    collection :payments, Channel::Payment
    collection :answers, Channel::Answer

    association :customer, Channel::Customer
    association :session, Channel::Session
    association :address, Tickethub::Address

    attribute :total, type: :money
    attribute :balance, type: :money
    attribute :currency, type: :currency

    attribute :booked_at, type: :datetime
    attribute :expires_at, type: :datetime
    attribute :confirmed_at, type: :datetime
    attribute :created_at, type: :datetime
    attribute :updated_at, type: :datetime

    def confirm(params = {})
      self.load @endpoint[:confirm].post(params)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tickethub-0.3.100 lib/tickethub/channel/order.rb
tickethub-0.3.99 lib/tickethub/channel/order.rb
tickethub-0.3.98 lib/tickethub/channel/order.rb
tickethub-0.3.97 lib/tickethub/channel/order.rb
tickethub-0.3.96 lib/tickethub/channel/order.rb
tickethub-0.3.95 lib/tickethub/channel/order.rb