synapse_payments 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/synapse_payments/request.rb +1 -2
- data/lib/synapse_payments/user_client.rb +10 -0
- data/lib/synapse_payments/version.rb +1 -1
- data/samples.md +16 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35a9dc822e2c93fb45ffb66ecd3266ac0404bbe5
|
4
|
+
data.tar.gz: 974dffa4495ac7263f7cfe8d4f2faa7395d9b5ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf3c83596ce89395af6c1f04b444ff7b1b3a159d7a2f1ca7631535df97a67e7b5b6f003a02b7c54875ae2aec27bd1e5248b8b743ddca0828fc17b11b24fb3f26
|
7
|
+
data.tar.gz: 97de57649cf99f5113f86943366552df92eae0ebe79b55466dcf8985432fbd355fe7bcc8179950aa5e835baebfef70b2439e5698efbb4aa49f01b40cfe272203
|
@@ -2,7 +2,6 @@ module SynapsePayments
|
|
2
2
|
class Request
|
3
3
|
|
4
4
|
HEADERS = {
|
5
|
-
'Accept' => 'application/json',
|
6
5
|
'User-Agent' => "SynapsePaymentsRubyGem/#{SynapsePayments::VERSION}",
|
7
6
|
'X-Ruby-Version' => RUBY_VERSION,
|
8
7
|
'X-Ruby-Platform' => RUBY_PLATFORM
|
@@ -32,7 +31,7 @@ module SynapsePayments
|
|
32
31
|
'X-SP-USER' => "#{@oauth_key}|#{@fingerprint}",
|
33
32
|
'X-SP-USER-IP' => ''
|
34
33
|
})
|
35
|
-
HTTP.headers(headers).timeout(@client.timeout_options)
|
34
|
+
HTTP.headers(headers).accept(:json).timeout(@client.timeout_options)
|
36
35
|
end
|
37
36
|
|
38
37
|
def fail_or_return_response_body(code, body)
|
@@ -23,6 +23,16 @@ module SynapsePayments
|
|
23
23
|
@client.get(path: "/users/#{@user_id}", oauth_key: @oauth_key)
|
24
24
|
end
|
25
25
|
|
26
|
+
def update(data)
|
27
|
+
raise ArgumentError, 'Argument is not a hash' unless data.is_a? Hash
|
28
|
+
|
29
|
+
if data[:doc].nil?
|
30
|
+
data = { refresh_token: self.refresh_token, update: data }
|
31
|
+
end
|
32
|
+
|
33
|
+
@client.patch(path: "/users/#{@user_id}", oauth_key: @oauth_key, fingerprint: @fingerprint, json: data)
|
34
|
+
end
|
35
|
+
|
26
36
|
# Adds a virtual document for KYC
|
27
37
|
#
|
28
38
|
# @param birthdate [Date]
|
data/samples.md
CHANGED
@@ -28,8 +28,21 @@ response[1][:bank_name]
|
|
28
28
|
# => "Bank of America"
|
29
29
|
```
|
30
30
|
|
31
|
+
### Subscriptions
|
32
|
+
|
33
|
+
Note: This is a feature only available for the Advanced or Premium plans.
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
client.subscriptions.all
|
37
|
+
client.subscriptions.create(url: 'http://site.com/callback', scope: ['USERS|PATCH'])
|
38
|
+
client.subscriptions.find(id)
|
39
|
+
client.subscriptions.update(id, url: 'http://site.com/new_callback', is_active: false)
|
40
|
+
```
|
41
|
+
|
31
42
|
### Users
|
32
43
|
|
44
|
+
All actions below require and assume user authentication.
|
45
|
+
|
33
46
|
#### Retrieve all users (paginated)
|
34
47
|
|
35
48
|
```ruby
|
@@ -88,7 +101,9 @@ user[:legal_names]
|
|
88
101
|
|
89
102
|
#### Update a user
|
90
103
|
|
91
|
-
|
104
|
+
```ruby
|
105
|
+
user_client.update(legal_name: 'John Smith', remove_login: { email: 'test@test.com' })
|
106
|
+
```
|
92
107
|
|
93
108
|
#### Add a document
|
94
109
|
|
@@ -197,17 +212,6 @@ user_client.nodes(node_id).transactions.find(id)
|
|
197
212
|
user_client.nodes(node_id).transactions.update(id, data)
|
198
213
|
```
|
199
214
|
|
200
|
-
#### Subscriptions
|
201
|
-
|
202
|
-
Note: This is a feature only available for the Advanced or Premium plans.
|
203
|
-
|
204
|
-
```ruby
|
205
|
-
client.subscriptions.all
|
206
|
-
client.subscriptions.create(url: 'http://site.com/callback', scope: ['USERS|PATCH'])
|
207
|
-
client.subscriptions.find(id)
|
208
|
-
client.subscriptions.update(id, url: 'http://site.com/new_callback', is_active: false)
|
209
|
-
```
|
210
|
-
|
211
215
|
#### Error Handling
|
212
216
|
|
213
217
|
TODO: add detail
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synapse_payments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Julio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|