ravelin 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ravelin.rb +2 -0
- data/lib/ravelin/errors/invalid_label_value_error.rb +4 -0
- data/lib/ravelin/event.rb +5 -3
- data/lib/ravelin/label.rb +20 -0
- data/lib/ravelin/response.rb +2 -0
- data/lib/ravelin/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f6b62c84fc36e42c5afedaece47c3a190092fd2
|
4
|
+
data.tar.gz: a22a979b5c94556e8f7f8b8eed40649a91d82e53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 460a193f7a8ae4cea0afe0103b59eb7ea86fd645dff289a46cff2ae559752c368bebbf8527db6e5d7c8453c6d4e97d2be0c720bb9f3cb33f471c8ef4273d7bea
|
7
|
+
data.tar.gz: bc1f563c71e2e3f6e7a81456150d930a45a808c4819a7394566076693abb02bca378628b738c90611f853ee24aa143de1603d10451553a1c330b05bd8f9bcc98
|
data/lib/ravelin.rb
CHANGED
@@ -9,6 +9,7 @@ require 'ravelin/errors/api_error'
|
|
9
9
|
require 'ravelin/errors/invalid_request_error'
|
10
10
|
require 'ravelin/errors/authentication_error'
|
11
11
|
require 'ravelin/errors/rate_limit_error'
|
12
|
+
require 'ravelin/errors/invalid_label_value_error'
|
12
13
|
|
13
14
|
require 'ravelin/ravelin_object'
|
14
15
|
require 'ravelin/chargeback'
|
@@ -20,6 +21,7 @@ require 'ravelin/order'
|
|
20
21
|
require 'ravelin/payment_method'
|
21
22
|
require 'ravelin/pre_transaction'
|
22
23
|
require 'ravelin/transaction'
|
24
|
+
require 'ravelin/label'
|
23
25
|
|
24
26
|
require 'ravelin/event'
|
25
27
|
require 'ravelin/response'
|
data/lib/ravelin/event.rb
CHANGED
@@ -32,7 +32,8 @@ module Ravelin
|
|
32
32
|
location: Location,
|
33
33
|
order: Order,
|
34
34
|
payment_method: PaymentMethod,
|
35
|
-
transaction: self.name == :pretransaction ? PreTransaction : Transaction
|
35
|
+
transaction: self.name == :pretransaction ? PreTransaction : Transaction,
|
36
|
+
label: Label,
|
36
37
|
}
|
37
38
|
end
|
38
39
|
|
@@ -40,7 +41,7 @@ module Ravelin
|
|
40
41
|
|
41
42
|
def validate_top_level_payload_params
|
42
43
|
validate_customer_id_presence_on :order, :paymentmethod,
|
43
|
-
:pretransaction, :transaction
|
44
|
+
:pretransaction, :transaction, :label
|
44
45
|
|
45
46
|
case self.name
|
46
47
|
when :customer
|
@@ -101,7 +102,8 @@ module Ravelin
|
|
101
102
|
def convert_event_name(str)
|
102
103
|
underscore_mapping = {
|
103
104
|
payment_method: :paymentmethod,
|
104
|
-
pre_transaction: :pretransaction
|
105
|
+
pre_transaction: :pretransaction,
|
106
|
+
label: 'label/customer'.to_sym
|
105
107
|
}
|
106
108
|
|
107
109
|
underscore_mapping.fetch(str.to_sym, str.to_sym)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Ravelin
|
2
|
+
class Label < RavelinObject
|
3
|
+
attr_accessor :customer_id,
|
4
|
+
:label,
|
5
|
+
:comment,
|
6
|
+
:reviewer
|
7
|
+
|
8
|
+
attr_required :customer_id,
|
9
|
+
:label,
|
10
|
+
:comment
|
11
|
+
|
12
|
+
LABEL_VALUES = %w(UNREVIEWED GENUINE FRAUDSTER)
|
13
|
+
|
14
|
+
def validate
|
15
|
+
super
|
16
|
+
|
17
|
+
raise InvalidLabelValueError.new("Label value be one of #{LABEL_VALUES.join(', ')}") unless LABEL_VALUES.include?(label)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/ravelin/response.rb
CHANGED
data/lib/ravelin/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ravelin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Levy
|
8
8
|
- Tommy Palmer
|
9
|
+
- Gurkan Oluc
|
9
10
|
autorequire:
|
10
11
|
bindir: exe
|
11
12
|
cert_chain: []
|
12
|
-
date: 2016-06-
|
13
|
+
date: 2016-06-29 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: faraday
|
@@ -99,6 +100,7 @@ description: Ravelin is a fraud detection tool. See https://www.ravelin.com for
|
|
99
100
|
email:
|
100
101
|
- sam.levy@deliveroo.co.uk
|
101
102
|
- tommy.palmer@deliveroo.co.uk
|
103
|
+
- gurkan.oluc@deliveroo.co.uk
|
102
104
|
executables: []
|
103
105
|
extensions: []
|
104
106
|
extra_rdoc_files: []
|
@@ -110,10 +112,12 @@ files:
|
|
110
112
|
- lib/ravelin/device.rb
|
111
113
|
- lib/ravelin/errors/api_error.rb
|
112
114
|
- lib/ravelin/errors/authentication_error.rb
|
115
|
+
- lib/ravelin/errors/invalid_label_value_error.rb
|
113
116
|
- lib/ravelin/errors/invalid_request_error.rb
|
114
117
|
- lib/ravelin/errors/rate_limit_error.rb
|
115
118
|
- lib/ravelin/event.rb
|
116
119
|
- lib/ravelin/item.rb
|
120
|
+
- lib/ravelin/label.rb
|
117
121
|
- lib/ravelin/location.rb
|
118
122
|
- lib/ravelin/order.rb
|
119
123
|
- lib/ravelin/payment_method.rb
|