class ActiveMerchant::Billing::Response

Attributes

authorization[R]
avs_result[R]
cvv_result[R]
emv_authorization[R]
error_code[R]
message[R]
network_transaction_id[R]
params[R]
test[R]

Public Class Methods

new(success, message, params = {}, options = {}) click to toggle source
# 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]

  @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

Public Instance Methods

failure?() click to toggle source
# File lib/active_merchant/billing/response.rb, line 13
def failure?
  !success?
end
fraud_review?() click to toggle source
# File lib/active_merchant/billing/response.rb, line 21
def fraud_review?
  @fraud_review
end
success?() click to toggle source
# File lib/active_merchant/billing/response.rb, line 9
def success?
  @success
end
test?() click to toggle source
# File lib/active_merchant/billing/response.rb, line 17
def test?
  @test
end