Sha256: 3308e74f38d7733d87321dacecb27bb172171637921bb41b194dfd1b7fad36ea

Contents?: true

Size: 1.39 KB

Versions: 46

Compression:

Stored size: 1.39 KB

Contents

module Braintree
  class ErrorResult

    attr_reader :credit_card_verification
    attr_reader :errors
    attr_reader :merchant_account
    attr_reader :message
    attr_reader :params
    attr_reader :subscription
    attr_reader :transaction
    attr_reader :verification

    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

    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

46 entries across 46 versions & 1 rubygems

Version Path
braintree-4.15.0 lib/braintree/error_result.rb
braintree-4.14.0 lib/braintree/error_result.rb
braintree-4.13.0 lib/braintree/error_result.rb
braintree-4.12.0 lib/braintree/error_result.rb
braintree-4.11.0 lib/braintree/error_result.rb
braintree-4.10.0 lib/braintree/error_result.rb
braintree-4.9.0 lib/braintree/error_result.rb
braintree-4.8.0 lib/braintree/error_result.rb
braintree-4.7.0 lib/braintree/error_result.rb
braintree-4.6.0 lib/braintree/error_result.rb
braintree-4.5.0 lib/braintree/error_result.rb
braintree-4.4.0 lib/braintree/error_result.rb
braintree-4.3.0 lib/braintree/error_result.rb
braintree-4.2.0 lib/braintree/error_result.rb
braintree-4.1.0 lib/braintree/error_result.rb
braintree-4.0.0 lib/braintree/error_result.rb
braintree-3.4.0 lib/braintree/error_result.rb
braintree-3.3.0 lib/braintree/error_result.rb
braintree-3.2.0 lib/braintree/error_result.rb
braintree-3.1.0 lib/braintree/error_result.rb