sift 2.1.0.1 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7128232d350e48b8d995a964563f59abc841711b
4
- data.tar.gz: 2435be27aafc1d50c1c9164d4a9f710dc9c39f43
3
+ metadata.gz: 03c97cb00f55ae8efdebca7310032148f3fff43a
4
+ data.tar.gz: 7f61b55899b79cdd834c956dc392bc865bcb2855
5
5
  SHA512:
6
- metadata.gz: c0d73c7e7cfed82f491a962dffde5a50f0ba2bf3222f4e2fcfd0ad5178dc22c62e05fdedf499f8f6190584e0d51aaa33beeafd14e41d83ab8022561cff26ea3f
7
- data.tar.gz: 727a90286c78154b61c8fa864115c79d648f22b14b94495956838edc7b92dfe371acd9bdd970c85e29b02d96b6a3490f102901ee82cfa446be474d747849c59d
6
+ metadata.gz: 9280032c8da35f1b9d874a9b7576972e2990ace48c4217564faf304989991738a259226ae5bda44a27505e7e10dd3a39f65616cf8a0523f80dbfb3b257e0d9cf
7
+ data.tar.gz: f8004f92021c98b55d4835201d9b4a5003a53bbf39ce9149a6ef71989f700715ee298cc8828620dc452afcebd76adcc323ef0fe1de8df7f5da7698659a6138ca
data/README.md CHANGED
@@ -132,7 +132,7 @@ Applies a decision to an entity. Visit our [developer docs](http://siftscience.c
132
132
  **Examples:**
133
133
  ```ruby
134
134
  # apply decision to a user
135
- response = client.apply_decision_to({
135
+ response = client.apply_decision({
136
136
  decision_id: "block_bad_user",
137
137
  source: "manual_review",
138
138
  analyst: "bob@your_company.com",
@@ -140,7 +140,7 @@ response = client.apply_decision_to({
140
140
  })
141
141
 
142
142
  # apply decision to "bob@example.com"'s order
143
- response = client.apply_decision_to({
143
+ response = client.apply_decision({
144
144
  decision_id: "block_bad_order",
145
145
  source: "manual_review",
146
146
  analyst: "bob@your_company.com",
@@ -1,5 +1,6 @@
1
- require 'httparty'
2
- require 'multi_json'
1
+ require "httparty"
2
+ require "multi_json"
3
+ require "base64"
3
4
 
4
5
  require_relative "./client/decision"
5
6
  require_relative "./error"
@@ -1,5 +1,4 @@
1
1
  require "cgi"
2
- require "base64"
3
2
 
4
3
  require_relative "../router"
5
4
  require_relative "../validate/decision"
@@ -9,7 +9,15 @@ module Sift
9
9
  class Client
10
10
  class Decision
11
11
  class ApplyTo
12
- PROPERTIES = %w{ source analyst description order_id user_id account_id }
12
+ PROPERTIES = %w{
13
+ source
14
+ analyst
15
+ description
16
+ order_id
17
+ user_id
18
+ account_id
19
+ time
20
+ }
13
21
 
14
22
  attr_reader :decision_id, :configs, :getter, :api_key
15
23
 
@@ -57,7 +65,8 @@ module Sift
57
65
  source: source,
58
66
  description: description,
59
67
  analyst: analyst,
60
- decision_id: decision_id
68
+ decision_id: decision_id,
69
+ time: time
61
70
  }
62
71
  end
63
72
 
@@ -1,4 +1,4 @@
1
1
  module Sift
2
- VERSION = "2.1.0.1"
2
+ VERSION = "2.1.1"
3
3
  API_VERSION = "204"
4
4
  end
@@ -41,12 +41,19 @@ module Sift
41
41
  source: "manual",
42
42
  analyst: "foobar@example.com",
43
43
  description: "be blocking errrday allday",
44
- decision: decision,
45
- user_id: "user_1234"
44
+ user_id: "user_1234",
45
+ time: 1234,
46
+ fake_param: "this should not exist"
46
47
  }
47
48
 
48
49
  applier = ApplyTo.new(api_key, decision_id, configs)
49
- request_body = MultiJson.dump(applier.send(:request_body))
50
+ request_body = MultiJson.dump({
51
+ source: configs[:source],
52
+ description: configs[:description],
53
+ analyst: configs[:analyst],
54
+ decision_id: decision_id,
55
+ time: 1234
56
+ })
50
57
 
51
58
  response_body = {
52
59
  "entity" => {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sift
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.1
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Sadaghiani
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-01-23 00:00:00.000000000 Z
13
+ date: 2017-06-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project: sift
161
- rubygems_version: 2.4.8
161
+ rubygems_version: 2.5.1
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Sift Science Ruby API Gem