ravelin 0.1.44 → 0.1.46

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: 6c83f962f93b06d886e7f3a68570d09d6377409248be85834c7b01e514c45149
4
+ data.tar.gz: 6cc5c0081ccb8c752f1bef3303aaf165b86924e0fc330513f0472d103dc2e014
5
5
  SHA512:
6
- metadata.gz: b1de388b1c385d75edc2685bbfe2103972ae050855c6f10f4657aaee4750ed2b4eceda70c9e3bcd89bd425321cf92e7bc2b0b200b186dfff71c2aee4d4d03a1f
7
- data.tar.gz: caebae8e0e2273dc8a8c3f6d5cf2ec2e8cb0c0edb26c55e4c5134b3d361ba2572f792762392a1351de7a1e15e78c6889bb268e082e9e01a367b8d9d849395651
6
+ metadata.gz: 809aca51a779ff21a13ad78bb255a6f5f81987bbad00e6e6bbc006c64651a7d1422f6a0572a857f1866f554d746dbb0f1c5d50818646f45b3462082183e13cc7
7
+ data.tar.gz: bcd4cab0acd9360ac93246fad19cadec4ecda2bce2784577bc5a049b009dde175c5176a3271ef76c6638aa5fa25e17eb01fef3663c72668b843302ae9e7a212b
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.map { |method| Ravelin::PaymentMethod.new method }
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.46'
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.46
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,28 @@ 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
+ - !ruby/object:Gem::Dependency
101
+ name: public_suffix
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '4.0'
107
+ type: :development
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '4.0'
100
114
  description: Ravelin is a fraud detection tool. See https://www.ravelin.com for details.
101
115
  email:
102
116
  - sam.levy@deliveroo.co.uk
@@ -133,6 +147,7 @@ files:
133
147
  - lib/ravelin/order.rb
134
148
  - lib/ravelin/password.rb
135
149
  - lib/ravelin/payment_method.rb
150
+ - lib/ravelin/payment_methods.rb
136
151
  - lib/ravelin/pre_transaction.rb
137
152
  - lib/ravelin/proxy_client.rb
138
153
  - lib/ravelin/ravelin_object.rb
@@ -163,8 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
178
  - !ruby/object:Gem::Version
164
179
  version: '0'
165
180
  requirements: []
166
- rubyforge_project:
167
- rubygems_version: 2.7.6.2
181
+ rubygems_version: 3.3.23
168
182
  signing_key:
169
183
  specification_version: 4
170
184
  summary: Ruby bindings for the Ravelin API