Class: Samurai::ProcessorResponse

Inherits:
Base show all
Defined in:
lib/samurai/processor_response.rb

Overview

Simple class for serializing Samurai <processor_response> entities

Instance Method Summary collapse

Methods inherited from Base

#has_errors?, setup_site!

Instance Method Details

#avs_result_codeObject

Helper method for accessing the AVS result code from the response messages



8
9
10
11
# File 'lib/samurai/processor_response.rb', line 8

def avs_result_code
  avs_result_code_message = self.messages.find {|m| m.context=='processor.avs_result_code' || m.context=='gateway.avs_result_code' }
  avs_result_code_message && avs_result_code_message.key
end

#cvv_result_codeObject

Helper method for accessing the CVV result code from the response messages



14
15
16
17
# File 'lib/samurai/processor_response.rb', line 14

def cvv_result_code
  cvv_result_code_message = self.messages.find {|m| m.context=='processor.cvv_result_code' || m.context=='gateway.cvv_result_code' }
  cvv_result_code_message && cvv_result_code_message.key
end