Module: Kount

Defined in:
lib/kount.rb,
lib/kount/cart.rb,
lib/kount/client.rb,
lib/kount/request.rb,
lib/kount/utils/khash.rb,
lib/kount/payment_types.rb,
lib/kount/security_mash.rb,
lib/kount/request/update.rb,
lib/kount/request/inquiry.rb

Overview

This module is the main entry point to the service wrapper. Its primary function is to collect the runtime options and return a Client object, on which all of the runtime integration takes place.

Defined Under Namespace

Classes: Cart, Client, Inquiry, Khash, PaymentTypes, Request, SecurityMash, Update

Class Method Summary collapse

Class Method Details

.new(options = {}) ⇒ Object

Creates the client object

Expected options include:

options = {
  :merchant_id => "MERCHANT_ID" # required (6 digit number)
  :ksalt => "KSALT" # required (provided by Kount)
  :key => "RIS_KEY" # required (created in the AWC web app)
  :endpoint => "RIS_ENDPOINT" # optional (default https://risk.kount.net)
  :version => "RIS_VERSION" # optional (defaults "0630")
  :is_test => "IS_TEST" # optional (defaults to false)
 }

Parameters:

  • options (defaults to: {})

    Hash

Raises:

  • (ArgumentError)


23
24
25
26
27
28
# File 'lib/kount.rb', line 23

def new(options = {})
  @logger = Logger.new("Logs.log")
  raise ArgumentError, 'Config options required' if options.empty?
  @logger.info("Options passed by client : #{options}")
  Client.new(options)
end