Sha256: f56a8a2131bcb4a08fe318c03c2a0f3f66c23c91508156ffee46ffb2f95e7b2c

Contents?: true

Size: 1.29 KB

Versions: 29

Compression:

Stored size: 1.29 KB

Contents

module Braintree
  class ErrorResult

    attr_reader :credit_card_verification, :merchant_account, :transaction, :subscription, :errors, :params, :message, :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

29 entries across 29 versions & 1 rubygems

Version Path
braintree-2.80.1 lib/braintree/error_result.rb
braintree-2.80.0 lib/braintree/error_result.rb
braintree-2.79.0 lib/braintree/error_result.rb
braintree-2.78.0 lib/braintree/error_result.rb
braintree-2.77.0 lib/braintree/error_result.rb
braintree-2.76.0 lib/braintree/error_result.rb
braintree-2.75.0 lib/braintree/error_result.rb
braintree-2.74.0 lib/braintree/error_result.rb
braintree-2.73.0 lib/braintree/error_result.rb
braintree-2.72.0 lib/braintree/error_result.rb
braintree-2.71.0 lib/braintree/error_result.rb
braintree-2.70.0 lib/braintree/error_result.rb
braintree-2.69.1 lib/braintree/error_result.rb
braintree-2.69.0 lib/braintree/error_result.rb
braintree-2.68.2 lib/braintree/error_result.rb
braintree-2.68.1 lib/braintree/error_result.rb
braintree-2.68.0 lib/braintree/error_result.rb
braintree-2.67.0 lib/braintree/error_result.rb
braintree-2.66.0 lib/braintree/error_result.rb
braintree-2.65.0 lib/braintree/error_result.rb