Sha256: 6e7612738ae1d6f07943781acda4d72be0f1ed164ee7176d7897500b01503284

Contents?: true

Size: 1.63 KB

Versions: 27

Compression:

Stored size: 1.63 KB

Contents

module Braintree
  class Dispute # :nodoc:
    include BaseModule

    attr_reader :amount
    attr_reader :received_date
    attr_reader :reply_by_date
    attr_reader :status
    attr_reader :reason
    attr_reader :currency_iso_code
    attr_reader :id
    attr_reader :transaction_details
    attr_reader :kind
    attr_reader :date_opened
    attr_reader :date_won

    module Status
      Open = "open"
      Lost = "lost"
      Won = "won"
    end

    module Reason
      CancelledRecurringTransaction = "cancelled_recurring_transaction"
      CreditNotProcessed = "credit_not_processed"
      Duplicate = "duplicate"
      Fraud = "fraud"
      General = "general"
      InvalidAccount = "invalid_account"
      NotRecognized = "not_recognized"
      ProductNotReceived = "product_not_received"
      ProductUnsatisfactory = "product_unsatisfactory"
      TransactionAmountDiffers = "transaction_amount_differs"
      Retrieval = "retrieval"
    end

    module Kind
      Chargeback = "chargeback"
      PreArbitration = "pre_arbitration"
      Retrieval = "retrieval"
    end

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

    def initialize(attributes) # :nodoc:
      set_instance_variables_from_hash(attributes)
      @received_date = Date.parse(received_date)
      @reply_by_date = Date.parse(reply_by_date) unless reply_by_date.nil?
      @amount = Util.to_big_decimal(amount)
      @transaction_details = TransactionDetails.new(@transaction)
      @date_opened = Date.parse(date_opened) unless date_opened.nil?
      @date_won = Date.parse(date_won) unless date_won.nil?
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
braintree-2.76.0 lib/braintree/dispute.rb
braintree-2.75.0 lib/braintree/dispute.rb
braintree-2.74.0 lib/braintree/dispute.rb
braintree-2.73.0 lib/braintree/dispute.rb
braintree-2.72.0 lib/braintree/dispute.rb
braintree-2.71.0 lib/braintree/dispute.rb
braintree-2.70.0 lib/braintree/dispute.rb
braintree-2.69.1 lib/braintree/dispute.rb
braintree-2.69.0 lib/braintree/dispute.rb
braintree-2.68.2 lib/braintree/dispute.rb
braintree-2.68.1 lib/braintree/dispute.rb
braintree-2.68.0 lib/braintree/dispute.rb
braintree-2.67.0 lib/braintree/dispute.rb
braintree-2.66.0 lib/braintree/dispute.rb
braintree-2.65.0 lib/braintree/dispute.rb
braintree-2.64.0 lib/braintree/dispute.rb
braintree-2.63.0 lib/braintree/dispute.rb
braintree-2.62.0 lib/braintree/dispute.rb
braintree-2.61.1 lib/braintree/dispute.rb
braintree-2.61.0 lib/braintree/dispute.rb