Class: Braintree::ErrorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/braintree/error_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gateway, data) ⇒ ErrorResult

:nodoc:


13
14
15
16
17
18
19
20
21
22
23
# File 'lib/braintree/error_result.rb', line 13

def initialize(gateway, data) # :nodoc:
  @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_verificationObject (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

#errorsObject (readonly)

Returns the value of attribute errors.


5
6
7
# File 'lib/braintree/error_result.rb', line 5

def errors
  @errors
end

#merchant_accountObject (readonly)

Returns the value of attribute merchant_account.


6
7
8
# File 'lib/braintree/error_result.rb', line 6

def 
  @merchant_account
end

#messageObject (readonly)

Returns the value of attribute message.


7
8
9
# File 'lib/braintree/error_result.rb', line 7

def message
  @message
end

#paramsObject (readonly)

Returns the value of attribute params.


8
9
10
# File 'lib/braintree/error_result.rb', line 8

def params
  @params
end

#subscriptionObject (readonly)

Returns the value of attribute subscription.


9
10
11
# File 'lib/braintree/error_result.rb', line 9

def subscription
  @subscription
end

#transactionObject (readonly)

Returns the value of attribute transaction.


10
11
12
# File 'lib/braintree/error_result.rb', line 10

def transaction
  @transaction
end

#verificationObject (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

#inspectObject

:nodoc:


25
26
27
28
29
30
31
32
33
# File 'lib/braintree/error_result.rb', line 25

def inspect # :nodoc:
  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

Always returns false.

Returns:

  • (Boolean)

36
37
38
# File 'lib/braintree/error_result.rb', line 36

def success?
  false
end