Siftsciex v0.3.1 Siftsciex.Decision View Source

The Decision module defines an internal structure for the data Sift Science sends in their Webhook payload.

This data indicates that an action should be taken on the given “entity”. Webhooks are triggered either by conditions in one of your Workflows or manual actions taken in Sift Science by humans in your organization (reviewer actions).

Link to this section Summary

Functions

Creates a new Siftsciex.Decision.t/0 struct from the given map (parsed JSON)

Link to this section Types

Link to this type entity_type() View Source
entity_type() :: :user | :order | :session | :content
Link to this type t() View Source
t() :: %Siftsciex.Decision{
  decision: String.t(),
  entity: entity(),
  time: DateTime.t()
}

Link to this section Functions

Creates a new Siftsciex.Decision.t/0 struct from the given map (parsed JSON)

Parameters

  • body: A map representing the parsed JSON for a Sift Science Decision

Examples

iex> Decision.new(%{"entity" => %{"type" => "user", "id" => "8"}, "decision" => %{"id" => "steralize"}, "time" => 1528813580})
%Decision{entity: {:user, "8"}, decision: "steralize", time: #DateTime<2018-06-12 14:26:20Z>}