Sha256: f90e8dffdef0b74a47f295209a588af7320fc89d1f43068f601f1a34279a12de

Contents?: true

Size: 1.11 KB

Versions: 27

Compression:

Stored size: 1.11 KB

Contents

module Braintree
  class TransactionLineItem
    include BaseModule
    attr_reader :quantity
    attr_reader :name
    attr_reader :description
    attr_reader :kind
    attr_reader :unit_amount
    attr_reader :unit_tax_amount
    attr_reader :unit_of_measure
    attr_reader :discount_amount
    attr_reader :tax_amount
    attr_reader :total_amount
    attr_reader :product_code
    attr_reader :commodity_code
    attr_reader :url

    def initialize(gateway, attributes) # :nodoc:
      @gateway = gateway
      set_instance_variables_from_hash(attributes)
      @quantity = Util.to_big_decimal(quantity)
      @unit_amount = Util.to_big_decimal(unit_amount)
      @unit_tax_amount = Util.to_big_decimal(unit_tax_amount)
      @discount_amount = Util.to_big_decimal(discount_amount)
      @tax_amount = Util.to_big_decimal(tax_amount)
      @total_amount = Util.to_big_decimal(total_amount)
    end

    class << self
      protected :new
      def _new(*args) # :nodoc:
        self.new *args
      end
    end

    def self.find_all(*args)
      Configuration.gateway.transaction_line_item.find_all(*args)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
braintree-3.3.0 lib/braintree/transaction_line_item.rb
braintree-3.2.0 lib/braintree/transaction_line_item.rb
braintree-3.1.0 lib/braintree/transaction_line_item.rb
braintree-3.0.1 lib/braintree/transaction_line_item.rb
braintree-2.104.1 lib/braintree/transaction_line_item.rb
braintree-2.104.0 lib/braintree/transaction_line_item.rb
braintree-2.103.0 lib/braintree/transaction_line_item.rb
braintree-2.102.0 lib/braintree/transaction_line_item.rb
braintree-2.101.0 lib/braintree/transaction_line_item.rb
braintree-2.100.0 lib/braintree/transaction_line_item.rb
braintree-2.99.0 lib/braintree/transaction_line_item.rb
braintree-2.98.0 lib/braintree/transaction_line_item.rb
braintree-2.97.0 lib/braintree/transaction_line_item.rb
braintree-2.96.0 lib/braintree/transaction_line_item.rb
braintree-2.95.0 lib/braintree/transaction_line_item.rb
braintree-2.94.0 lib/braintree/transaction_line_item.rb
braintree-2.93.0 lib/braintree/transaction_line_item.rb
braintree-2.92.0 lib/braintree/transaction_line_item.rb
braintree-2.91.0 lib/braintree/transaction_line_item.rb
braintree-2.90.0 lib/braintree/transaction_line_item.rb