Class: Braintree::ErrorResult
- Inherits:
-
Object
- Object
- Braintree::ErrorResult
- Defined in:
- lib/braintree/error_result.rb
Instance Attribute Summary collapse
-
#credit_card_verification ⇒ Object
readonly
Returns the value of attribute credit_card_verification.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#merchant_account ⇒ Object
readonly
Returns the value of attribute merchant_account.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#subscription ⇒ Object
readonly
Returns the value of attribute subscription.
-
#transaction ⇒ Object
readonly
Returns the value of attribute transaction.
-
#verification ⇒ Object
readonly
Returns the value of attribute verification.
Instance Method Summary collapse
-
#initialize(gateway, data) ⇒ ErrorResult
constructor
A new instance of ErrorResult.
- #inspect ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(gateway, data) ⇒ ErrorResult
Returns a new instance of ErrorResult.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/braintree/error_result.rb', line 13 def initialize(gateway, data) @gateway = gateway @params = data[:params] @credit_card_verification = CreditCardVerification._new(data[:verification]) if data[:verification] @merchant_account = MerchantAccount._new(gateway, data[:merchant_account]) if data[:merchant_account] @message = data[:message] @transaction = Transaction._new(gateway, data[:transaction]) if data[:transaction] @verification = CreditCardVerification._new(data[:verification]) if data[:verification] @subscription = Subscription._new(gateway, data[:subscription]) if data[:subscription] @errors = Errors.new(data[:errors]) end |
Instance Attribute Details
#credit_card_verification ⇒ Object (readonly)
Returns the value of attribute credit_card_verification.
4 5 6 |
# File 'lib/braintree/error_result.rb', line 4 def credit_card_verification @credit_card_verification end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/braintree/error_result.rb', line 5 def errors @errors end |
#merchant_account ⇒ Object (readonly)
Returns the value of attribute merchant_account.
6 7 8 |
# File 'lib/braintree/error_result.rb', line 6 def merchant_account @merchant_account end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/braintree/error_result.rb', line 7 def @message end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
8 9 10 |
# File 'lib/braintree/error_result.rb', line 8 def params @params end |
#subscription ⇒ Object (readonly)
Returns the value of attribute subscription.
9 10 11 |
# File 'lib/braintree/error_result.rb', line 9 def subscription @subscription end |
#transaction ⇒ Object (readonly)
Returns the value of attribute transaction.
10 11 12 |
# File 'lib/braintree/error_result.rb', line 10 def transaction @transaction end |
#verification ⇒ Object (readonly)
Returns the value of attribute verification.
11 12 13 |
# File 'lib/braintree/error_result.rb', line 11 def verification @verification end |
Instance Method Details
#inspect ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/braintree/error_result.rb', line 25 def inspect if @credit_card_verification verification_inspect = " credit_card_verification: #{@credit_card_verification.inspect}" end if @transaction transaction_inspect = " transaction: #{@transaction.inspect}" end "#<#{self.class} params:{...} errors:<#{@errors._inner_inspect}>#{verification_inspect}#{transaction_inspect}>" end |
#success? ⇒ Boolean
35 36 37 |
# File 'lib/braintree/error_result.rb', line 35 def success? false end |