class Braintree::Dispute

Attributes

amount[R]
amount_disputed[R]
amount_won[R]
case_number[R]
chargeback_protection_level[R]

NEXT_MAJOR_VERSION Remove this attribute DEPRECATED The chargeback_protection_level attribute is deprecated in favor of protection_level

created_at[R]
currency_iso_code[R]
date_opened[R]
date_won[R]
evidence[R]
graphql_id[R]
id[R]
kind[R]
merchant_account_id[R]
original_dispute_id[R]
paypal_messages[R]
pre_dispute_program[R]
processor_comments[R]
protection_level[R]
reason[R]
reason_code[R]
reason_description[R]
received_date[R]
reference_number[R]
reply_by_date[R]
status[R]
status_history[R]
transaction[R]
transaction_details[R]
updated_at[R]

Public Class Methods

_new(*args) click to toggle source
# File lib/braintree/dispute.rb, line 101
def _new(*args)
  self.new(*args)
end
accept(*args) click to toggle source
# File lib/braintree/dispute.rb, line 106
def self.accept(*args)
  Configuration.gateway.dispute.accept(*args)
end
add_file_evidence(*args) click to toggle source
# File lib/braintree/dispute.rb, line 110
def self.add_file_evidence(*args)
  Configuration.gateway.dispute.add_file_evidence(*args)
end
add_text_evidence(*args) click to toggle source
# File lib/braintree/dispute.rb, line 114
def self.add_text_evidence(*args)
  Configuration.gateway.dispute.add_text_evidence(*args)
end
finalize(*args) click to toggle source
# File lib/braintree/dispute.rb, line 118
def self.finalize(*args)
  Configuration.gateway.dispute.finalize(*args)
end
find(*args) click to toggle source
# File lib/braintree/dispute.rb, line 122
def self.find(*args)
  Configuration.gateway.dispute.find(*args)
end
new(attributes) click to toggle source
# File lib/braintree/dispute.rb, line 134
def initialize(attributes)
  set_instance_variables_from_hash(attributes)
  @date_opened = Date.parse(date_opened) unless date_opened.nil?
  @date_won = Date.parse(date_won) unless date_won.nil?
  @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)
  @amount_disputed = Util.to_big_decimal(amount_disputed)
  @amount_won = Util.to_big_decimal(amount_won)
  if (ChargebackProtectionLevel::All - [ChargebackProtectionLevel::NotProtected]).include?(chargeback_protection_level)
    @protection_level = Dispute.const_get("ProtectionLevel::#{chargeback_protection_level.capitalize}CBP")
  else
    @protection_level = ProtectionLevel::NoProtection
  end

  @evidence = evidence.map do |record|
    Braintree::Dispute::Evidence.new(record)
  end unless evidence.nil?

  @paypal_messages = paypal_messages.map do |record|
    Braintree::Dispute::PayPalMessage.new(record)
  end unless paypal_messages.nil?

  @transaction_details = TransactionDetails.new(transaction)
  @transaction = Transaction.new(transaction)

  @status_history = status_history.map do |event|
    Braintree::Dispute::StatusHistory.new(event)
  end unless status_history.nil?
end
remove_evidence(*args) click to toggle source
# File lib/braintree/dispute.rb, line 126
def self.remove_evidence(*args)
  Configuration.gateway.dispute.remove_evidence(*args)
end