Sha256: 2f304c68ea8cc0efc1bf27033182924ae7298dfffe6ac5c231af5facc551a8e5

Contents?: true

Size: 981 Bytes

Versions: 44

Compression:

Stored size: 981 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 :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

44 entries across 44 versions & 1 rubygems

Version Path
tickethub-0.3.94 lib/tickethub/channel/order.rb
tickethub-0.3.93 lib/tickethub/channel/order.rb
tickethub-0.3.92 lib/tickethub/channel/order.rb
tickethub-0.3.91 lib/tickethub/channel/order.rb
tickethub-0.3.90 lib/tickethub/channel/order.rb
tickethub-0.3.89 lib/tickethub/channel/order.rb
tickethub-0.3.88 lib/tickethub/channel/order.rb
tickethub-0.3.87 lib/tickethub/channel/order.rb
tickethub-0.3.86 lib/tickethub/channel/order.rb
tickethub-0.3.85 lib/tickethub/channel/order.rb
tickethub-0.3.84 lib/tickethub/channel/order.rb
tickethub-0.3.82 lib/tickethub/channel/order.rb
tickethub-0.3.81 lib/tickethub/channel/order.rb
tickethub-0.3.80 lib/tickethub/channel/order.rb
tickethub-0.3.79 lib/tickethub/channel/order.rb
tickethub-0.3.78 lib/tickethub/channel/order.rb
tickethub-0.3.77 lib/tickethub/channel/order.rb
tickethub-0.3.76 lib/tickethub/channel/order.rb
tickethub-0.3.75 lib/tickethub/channel/order.rb
tickethub-0.3.74 lib/tickethub/channel/order.rb