Method: ActiveMerchant::Billing::Response#initialize

Defined in:
lib/active_merchant/billing/response.rb

#initialize(success, message, params = {}, options = {}) ⇒ Response

Returns a new instance of Response.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/active_merchant/billing/response.rb', line 25

def initialize(success, message, params = {}, options = {})
  @success, @message, @params = success, message, params.stringify_keys
  @test = options[:test] || false
  @authorization = options[:authorization]
  @fraud_review = options[:fraud_review]
  @error_code = options[:error_code]
  @emv_authorization = options[:emv_authorization]
  @network_transaction_id = options[:network_transaction_id]
  @pending = options[:pending] || false

  @avs_result = if options[:avs_result].kind_of?(AVSResult)
                  options[:avs_result].to_hash
                else
                  AVSResult.new(options[:avs_result]).to_hash
                end

  @cvv_result = if options[:cvv_result].kind_of?(CVVResult)
                  options[:cvv_result].to_hash
                else
                  CVVResult.new(options[:cvv_result]).to_hash
                end
end