class ActiveMerchant::Billing::AVSResult
Implements the Address Verification System www.wellsfargo.com/downloads/pdf/biz/merchant/visa_avs.pdf en.wikipedia.org/wiki/Address_Verification_System apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_IG/html/app_avs_cvn_codes.htm#app_AVS_CVN_codes_7891_48375 imgserver.skipjack.com/imgServer/5293710/AVS%20and%20CVV2.pdf www.emsecommerce.net/avs_cvv2_response_codes.htm
Constants
- MESSAGES
- POSTAL_MATCH_CODE
Map vendor's AVS result code to a postal match code
- STREET_MATCH_CODE
Map vendor's AVS result code to a street match code
Attributes
code[R]
message[R]
postal_match[R]
street_match[R]
Public Class Methods
messages()
click to toggle source
# File lib/active_merchant/billing/avs_result.rb, line 66 def self.messages MESSAGES end
new(attrs)
click to toggle source
# File lib/active_merchant/billing/avs_result.rb, line 70 def initialize(attrs) attrs ||= {} @code = attrs[:code].upcase unless attrs[:code].blank? @message = self.class.messages[code] if attrs[:street_match].blank? @street_match = STREET_MATCH_CODE[code] else @street_match = attrs[:street_match].upcase end if attrs[:postal_match].blank? @postal_match = POSTAL_MATCH_CODE[code] else @postal_match = attrs[:postal_match].upcase end end
Public Instance Methods
to_hash()
click to toggle source
# File lib/active_merchant/billing/avs_result.rb, line 89 def to_hash { 'code' => code, 'message' => message, 'street_match' => street_match, 'postal_match' => postal_match } end