Class: Braintree::Dispute
- Inherits:
-
Object
- Object
- Braintree::Dispute
- Includes:
- BaseModule, Util::IdEquality
- Defined in:
- lib/braintree/dispute.rb,
lib/braintree/dispute/evidence.rb,
lib/braintree/dispute/transaction.rb,
lib/braintree/dispute/paypal_message.rb,
lib/braintree/dispute/status_history.rb,
lib/braintree/dispute/transaction_details.rb
Defined Under Namespace
Modules: ChargebackProtectionLevel, Kind, PreDisputeProgram, ProtectionLevel, Reason, Status Classes: Evidence, PayPalMessage, StatusHistory, Transaction, TransactionDetails
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#amount_disputed ⇒ Object
readonly
Returns the value of attribute amount_disputed.
-
#amount_won ⇒ Object
readonly
Returns the value of attribute amount_won.
-
#case_number ⇒ Object
readonly
Returns the value of attribute case_number.
-
#chargeback_protection_level ⇒ Object
readonly
NEXT_MAJOR_VERSION Remove this attribute DEPRECATED The chargeback_protection_level attribute is deprecated in favor of protection_level.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency_iso_code ⇒ Object
readonly
Returns the value of attribute currency_iso_code.
-
#date_opened ⇒ Object
readonly
Returns the value of attribute date_opened.
-
#date_won ⇒ Object
readonly
Returns the value of attribute date_won.
-
#evidence ⇒ Object
readonly
Returns the value of attribute evidence.
-
#graphql_id ⇒ Object
readonly
Returns the value of attribute graphql_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#merchant_account_id ⇒ Object
readonly
Returns the value of attribute merchant_account_id.
-
#original_dispute_id ⇒ Object
readonly
Returns the value of attribute original_dispute_id.
-
#paypal_messages ⇒ Object
readonly
Returns the value of attribute paypal_messages.
-
#pre_dispute_program ⇒ Object
readonly
Returns the value of attribute pre_dispute_program.
-
#processor_comments ⇒ Object
readonly
Returns the value of attribute processor_comments.
-
#protection_level ⇒ Object
readonly
Returns the value of attribute protection_level.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#reason_code ⇒ Object
readonly
Returns the value of attribute reason_code.
-
#reason_description ⇒ Object
readonly
Returns the value of attribute reason_description.
-
#received_date ⇒ Object
readonly
Returns the value of attribute received_date.
-
#reference_number ⇒ Object
readonly
Returns the value of attribute reference_number.
-
#remaining_file_evidence_storage ⇒ Object
readonly
Returns the value of attribute remaining_file_evidence_storage.
-
#reply_by_date ⇒ Object
readonly
Returns the value of attribute reply_by_date.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#status_history ⇒ Object
readonly
Returns the value of attribute status_history.
-
#transaction ⇒ Object
readonly
Returns the value of attribute transaction.
-
#transaction_details ⇒ Object
readonly
Returns the value of attribute transaction_details.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
- ._new(*args) ⇒ Object
- .accept(*args) ⇒ Object
- .add_file_evidence(*args) ⇒ Object
- .add_text_evidence(*args) ⇒ Object
- .finalize(*args) ⇒ Object
- .find(*args) ⇒ Object
- .remove_evidence(*args) ⇒ Object
- .search(&block) ⇒ Object
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Dispute
constructor
A new instance of Dispute.
Methods included from Util::IdEquality
Methods included from BaseModule
Methods included from BaseModule::Methods
#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class
Constructor Details
#initialize(attributes) ⇒ Dispute
Returns a new instance of Dispute.
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/braintree/dispute.rb', line 135 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? = .map do |record| Braintree::Dispute::PayPalMessage.new(record) end unless .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 |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
6 7 8 |
# File 'lib/braintree/dispute.rb', line 6 def amount @amount end |
#amount_disputed ⇒ Object (readonly)
Returns the value of attribute amount_disputed.
7 8 9 |
# File 'lib/braintree/dispute.rb', line 7 def amount_disputed @amount_disputed end |
#amount_won ⇒ Object (readonly)
Returns the value of attribute amount_won.
8 9 10 |
# File 'lib/braintree/dispute.rb', line 8 def amount_won @amount_won end |
#case_number ⇒ Object (readonly)
Returns the value of attribute case_number.
9 10 11 |
# File 'lib/braintree/dispute.rb', line 9 def case_number @case_number end |
#chargeback_protection_level ⇒ Object (readonly)
NEXT_MAJOR_VERSION Remove this attribute DEPRECATED The chargeback_protection_level attribute is deprecated in favor of protection_level
12 13 14 |
# File 'lib/braintree/dispute.rb', line 12 def chargeback_protection_level @chargeback_protection_level end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
13 14 15 |
# File 'lib/braintree/dispute.rb', line 13 def created_at @created_at end |
#currency_iso_code ⇒ Object (readonly)
Returns the value of attribute currency_iso_code.
14 15 16 |
# File 'lib/braintree/dispute.rb', line 14 def currency_iso_code @currency_iso_code end |
#date_opened ⇒ Object (readonly)
Returns the value of attribute date_opened.
15 16 17 |
# File 'lib/braintree/dispute.rb', line 15 def date_opened @date_opened end |
#date_won ⇒ Object (readonly)
Returns the value of attribute date_won.
16 17 18 |
# File 'lib/braintree/dispute.rb', line 16 def date_won @date_won end |
#evidence ⇒ Object (readonly)
Returns the value of attribute evidence.
17 18 19 |
# File 'lib/braintree/dispute.rb', line 17 def evidence @evidence end |
#graphql_id ⇒ Object (readonly)
Returns the value of attribute graphql_id.
18 19 20 |
# File 'lib/braintree/dispute.rb', line 18 def graphql_id @graphql_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
19 20 21 |
# File 'lib/braintree/dispute.rb', line 19 def id @id end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
20 21 22 |
# File 'lib/braintree/dispute.rb', line 20 def kind @kind end |
#merchant_account_id ⇒ Object (readonly)
Returns the value of attribute merchant_account_id.
21 22 23 |
# File 'lib/braintree/dispute.rb', line 21 def merchant_account_id @merchant_account_id end |
#original_dispute_id ⇒ Object (readonly)
Returns the value of attribute original_dispute_id.
22 23 24 |
# File 'lib/braintree/dispute.rb', line 22 def original_dispute_id @original_dispute_id end |
#paypal_messages ⇒ Object (readonly)
Returns the value of attribute paypal_messages.
23 24 25 |
# File 'lib/braintree/dispute.rb', line 23 def end |
#pre_dispute_program ⇒ Object (readonly)
Returns the value of attribute pre_dispute_program.
24 25 26 |
# File 'lib/braintree/dispute.rb', line 24 def pre_dispute_program @pre_dispute_program end |
#processor_comments ⇒ Object (readonly)
Returns the value of attribute processor_comments.
25 26 27 |
# File 'lib/braintree/dispute.rb', line 25 def processor_comments @processor_comments end |
#protection_level ⇒ Object (readonly)
Returns the value of attribute protection_level.
26 27 28 |
# File 'lib/braintree/dispute.rb', line 26 def protection_level @protection_level end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
27 28 29 |
# File 'lib/braintree/dispute.rb', line 27 def reason @reason end |
#reason_code ⇒ Object (readonly)
Returns the value of attribute reason_code.
28 29 30 |
# File 'lib/braintree/dispute.rb', line 28 def reason_code @reason_code end |
#reason_description ⇒ Object (readonly)
Returns the value of attribute reason_description.
29 30 31 |
# File 'lib/braintree/dispute.rb', line 29 def reason_description @reason_description end |
#received_date ⇒ Object (readonly)
Returns the value of attribute received_date.
30 31 32 |
# File 'lib/braintree/dispute.rb', line 30 def received_date @received_date end |
#reference_number ⇒ Object (readonly)
Returns the value of attribute reference_number.
31 32 33 |
# File 'lib/braintree/dispute.rb', line 31 def reference_number @reference_number end |
#remaining_file_evidence_storage ⇒ Object (readonly)
Returns the value of attribute remaining_file_evidence_storage.
35 36 37 |
# File 'lib/braintree/dispute.rb', line 35 def remaining_file_evidence_storage @remaining_file_evidence_storage end |
#reply_by_date ⇒ Object (readonly)
Returns the value of attribute reply_by_date.
32 33 34 |
# File 'lib/braintree/dispute.rb', line 32 def reply_by_date @reply_by_date end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
33 34 35 |
# File 'lib/braintree/dispute.rb', line 33 def status @status end |
#status_history ⇒ Object (readonly)
Returns the value of attribute status_history.
34 35 36 |
# File 'lib/braintree/dispute.rb', line 34 def status_history @status_history end |
#transaction ⇒ Object (readonly)
Returns the value of attribute transaction.
36 37 38 |
# File 'lib/braintree/dispute.rb', line 36 def transaction @transaction end |
#transaction_details ⇒ Object (readonly)
Returns the value of attribute transaction_details.
37 38 39 |
# File 'lib/braintree/dispute.rb', line 37 def transaction_details @transaction_details end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
38 39 40 |
# File 'lib/braintree/dispute.rb', line 38 def updated_at @updated_at end |
Class Method Details
._new(*args) ⇒ Object
102 103 104 |
# File 'lib/braintree/dispute.rb', line 102 def _new(*args) self.new(*args) end |
.accept(*args) ⇒ Object
107 108 109 |
# File 'lib/braintree/dispute.rb', line 107 def self.accept(*args) Configuration.gateway.dispute.accept(*args) end |
.add_file_evidence(*args) ⇒ Object
111 112 113 |
# File 'lib/braintree/dispute.rb', line 111 def self.add_file_evidence(*args) Configuration.gateway.dispute.add_file_evidence(*args) end |
.add_text_evidence(*args) ⇒ Object
115 116 117 |
# File 'lib/braintree/dispute.rb', line 115 def self.add_text_evidence(*args) Configuration.gateway.dispute.add_text_evidence(*args) end |
.finalize(*args) ⇒ Object
119 120 121 |
# File 'lib/braintree/dispute.rb', line 119 def self.finalize(*args) Configuration.gateway.dispute.finalize(*args) end |
.find(*args) ⇒ Object
123 124 125 |
# File 'lib/braintree/dispute.rb', line 123 def self.find(*args) Configuration.gateway.dispute.find(*args) end |
.remove_evidence(*args) ⇒ Object
127 128 129 |
# File 'lib/braintree/dispute.rb', line 127 def self.remove_evidence(*args) Configuration.gateway.dispute.remove_evidence(*args) end |
.search(&block) ⇒ Object
131 132 133 |
# File 'lib/braintree/dispute.rb', line 131 def self.search(&block) Configuration.gateway.dispute.search(&block) end |