Class: Minfraud::Assessments

Inherits:
Object
  • Object
show all
Includes:
Resolver
Defined in:
lib/minfraud/assessments.rb

Overview

Assessments is used to perform minFraud Score, Insights, and Factors requests.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Resolver

assign

Constructor Details

#initialize(params = {}, resolver = ::Minfraud::Resolver) ⇒ Assessments

Returns a new instance of Assessments.

Parameters:

  • params (Hash) (defaults to: {})

    Hash of parameters. Each key is a symbol corresponding to one of the available component attributes. Values may be component objects or hashes that will be provided to the component constructors.

  • resolver (Minfraud::Resolver) (defaults to: ::Minfraud::Resolver)

    Resolver that maps parameters to components.



73
74
75
76
77
78
# File 'lib/minfraud/assessments.rb', line 73

def initialize(params = {}, resolver = ::Minfraud::Resolver)
  @locales = params.delete('locales')
  @locales = ['en'] if @locales.nil?

  resolver.assign(self, params)
end

Instance Attribute Details

#accountMinfraud::Components::Account?

The Account component.



14
15
16
# File 'lib/minfraud/assessments.rb', line 14

def 
  @account
end

#billingMinfraud::Components::Billing?

The Billing component.



19
20
21
# File 'lib/minfraud/assessments.rb', line 19

def billing
  @billing
end

#credit_cardMinfraud::Components::CreditCard?

The CreditCard component.



24
25
26
# File 'lib/minfraud/assessments.rb', line 24

def credit_card
  @credit_card
end

#custom_inputsMinfraud::Components::CustomInputs?

The CustomInputs component.



29
30
31
# File 'lib/minfraud/assessments.rb', line 29

def custom_inputs
  @custom_inputs
end

#deviceMinfraud::Components::Device?

The Device component.



34
35
36
# File 'lib/minfraud/assessments.rb', line 34

def device
  @device
end

#emailMinfraud::Components::Email?

The Email component.

Returns:



39
40
41
# File 'lib/minfraud/assessments.rb', line 39

def email
  @email
end

#eventMinfraud::Components::Event?

The Event component.

Returns:



44
45
46
# File 'lib/minfraud/assessments.rb', line 44

def event
  @event
end

#orderMinfraud::Components::Order?

The Order component.

Returns:



49
50
51
# File 'lib/minfraud/assessments.rb', line 49

def order
  @order
end

#paymentMinfraud::Components::Payment?

The Payment component.



54
55
56
# File 'lib/minfraud/assessments.rb', line 54

def payment
  @payment
end

#shippingMinfraud::Components::Shipping?

The Shipping component.



59
60
61
# File 'lib/minfraud/assessments.rb', line 59

def shipping
  @shipping
end

#shopping_cartMinfraud::Components::ShoppingCart?

The ShoppingCart component.



64
65
66
# File 'lib/minfraud/assessments.rb', line 64

def shopping_cart
  @shopping_cart
end

Instance Method Details

#factorsMinfraud::HTTPService::Response

Perform a minFraud Factors request.

Returns:

Raises:



94
95
96
# File 'lib/minfraud/assessments.rb', line 94

def factors
  perform_request(:factors)
end

#insightsMinfraud::HTTPService::Response

Perform a minFraud Insights request.

Returns:

Raises:



112
113
114
# File 'lib/minfraud/assessments.rb', line 112

def insights
  perform_request(:insights)
end

#scoreMinfraud::HTTPService::Response

Perform a minFraud Score request.

Returns:

Raises:



130
131
132
# File 'lib/minfraud/assessments.rb', line 130

def score
  perform_request(:score)
end