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.



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

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

Class Method Details

.messagesObject



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

def self.messages
  MESSAGES
end

Instance Method Details

#to_hashObject



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

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