Sha256: 6137cac3524858d6a9211ae2fe22abd924ab28f1cd455072397bedfc97b76411

Contents?: true

Size: 1.24 KB

Versions: 15

Compression:

Stored size: 1.24 KB

Contents

module Braintree
  # See http://www.braintreepayments.com/docs/ruby/general/card_verification
  class CreditCardVerification
    include BaseModule

    module Status
      FAILED = 'failed'
      GATEWAY_REJECTED = 'gateway_rejected'
      PROCESSOR_DECLINED = 'processor_declined'
      VERIFIED = 'verified'
    end

    attr_reader :avs_error_response_code, :avs_postal_code_response_code, :avs_street_address_response_code,
      :cvv_response_code, :merchant_account_id, :processor_response_code, :processor_response_text, :status,
      :gateway_rejection_reason

    def initialize(attributes) # :nodoc:
      set_instance_variables_from_hash(attributes)
    end

    def inspect # :nodoc:
      attr_order = [
        :status, :processor_response_code, :processor_response_text,
        :cvv_response_code, :avs_error_response_code,
        :avs_postal_code_response_code, :avs_street_address_response_code,
        :merchant_account_id, :gateway_rejection_reason
      ]
      formatted_attrs = attr_order.map do |attr|
        "#{attr}: #{send(attr).inspect}"
      end
      "#<#{self.class} #{formatted_attrs.join(", ")}>"
    end

    class << self
      protected :new
    end

    def self._new(*args) # :nodoc:
      self.new *args
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
braintree-2.18.0 lib/braintree/credit_card_verification.rb
braintree-2.17.0 lib/braintree/credit_card_verification.rb
braintree-2.16.0 lib/braintree/credit_card_verification.rb
braintree-2.15.0 lib/braintree/credit_card_verification.rb
braintree-2.14.0 lib/braintree/credit_card_verification.rb
braintree-2.13.4 lib/braintree/credit_card_verification.rb
braintree-2.13.3 lib/braintree/credit_card_verification.rb
braintree-2.13.2 lib/braintree/credit_card_verification.rb
braintree-2.13.1 lib/braintree/credit_card_verification.rb
braintree-2.10.3 lib/braintree/credit_card_verification.rb
braintree-2.13.0 lib/braintree/credit_card_verification.rb
braintree-2.12.0 lib/braintree/credit_card_verification.rb
braintree-2.11.0 lib/braintree/credit_card_verification.rb
braintree-2.10.2 lib/braintree/credit_card_verification.rb
braintree-2.10.1 lib/braintree/credit_card_verification.rb