Sha256: e942e8ac1c16053f919d6f50af73fa4e9ec8119407045162942c440de47c4514

Contents?: true

Size: 1.13 KB

Versions: 19

Compression:

Stored size: 1.13 KB

Contents

module Braintree
  # See http://www.braintreepayments.com/docs/ruby/general/result_objects
  class ErrorResult

    attr_reader :credit_card_verification, :transaction, :subscription, :errors, :params, :message

    def initialize(gateway, data) # :nodoc:
      @gateway = gateway
      @params = data[:params]
      @credit_card_verification = CreditCardVerification._new(data[:verification]) if data[:verification]
      @message = data[:message]
      @transaction = Transaction._new(gateway, data[:transaction]) if data[:transaction]
      @subscription = Subscription._new(gateway, data[:subscription]) if data[:subscription]
      @errors = Errors.new(data[:errors])
    end

    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

    # Always returns false.
    def success?
      false
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
braintree-2.24.0 lib/braintree/error_result.rb
braintree-2.23.0 lib/braintree/error_result.rb
braintree-2.22.0 lib/braintree/error_result.rb
braintree-2.21.0 lib/braintree/error_result.rb
braintree-2.20.0 lib/braintree/error_result.rb
braintree-2.19.0 lib/braintree/error_result.rb
braintree-2.18.0 lib/braintree/error_result.rb
braintree-2.17.0 lib/braintree/error_result.rb
braintree-2.16.0 lib/braintree/error_result.rb
braintree-2.15.0 lib/braintree/error_result.rb
braintree-2.14.0 lib/braintree/error_result.rb
braintree-2.13.4 lib/braintree/error_result.rb
braintree-2.13.3 lib/braintree/error_result.rb
braintree-2.13.2 lib/braintree/error_result.rb
braintree-2.13.1 lib/braintree/error_result.rb
braintree-2.13.0 lib/braintree/error_result.rb
braintree-2.12.0 lib/braintree/error_result.rb
braintree-2.11.0 lib/braintree/error_result.rb
braintree-2.10.1 lib/braintree/error_result.rb