Sha256: 4b4ccad83fa289409b4cb0709c2fde6782012e8f79ed228fb82244fd23b4fbc1

Contents?: true

Size: 949 Bytes

Versions: 2

Compression:

Stored size: 949 Bytes

Contents

module AbtainBilling
  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'  =>  'Suspicious transaction',
        'I'  =>  'Failed data validation check',
        'M'  =>  'Match',
        'N'  =>  'No Match',
        'P'  =>  'Not Processed',
        'S'  =>  'Should have been present',
        'U'  =>  'Issuer unable to process request',
        'X'  =>  'Card does not support verification'
      }
      
      def self.messages
        MESSAGES
      end
      
      attr_reader :code, :message
      
      def initialize(code)
        @code = code.upcase unless code.blank?
        @message = MESSAGES[@code]
      end
      
      def to_hash
        {
          'code' => code,
          'message' => message
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
abtain_billing-1.03 lib/abtain_billing/billing/cvv_result.rb
abtain_billing-1.02 lib/abtain_billing/billing/cvv_result.rb