class Minfraud::Components::Event

Event corresponds to the event object of a minFraud request.

@see dev.maxmind.com/minfraud/#Event_(/event)

Attributes

shop_id[RW]

Your internal ID for the shop, affiliate, or merchant this order is coming from. Required for minFraud users who are resellers, payment providers, gateways and affiliate networks. No specific format is required.

@return [String, nil]

time[RW]

The date and time the event occurred. The string must be in the RFC 3339 date-time format, e.g., ā€œ2012-04-12T23:20:50.52Zā€. The time must be within the past 10 years. If this field is not in the request, the current time will be used.

@see tools.ietf.org/html/rfc3339

@return [String, nil]

transaction_id[RW]

Your internal ID for the transaction. MaxMind can use this to locate a specific transaction in logs, and it will also show up in email alerts and notifications from MaxMind to you. No specific format is required.

@return [String, nil]

Public Class Methods

new(params = {}) click to toggle source

@param params [Hash] Hash of parameters. Each key/value should

correspond to one of the available attributes.
# File lib/minfraud/components/event.rb, line 60
def initialize(params = {})
  @transaction_id = params[:transaction_id]
  @shop_id        = params[:shop_id]
  @time           = params[:time]
  self.type       = params[:type]

  validate
end

Private Instance Methods

validate() click to toggle source
# File lib/minfraud/components/event.rb, line 71
def validate
  return if !Minfraud.enable_validation

  validate_string('transaction_id', 255, @transaction_id)
  validate_string('shop_id', 255, @shop_id)
  validate_rfc3339('time', @time)
end