Module: Minfraud

Defined in:
lib/minfraud.rb,
lib/minfraud/enum.rb,
lib/minfraud/errors.rb,
lib/minfraud/report.rb,
lib/minfraud/version.rb,
lib/minfraud/resolver.rb,
lib/minfraud/validates.rb,
lib/minfraud/assessments.rb,
lib/minfraud/model/email.rb,
lib/minfraud/model/error.rb,
lib/minfraud/model/phone.rb,
lib/minfraud/model/score.rb,
lib/minfraud/model/device.rb,
lib/minfraud/model/issuer.rb,
lib/minfraud/error_handler.rb,
lib/minfraud/model/address.rb,
lib/minfraud/model/factors.rb,
lib/minfraud/model/warning.rb,
lib/minfraud/model/abstract.rb,
lib/minfraud/model/insights.rb,
lib/minfraud/components/base.rb,
lib/minfraud/model/subscores.rb,
lib/minfraud/components/email.rb,
lib/minfraud/components/event.rb,
lib/minfraud/components/order.rb,
lib/minfraud/model/ip_address.rb,
lib/minfraud/components/device.rb,
lib/minfraud/model/credit_card.rb,
lib/minfraud/model/disposition.rb,
lib/minfraud/components/account.rb,
lib/minfraud/components/billing.rb,
lib/minfraud/components/payment.rb,
lib/minfraud/model/email_domain.rb,
lib/minfraud/components/shipping.rb,
lib/minfraud/model/ip_risk_reason.rb,
lib/minfraud/http_service/response.rb,
lib/minfraud/model/billing_address.rb,
lib/minfraud/model/geoip2_location.rb,
lib/minfraud/components/addressable.rb,
lib/minfraud/components/credit_card.rb,
lib/minfraud/model/score_ip_address.rb,
lib/minfraud/model/shipping_address.rb,
lib/minfraud/components/custom_inputs.rb,
lib/minfraud/components/shopping_cart.rb,
lib/minfraud/components/report/transaction.rb,
lib/minfraud/components/shopping_cart_item.rb

Overview

rubocop:disable Metrics/ModuleLength

Defined Under Namespace

Modules: Components, Enum, ErrorHandler, HTTPService, Model, Resolver Classes: Assessments, AuthorizationError, BaseError, ClientError, InvalidInputError, NotEnumValueError, Report, RequestFormatError, ServerError

Constant Summary collapse

VERSION =

The Gem version.

'2.6.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.account_idInteger?

The MaxMind account ID that is used for authorization.

Returns:

  • (Integer, nil)


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

def 
  @account_id
end

.enable_validationBoolean?

Enable client side validation. This is disabled by default.

Returns:

  • (Boolean, nil)


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

def enable_validation
  @enable_validation
end

.hostString?

The host to use when connecting to the web service. By default, the client connects to the production host. However, during testing and development, you can set this option to ‘sandbox.maxmind.com’ to use the Sandbox environment’s host. The sandbox allows you to experiment with the API without affecting your production data.

Returns:

  • (String, nil)


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

def host
  @host
end

.license_keyString?

The MaxMind license key that is used for authorization.

Returns:

  • (String, nil)


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

def license_key
  @license_key
end

Class Method Details

.configure {|self| ... } ⇒ Object

Yield self to accept configuration settings.

Yields:

  • (self)


66
67
68
69
70
71
72
73
74
# File 'lib/minfraud.rb', line 66

def configure
  yield self

  pool_size        = 5
  host             = @host.nil? ? 'minfraud.maxmind.com' : @host
  @connection_pool = ConnectionPool.new(size: pool_size) do
    make_http_client.persistent("https://#{host}")
  end
end