synapseruby 1.0.3 → 1.0.6
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/Gemfile +1 -1
- data/Gemfile.lock +3 -3
- data/README.md +2 -0
- data/lib/synapse_api/client.rb +14 -1
- data/lib/synapse_api/version.rb +1 -1
- data/pkg/synapseruby-1.0.3.gem +0 -0
- data/pkg/synapseruby-1.0.4.gem +0 -0
- data/pkg/synapseruby-1.0.5.gem +0 -0
- data/samples.md +9 -2
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2ec61a12be269799de1e59029ec944b83deb237
|
4
|
+
data.tar.gz: f0e595fb6c21ab5c93ae3e89f52277a42a13001e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4686cdc4f9a8d13c427f9bb51b01773c6e8c68571d721c06b7e2afa790d56eaa331933660c2a5a7618bd3e0912ab125b4ea93ae7ac712ddc286f89a776570fa
|
7
|
+
data.tar.gz: 5fdadbbc37377a92c42f6478ed52a927a0486e06f9535718945d00963106640178996733a525ff0a5bf67522f580fcf417c3e10ba5f918548228642da2bfca7d
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
synapseruby (1.0.4)
|
5
5
|
rest-client (~> 2.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -38,12 +38,12 @@ PLATFORMS
|
|
38
38
|
ruby
|
39
39
|
|
40
40
|
DEPENDENCIES
|
41
|
-
bundler
|
41
|
+
bundler (~> 1.10)
|
42
42
|
dotenv (~> 2.1.1)
|
43
43
|
minitest (~> 5.8.2)
|
44
44
|
minitest-reporters (~> 1.1.5)
|
45
45
|
rake (~> 10.0)
|
46
|
-
|
46
|
+
synapseruby!
|
47
47
|
|
48
48
|
BUNDLED WITH
|
49
49
|
1.17.1
|
data/README.md
CHANGED
data/lib/synapse_api/client.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'synapse_fi'
|
2
2
|
|
3
|
+
|
3
4
|
module Synapse
|
4
5
|
# Initializes various wrapper settings such as development mode and request
|
5
6
|
# header values
|
@@ -44,9 +45,14 @@ module Synapse
|
|
44
45
|
# Queries Synapse API to create a new user
|
45
46
|
# @param payload [Hash]
|
46
47
|
# @param idempotency_key [String] (optional)
|
48
|
+
# @param ip_address [String] (optional)
|
49
|
+
# @param fingerprint [String] (optional)
|
47
50
|
# @return [Synapse::User]
|
48
51
|
# @see https://docs.synapsepay.com/docs/create-a-user payload structure
|
49
|
-
def create_user(payload:, **options)
|
52
|
+
def create_user(payload:, ip_address:, **options)
|
53
|
+
|
54
|
+
client.update_headers(ip_address: ip_address, fingerprint: options[:fingerprint])
|
55
|
+
|
50
56
|
response = client.post(user_path,payload, options)
|
51
57
|
|
52
58
|
User.new(user_id: response['_id'],
|
@@ -69,6 +75,8 @@ module Synapse
|
|
69
75
|
# Queries Synapse API for a user by user_id
|
70
76
|
# @param user_id [String] id of the user to find
|
71
77
|
# @param full_dehydrate [String] (optional) if true, returns all KYC on user
|
78
|
+
# @param ip_address [String] (optional)
|
79
|
+
# @param fingerprint [String] (optional)
|
72
80
|
# @see https://docs.synapsefi.com/docs/get-user
|
73
81
|
# @return [Synapse::User]
|
74
82
|
def get_user(user_id:, **options)
|
@@ -78,6 +86,8 @@ module Synapse
|
|
78
86
|
options[:full_dehydrate] = "yes" if options[:full_dehydrate] == true
|
79
87
|
options[:full_dehydrate] = "no" if options[:full_dehydrate] == false
|
80
88
|
|
89
|
+
client.update_headers(ip_address: options[:ip_address], fingerprint: options[:fingerprint])
|
90
|
+
|
81
91
|
path = user_path(user_id: user_id, full_dehydrate: options[:full_dehydrate])
|
82
92
|
response = client.get(path)
|
83
93
|
|
@@ -345,3 +355,6 @@ module Synapse
|
|
345
355
|
end
|
346
356
|
end
|
347
357
|
end
|
358
|
+
|
359
|
+
|
360
|
+
|
data/lib/synapse_api/version.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/samples.md
CHANGED
@@ -75,6 +75,10 @@ client = Synapse::Client.new(args)
|
|
75
75
|
- Returns user instance
|
76
76
|
|
77
77
|
```bash
|
78
|
+
ip_address = "127.0.0"
|
79
|
+
fingerprint = "234092485wsf"
|
80
|
+
idemopotency_key = "222222"
|
81
|
+
|
78
82
|
payload = {
|
79
83
|
"logins": [
|
80
84
|
{
|
@@ -95,7 +99,7 @@ payload = {
|
|
95
99
|
}
|
96
100
|
}
|
97
101
|
|
98
|
-
user = client.create_user(payload: payload)
|
102
|
+
user = client.create_user(payload: payload, ip_address: ip_address, fingerprint: fingerprint, idemopotency_key: idemopotency_key)
|
99
103
|
```
|
100
104
|
|
101
105
|
##### Get User
|
@@ -103,7 +107,10 @@ user = client.create_user(payload: payload)
|
|
103
107
|
|
104
108
|
```bash
|
105
109
|
user_id = "1232"
|
106
|
-
|
110
|
+
fingerprint = "234092485wsf"
|
111
|
+
ip_address = "127.0.0"
|
112
|
+
|
113
|
+
user = client.get_user(user_id: user_id, ip_address: ip_address, fingerprint: fingerprint, full_dehydrate: true)
|
107
114
|
```
|
108
115
|
|
109
116
|
##### Create Subscription
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synapseruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emmanuel Mawutor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -125,6 +125,9 @@ files:
|
|
125
125
|
- pkg/synapseruby-1.0.0.gem
|
126
126
|
- pkg/synapseruby-1.0.1.gem
|
127
127
|
- pkg/synapseruby-1.0.2.gem
|
128
|
+
- pkg/synapseruby-1.0.3.gem
|
129
|
+
- pkg/synapseruby-1.0.4.gem
|
130
|
+
- pkg/synapseruby-1.0.5.gem
|
128
131
|
- samples.md
|
129
132
|
- synapse_fi.gemspec
|
130
133
|
- yarn.lock
|