Sha256: a5a3d55f065d06616161fa88ec84185a7f5e5c08948796fdfdb5899b2d834d3f

Contents?: true

Size: 613 Bytes

Versions: 21

Compression:

Stored size: 613 Bytes

Contents

require_relative '../resource'

module Tickethub
  class Supplier::Charge < Resource
    path '/supplier/charges'

    attribute :amount, type: :money
    attribute :tax, type: :money

    association :context, -> (endpoint, attributes) {
      case attributes['object']
        when 'refund'     then Supplier::Refund.call(endpoint, attributes)
        when 'payment'    then Supplier::Payment.call(endpoint, attributes)
        when 'adjustment' then Supplier::Adjustment.call(endpoint, attributes)
      end
    }

    attribute :updated_at, type: :datetime
    attribute :created_at, type: :datetime
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
tickethub-0.3.42 lib/tickethub/supplier/charge.rb
tickethub-0.3.41 lib/tickethub/supplier/charge.rb
tickethub-0.3.40 lib/tickethub/supplier/charge.rb
tickethub-0.3.39 lib/tickethub/supplier/charge.rb
tickethub-0.3.38 lib/tickethub/supplier/charge.rb
tickethub-0.3.37 lib/tickethub/supplier/charge.rb
tickethub-0.3.36 lib/tickethub/supplier/charge.rb
tickethub-0.3.35 lib/tickethub/supplier/charge.rb
tickethub-0.3.34 lib/tickethub/supplier/charge.rb
tickethub-0.3.33 lib/tickethub/supplier/charge.rb
tickethub-0.3.32 lib/tickethub/supplier/charge.rb
tickethub-0.3.31 lib/tickethub/supplier/charge.rb
tickethub-0.3.30 lib/tickethub/supplier/charge.rb
tickethub-0.3.29 lib/tickethub/supplier/charge.rb
tickethub-0.3.28 lib/tickethub/supplier/charge.rb
tickethub-0.3.27 lib/tickethub/supplier/charge.rb
tickethub-0.3.26 lib/tickethub/supplier/charge.rb
tickethub-0.3.25 lib/tickethub/supplier/charge.rb
tickethub-0.3.24 lib/tickethub/supplier/charge.rb
tickethub-0.3.23 lib/tickethub/supplier/charge.rb