Sha256: df9d46ece24b73c153bf489b4f35f714bcbf86e680c16eeeca1e6f4382b10ae6

Contents?: true

Size: 983 Bytes

Versions: 70

Compression:

Stored size: 983 Bytes

Contents

module ActiveMerchant
  module Billing
    # Result of the Card Verification Value check
    # http://www.bbbonline.org/eExport/doc/MerchantGuide_cvv2.pdf
    # Check additional codes from cybersource website
    class CVVResult

      MESSAGES = {
        'D'  =>  'CVV check flagged transaction as suspicious',
        'I'  =>  'CVV failed data validation check',
        'M'  =>  'CVV matches',
        'N'  =>  'CVV does not match',
        'P'  =>  'CVV not processed',
        'S'  =>  'CVV should have been present',
        'U'  =>  'CVV request unable to be processed by issuer',
        'X'  =>  'CVV check not supported for card'
      }

      def self.messages
        MESSAGES
      end

      attr_reader :code, :message

      def initialize(code)
        @code = (code.blank? ? nil : code.upcase)
        @message = MESSAGES[@code]
      end

      def to_hash
        {
          'code' => code,
          'message' => message
        }
      end
    end
  end
end

Version data entries

70 entries across 69 versions & 5 rubygems

Version Path
activemerchant-1.66.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.65.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.64.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.63.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.62.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.61.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.60.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.59.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.58.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.57.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.56.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.55.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.54.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.53.0 lib/active_merchant/billing/cvv_result.rb
start_activemerchant-1.50.0 lib/active_merchant/billing/cvv_result.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/activemerchant-1.48.0/lib/active_merchant/billing/cvv_result.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/activemerchant-1.48.0/lib/active_merchant/billing/cvv_result.rb
activemerchant-1.52.0 lib/active_merchant/billing/cvv_result.rb
activemerchant-1.51.0 lib/active_merchant/billing/cvv_result.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/activemerchant-1.44.1/lib/active_merchant/billing/cvv_result.rb