ravelin 0.1.45 → 0.1.47

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: 7a3514532779deaa212f87e620c7416dc75446a16b777ed1750e8fe174eb21d5
4
- data.tar.gz: 438c09cb122986b0241e2b2f1880f132570c437a6ea455f875340af128d94bf4
3
+ metadata.gz: 3c658a67cc9147a5494723b434bfedfe44f9ed7afc3ec3ecacf669f2f657f3da
4
+ data.tar.gz: 380067a9cd40b0d7acc00d924d249f1cb0f24ea15c6ed0a108b138dde6950f94
5
5
  SHA512:
6
- metadata.gz: 6cb12db77f6197ef025b3576488348cba1b51e7c245722d795206cf21bbc706909d3d3030d7dc55b5679bf90087e79383ee45995a54be7a69e0e2c774f03c346
7
- data.tar.gz: 7d7c78def62d790084669e4f373c7ae7b0f27bc4c15f61c1125a11516f49c288481f291ebb36d4de2b1991c882d027bbc9a01275356f32a62cf7ffab09bbda38
6
+ metadata.gz: fe1cd7ed644cd7d92b899197d2a7c4d0204c784eb57cb02fca8e299492c3b27cd3ebde4920b65ac7bd12b4e5d48e4ac67b89eb9f091778896f882e94cd6ab394
7
+ data.tar.gz: 192540941b834e6391899dc6723b7ae2c5ae384a22d57b5a2a1650ded9c47f5f3647cef137f211d329faee4c2e0261e32df13a2a7defa28aa50b98a7019c075e
@@ -27,11 +27,12 @@ module Ravelin
27
27
 
28
28
  def send_event(**args)
29
29
  score = args.delete(:score)
30
+ headers = args.delete(:headers)
30
31
  event = Event.new(**args)
31
32
 
32
33
  score_param = score ? "?score=true" : nil
33
34
 
34
- post("#{@url_prefix}/v#{@api_version}/#{event.name}#{score_param}", event.serializable_hash)
35
+ post("#{@url_prefix}/v#{@api_version}/#{event.name}#{score_param}", event.serializable_hash, headers)
35
36
  end
36
37
 
37
38
  def send_backfill_event(**args)
@@ -67,8 +68,12 @@ module Ravelin
67
68
 
68
69
  private
69
70
 
70
- def post(url, payload)
71
- response = @connection.post(url, payload.to_json)
71
+ def post(url, payload, headers = {})
72
+ response = @connection.post(url, payload.to_json) do |request|
73
+ headers&.each { |key, value|
74
+ request.headers[key] = value
75
+ }
76
+ end
72
77
 
73
78
  if response.success?
74
79
  Response.new(response)
@@ -3,7 +3,7 @@ module Ravelin
3
3
  attr_reader :methods
4
4
 
5
5
  def initialize(methods)
6
- @methods = methods
6
+ @methods = methods.map { |method| Ravelin::PaymentMethod.new method }
7
7
  end
8
8
 
9
9
  def serializable_hash
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = '0.1.45'
2
+ VERSION = '0.1.47'
3
3
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ravelin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.45
4
+ version: 0.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Levy
8
8
  - Tommy Palmer
9
9
  - Gurkan Oluc
10
10
  - Mathilda Thompson
11
- autorequire:
11
+ autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2022-10-17 00:00:00.000000000 Z
14
+ date: 2024-04-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -97,6 +97,20 @@ dependencies:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
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
@@ -149,7 +163,7 @@ homepage: https://developer.ravelin.com
149
163
  licenses:
150
164
  - MIT
151
165
  metadata: {}
152
- post_install_message:
166
+ post_install_message:
153
167
  rdoc_options: []
154
168
  require_paths:
155
169
  - lib
@@ -164,8 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
178
  - !ruby/object:Gem::Version
165
179
  version: '0'
166
180
  requirements: []
167
- rubygems_version: 3.3.23
168
- signing_key:
181
+ rubygems_version: 3.0.9
182
+ signing_key:
169
183
  specification_version: 4
170
184
  summary: Ruby bindings for the Ravelin API
171
185
  test_files: []