Class: Minfraud::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/minfraud/request.rb

Constant Summary collapse

FIELD_MAP =
{
  ip: 'i',
  city: 'city',
  state: 'region',
  postal: 'postal',
  country: 'country',
  license_key: 'license_key',
  ship_addr: 'shipAddr',
  ship_city: 'shipCity',
  ship_state: 'shipRegion',
  ship_postal: 'shipPostal',
  ship_country: 'shipCountry',
  email_domain: 'domain',
  email_md5: 'emailMD5',
  phone: 'custPhone',
  bin: 'bin',
  session_id: 'sessionID',
  user_agent: 'user_agent',
  accept_language: 'accept_language',
  txn_id: 'txnID',
  amount: 'order_amount',
  currency: 'order_currency',
  txn_type: 'txn_type',
  avs_result: 'avs_result',
  cvv_result: 'cvv_result',
  requested_type: 'requested_type',
  forwarded_ip: 'forwardedIP'
}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trans) ⇒ Request

Returns a new instance of Request.

Parameters:

  • trans (Transaction)

    transaction to be sent to MaxMind


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

def initialize(trans)
  @transaction = trans
end

Class Method Details

.get(trans) ⇒ Response

Sends transaction to MaxMind and gives raw response to Response for handling

Parameters:

  • trans (Transaction)

    transaction to get to MaxMind

Returns:

  • (Response)

    wrapper for minFraud response


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

def self.get(trans)
  new(trans).get
end

Instance Method Details

#getResponse

Sends transaction to MaxMind and gives raw response to Response for handling

Returns:

  • (Response)

    wrapper for minFraud response


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

def get
  Response.new(send_get_request)
end