Class: ActiveMerchant::Billing::CVVResult

Inherits:
Object
  • Object
show all
Defined in:
lib/active_merchant/billing/cvv_result.rb

Overview

Result of the Card Verification Value check www.bbbonline.org/eExport/doc/MerchantGuide_cvv2.pdf Check additional codes from cybersource website

Constant Summary collapse

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'
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ CVVResult

Returns a new instance of CVVResult.



25
26
27
28
# File 'lib/active_merchant/billing/cvv_result.rb', line 25

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



23
24
25
# File 'lib/active_merchant/billing/cvv_result.rb', line 23

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



23
24
25
# File 'lib/active_merchant/billing/cvv_result.rb', line 23

def message
  @message
end

Class Method Details

.messagesObject



19
20
21
# File 'lib/active_merchant/billing/cvv_result.rb', line 19

def self.messages
  MESSAGES
end

Instance Method Details

#to_hashObject



30
31
32
33
34
35
# File 'lib/active_merchant/billing/cvv_result.rb', line 30

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