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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61e9b29467f8cb894564e2f04b42dc56252606b0
4
- data.tar.gz: f2b0802aa8495d0555f269ad54669fd88bde1776
3
+ metadata.gz: 35a9dc822e2c93fb45ffb66ecd3266ac0404bbe5
4
+ data.tar.gz: 974dffa4495ac7263f7cfe8d4f2faa7395d9b5ca
5
5
  SHA512:
6
- metadata.gz: 43d5c583c731fa2d8b40426534db3845fb445815df14889bd36f59c3d4c203ae558e0f307089126174c631825ba2d213177d3b180b4e3cad546e46bd6764d2a1
7
- data.tar.gz: db9268f144aa2733cb551eacbdf7d9e88b8850d1d1e854642c27159ed149c1fc01c8c44780bdfc96a58c1a8af8b687ccd6a91f1c6f607dd0d872178f90e03dcc
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]
@@ -1,3 +1,3 @@
1
1
  module SynapsePayments
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
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
- NOTE: Action needs to be implemented.
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.2
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-19 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler