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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d421badea5fa7f2c8701e2fa425ae44a7785e18e24e3d43247a34049db030523
4
- data.tar.gz: 6ff503783c5a6801ecf1891eb367a35440c88749d6e6f7ed0fced31dacaad3a3
3
+ metadata.gz: 7a3514532779deaa212f87e620c7416dc75446a16b777ed1750e8fe174eb21d5
4
+ data.tar.gz: 438c09cb122986b0241e2b2f1880f132570c437a6ea455f875340af128d94bf4
5
5
  SHA512:
6
- metadata.gz: b1de388b1c385d75edc2685bbfe2103972ae050855c6f10f4657aaee4750ed2b4eceda70c9e3bcd89bd425321cf92e7bc2b0b200b186dfff71c2aee4d4d03a1f
7
- data.tar.gz: caebae8e0e2273dc8a8c3f6d5cf2ec2e8cb0c0edb26c55e4c5134b3d361ba2572f792762392a1351de7a1e15e78c6889bb268e082e9e01a367b8d9d849395651
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
@@ -0,0 +1,13 @@
1
+ module Ravelin
2
+ class PaymentMethods < RavelinObject
3
+ attr_reader :methods
4
+
5
+ def initialize(methods)
6
+ @methods = methods
7
+ end
8
+
9
+ def serializable_hash
10
+ methods.map(&:serializable_hash)
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = '0.1.44'
2
+ VERSION = '0.1.45'
3
3
  end
data/lib/ravelin.rb CHANGED
@@ -25,6 +25,7 @@ require 'ravelin/login'
25
25
  require 'ravelin/order'
26
26
  require 'ravelin/app'
27
27
  require 'ravelin/payment_method'
28
+ require 'ravelin/payment_methods'
28
29
  require 'ravelin/password'
29
30
  require 'ravelin/pre_transaction'
30
31
  require 'ravelin/supplier'
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.44
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-01-12 00:00:00.000000000 Z
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: '10.0'
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: '10.0'
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: '2.3'
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: '2.3'
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
- rubyforge_project:
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