Sha256: 5886a92ea70ef193800d7eed7fd0bfaf9a00af9484ec481c47bee2d83ce36d16

Contents?: true

Size: 553 Bytes

Versions: 36

Compression:

Stored size: 553 Bytes

Contents

require 'quick_travel/adapter'
require 'quick_travel/cache'

module QuickTravel
  class PaymentType < Adapter
    self.api_base = '/payment_types'
    self.lookup = true

    def credit_card
      payment_method == 'credit_card'
    end

    def code
      if credit_card
        credit_card_brand.underscore.gsub(/\s/, '_')
      else
        payment_method
      end
    end

    def as_json(options = nil)
      super.merge(code: code)
    end

    def self.information
      get_and_validate('/api/payment_types/information.json')
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
quicktravel_client-4.7.0 lib/quick_travel/payment_type.rb
quicktravel_client-4.6.0 lib/quick_travel/payment_type.rb
quicktravel_client-4.5.0 lib/quick_travel/payment_type.rb
quicktravel_client-4.4.0 lib/quick_travel/payment_type.rb
quicktravel_client-4.3.2 lib/quick_travel/payment_type.rb
quicktravel_client-4.3.1 lib/quick_travel/payment_type.rb
quicktravel_client-4.3.0 lib/quick_travel/payment_type.rb
quicktravel_client-4.2.0 lib/quick_travel/payment_type.rb
quicktravel_client-4.1.0 lib/quick_travel/payment_type.rb
quicktravel_client-4.0.0 lib/quick_travel/payment_type.rb
quicktravel_client-3.9.0 lib/quick_travel/payment_type.rb
quicktravel_client-3.8.1 lib/quick_travel/payment_type.rb
quicktravel_client-3.8.0 lib/quick_travel/payment_type.rb
quicktravel_client-3.7.0 lib/quick_travel/payment_type.rb
quicktravel_client-3.6.1 lib/quick_travel/payment_type.rb
quicktravel_client-3.6.0 lib/quick_travel/payment_type.rb
quicktravel_client-3.5.0 lib/quick_travel/payment_type.rb
quicktravel_client-3.4.0 lib/quick_travel/payment_type.rb
quicktravel_client-3.3.0 lib/quick_travel/payment_type.rb
quicktravel_client-3.2.0 lib/quick_travel/payment_type.rb