talon_one 0.0.10 → 0.1.0
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/CHANGELOG.md +4 -0
- data/lib/integration/client.rb +3 -2
- data/talon_one.gemspec +3 -3
- data/test/test_integration_api_live.rb +21 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9f994e537c582f172f740e93602c4e537632845
|
4
|
+
data.tar.gz: cf603ff40f4892e100aa0e5bf84b719339578312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d513e65fb61c2931b5f3f368d6e605858112c83d37a9182f8879b3694d4655b46ad6cdac9c63cb13d2544f5cb0756624efdfcb976bb6d30ab2ac52ef4311474
|
7
|
+
data.tar.gz: 0fb1ffb44c1936f7518180ec9d6f104a64f62739b03d3abb921acf1f962572d3d4cf72360538c350d121b1c3ccd5b5653b938d7d22e7933dbf31639194a3dc86
|
data/CHANGELOG.md
CHANGED
data/lib/integration/client.rb
CHANGED
@@ -24,7 +24,7 @@ module TalonOne
|
|
24
24
|
|
25
25
|
def request(method, path, payload = nil, result = TalonOne::Integration::RuleEngineResult)
|
26
26
|
req = Net::HTTP.const_get(method).new(@endpoint.path + path)
|
27
|
-
req.body = Oj.dump payload, oj_options(:
|
27
|
+
req.body = Oj.dump payload, oj_options(:custom)
|
28
28
|
signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('md5'), @application_key, req.body)
|
29
29
|
|
30
30
|
req['Content-Type'] = 'application/json'
|
@@ -81,7 +81,8 @@ module TalonOne
|
|
81
81
|
:class_cache => false,
|
82
82
|
:escape_mode => :json,
|
83
83
|
:bigdecimal_as_decimal => true,
|
84
|
-
:bigdecimal_load => :bigdecimal
|
84
|
+
:bigdecimal_load => :bigdecimal,
|
85
|
+
:use_as_json => true }
|
85
86
|
end
|
86
87
|
end
|
87
88
|
end
|
data/talon_one.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'talon_one'
|
3
|
-
s.version = '0.0
|
4
|
-
s.date = '2017-
|
3
|
+
s.version = '0.1.0'
|
4
|
+
s.date = '2017-07-25'
|
5
5
|
s.summary = 'Client for the Talon.One API'
|
6
6
|
s.description = 'A simple client for using the Talon.One API'
|
7
7
|
s.authors = ['Talon.One GmbH']
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.require_paths = ['lib']
|
12
12
|
s.homepage = 'https://github.com/talon-one/talon-one.rb'
|
13
13
|
s.license = 'MIT'
|
14
|
-
s.add_runtime_dependency 'oj', '~>
|
14
|
+
s.add_runtime_dependency 'oj', '~> 3.0'
|
15
15
|
s.add_development_dependency 'rake', '~> 12.0.0'
|
16
16
|
s.add_development_dependency 'minitest', '~> 5.10.1'
|
17
17
|
end
|
@@ -53,6 +53,27 @@ class TestIntegrationApiLive < LiveApiTest
|
|
53
53
|
assert res.event.rejected_coupon?, "invalid coupon code was rejected"
|
54
54
|
end
|
55
55
|
|
56
|
+
def test_oj_calls_as_json
|
57
|
+
payload_class = Class.new do
|
58
|
+
attr_reader :as_json_was_called
|
59
|
+
def as_json
|
60
|
+
@as_json_was_called = true
|
61
|
+
return { URL: "http://example.com" }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
payload = payload_class.new
|
66
|
+
|
67
|
+
res = integration_client.track_event "another-session", @event_type, payload
|
68
|
+
assert res.profile
|
69
|
+
assert payload.as_json_was_called
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_close_customer_session
|
73
|
+
res = integration_client.close_customer_session "new_session"
|
74
|
+
assert res.profile
|
75
|
+
end
|
76
|
+
|
56
77
|
def test_raise_error
|
57
78
|
err = assert_raises TalonOne::Integration::ClientError do
|
58
79
|
integration_client.track_event "a-session", @event_type, { BADURL: "http://example.com" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: talon_one
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Talon.One GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|