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

Direct Known Subclasses

OrbitalGateway::CVVResult

Constant Summary collapse

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

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.blank? ? nil : code.upcase)
  @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