ravelin 0.1.44 → 0.1.45
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ravelin/event.rb +12 -1
- data/lib/ravelin/payment_methods.rb +13 -0
- data/lib/ravelin/version.rb +1 -1
- data/lib/ravelin.rb +1 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a3514532779deaa212f87e620c7416dc75446a16b777ed1750e8fe174eb21d5
|
4
|
+
data.tar.gz: 438c09cb122986b0241e2b2f1880f132570c437a6ea455f875340af128d94bf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cb12db77f6197ef025b3576488348cba1b51e7c245722d795206cf21bbc706909d3d3030d7dc55b5679bf90087e79383ee45995a54be7a69e0e2c774f03c346
|
7
|
+
data.tar.gz: 7d7c78def62d790084669e4f373c7ae7b0f27bc4c15f61c1125a11516f49c288481f291ebb36d4de2b1991c882d027bbc9a01275356f32a62cf7ffab09bbda38
|
data/lib/ravelin/event.rb
CHANGED
@@ -17,6 +17,8 @@ module Ravelin
|
|
17
17
|
|
18
18
|
if v.is_a?(Ravelin::RavelinObject)
|
19
19
|
[k, v.serializable_hash]
|
20
|
+
elsif v.is_a?(Array)
|
21
|
+
[k, v.map { |elem| elem.respond_to?(:serializable_hash) ? elem.serializable_hash : elem }]
|
20
22
|
else
|
21
23
|
[k, v]
|
22
24
|
end
|
@@ -41,6 +43,7 @@ module Ravelin
|
|
41
43
|
sms_code: AuthenticationMechanisms::SmsCode,
|
42
44
|
magic_link: AuthenticationMechanisms::MagicLink,
|
43
45
|
payment_method: PaymentMethod,
|
46
|
+
payment_methods: PaymentMethods,
|
44
47
|
supplier: Supplier,
|
45
48
|
voucher_redemption: VoucherRedemption,
|
46
49
|
transaction: transaction,
|
@@ -49,6 +52,12 @@ module Ravelin
|
|
49
52
|
}
|
50
53
|
end
|
51
54
|
|
55
|
+
def plural_object_classes
|
56
|
+
{
|
57
|
+
transactions: transaction
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
52
61
|
def transaction
|
53
62
|
case name
|
54
63
|
when :pretransaction
|
@@ -140,8 +149,10 @@ module Ravelin
|
|
140
149
|
k = k.to_sym
|
141
150
|
v = Ravelin.convert_ids_to_strings(k, v)
|
142
151
|
|
143
|
-
if v.is_a?(Hash) && klass = object_classes[k]
|
152
|
+
if (v.is_a?(Hash) || v.is_a?(Array)) && (klass = object_classes[k])
|
144
153
|
[k, klass.new(v)]
|
154
|
+
elsif v.is_a?(Array) && (klass = plural_object_classes[k])
|
155
|
+
[k, v.map { |elem| klass.new(elem) }]
|
145
156
|
else
|
146
157
|
[k, v]
|
147
158
|
end
|
data/lib/ravelin/version.rb
CHANGED
data/lib/ravelin.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.45
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Levy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-
|
14
|
+
date: 2022-10-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
@@ -61,14 +61,14 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - "~>"
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: '
|
64
|
+
version: '13.0'
|
65
65
|
type: :development
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - "~>"
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version: '
|
71
|
+
version: '13.0'
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: rspec
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,14 +89,14 @@ dependencies:
|
|
89
89
|
requirements:
|
90
90
|
- - "~>"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: '
|
92
|
+
version: '3.18'
|
93
93
|
type: :development
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: '
|
99
|
+
version: '3.18'
|
100
100
|
description: Ravelin is a fraud detection tool. See https://www.ravelin.com for details.
|
101
101
|
email:
|
102
102
|
- sam.levy@deliveroo.co.uk
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/ravelin/order.rb
|
134
134
|
- lib/ravelin/password.rb
|
135
135
|
- lib/ravelin/payment_method.rb
|
136
|
+
- lib/ravelin/payment_methods.rb
|
136
137
|
- lib/ravelin/pre_transaction.rb
|
137
138
|
- lib/ravelin/proxy_client.rb
|
138
139
|
- lib/ravelin/ravelin_object.rb
|
@@ -163,8 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
164
|
- !ruby/object:Gem::Version
|
164
165
|
version: '0'
|
165
166
|
requirements: []
|
166
|
-
|
167
|
-
rubygems_version: 2.7.6.2
|
167
|
+
rubygems_version: 3.3.23
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: Ruby bindings for the Ravelin API
|