Class: Minfraud::Components::Event
- Includes:
- Enum
- Defined in:
- lib/minfraud/components/event.rb
Overview
Event corresponds to the event object of a minFraud request.
Instance Attribute Summary collapse
-
#shop_id ⇒ String?
Your internal ID for the shop, affiliate, or merchant this order is coming from.
-
#time ⇒ String?
The date and time the event occurred.
-
#transaction_id ⇒ String?
Your internal ID for the transaction.
-
#type ⇒ Symbol?
The type of event being scored.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Event
constructor
A new instance of Event.
Methods included from Enum
Methods inherited from Base
Constructor Details
#initialize(params = {}) ⇒ Event
Returns a new instance of Event.
60 61 62 63 64 65 66 67 |
# 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 |
Instance Attribute Details
#shop_id ⇒ String?
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.
25 26 27 |
# File 'lib/minfraud/components/event.rb', line 25 def shop_id @shop_id end |
#time ⇒ String?
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.
35 36 37 |
# File 'lib/minfraud/components/event.rb', line 35 def time @time end |
#transaction_id ⇒ String?
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.
17 18 19 |
# File 'lib/minfraud/components/event.rb', line 17 def transaction_id @transaction_id end |
#type ⇒ Symbol?
The type of event being scored. This must be one of :account_creation
, :account_login
, :email_change
, :password_reset
, :payout_change
, :purchase
, :recurring_purchase
, :referral
, or :survey
.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/minfraud/components/event.rb', line 45 enum_accessor :type, %i[ account_creation account_login email_change password_reset payout_change purchase recurring_purchase referral survey ] |