Class: Minfraud::Assessments

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

Overview

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

Constant Summary

Constants included from HTTPService

HTTPService::DEFAULT_SERVER

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Resolver

assign

Methods included from HTTPService

configuration

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.



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

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.



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

def 
  @account
end

#billingMinfraud::Components::Billing?

The Billing component.



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

def billing
  @billing
end

#credit_cardMinfraud::Components::CreditCard?

The CreditCard component.



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

def credit_card
  @credit_card
end

#custom_inputsMinfraud::Components::CustomInputs?

The CustomInputs component.



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

def custom_inputs
  @custom_inputs
end

#deviceMinfraud::Components::Device?

The Device component.



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

def device
  @device
end

#emailMinfraud::Components::Email?

The Email component.

Returns:



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

def email
  @email
end

#eventMinfraud::Components::Event?

The Event component.

Returns:



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

def event
  @event
end

#orderMinfraud::Components::Order?

The Order component.

Returns:



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

def order
  @order
end

#paymentMinfraud::Components::Payment?

The Payment component.



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

def payment
  @payment
end

#shippingMinfraud::Components::Shipping?

The Shipping component.



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

def shipping
  @shipping
end

#shopping_cartMinfraud::Components::ShoppingCart?

The ShoppingCart component.



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

def shopping_cart
  @shopping_cart
end

Instance Method Details

#factorsMinfraud::HTTPService::Response

Perform a minFraud Factors request.

Returns:

Raises:



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

def factors
  perform_request(:factors)
end

#insightsMinfraud::HTTPService::Response

Perform a minFraud Insights request.

Returns:

Raises:



109
110
111
# File 'lib/minfraud/assessments.rb', line 109

def insights
  perform_request(:insights)
end

#scoreMinfraud::HTTPService::Response

Perform a minFraud Score request.

Returns:

Raises:



125
126
127
# File 'lib/minfraud/assessments.rb', line 125

def score
  perform_request(:score)
end