Sha256: 049e2c94299ad91746870bfdab8a10693fe864e6ad7fcc44fd19466a6ff18c6f

Contents?: true

Size: 1.11 KB

Versions: 17

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

17 entries across 17 versions & 1 rubygems

Version Path
braintree-4.15.0 lib/braintree/transaction_line_item.rb
braintree-4.14.0 lib/braintree/transaction_line_item.rb
braintree-4.13.0 lib/braintree/transaction_line_item.rb
braintree-4.12.0 lib/braintree/transaction_line_item.rb
braintree-4.11.0 lib/braintree/transaction_line_item.rb
braintree-4.10.0 lib/braintree/transaction_line_item.rb
braintree-4.9.0 lib/braintree/transaction_line_item.rb
braintree-4.8.0 lib/braintree/transaction_line_item.rb
braintree-4.7.0 lib/braintree/transaction_line_item.rb
braintree-4.6.0 lib/braintree/transaction_line_item.rb
braintree-4.5.0 lib/braintree/transaction_line_item.rb
braintree-4.4.0 lib/braintree/transaction_line_item.rb
braintree-4.3.0 lib/braintree/transaction_line_item.rb
braintree-4.2.0 lib/braintree/transaction_line_item.rb
braintree-4.1.0 lib/braintree/transaction_line_item.rb
braintree-4.0.0 lib/braintree/transaction_line_item.rb
braintree-3.4.0 lib/braintree/transaction_line_item.rb