synapse_pay_rest 0.0.13 → 0.0.14

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: 4dbdc072bf2803c60e736b7dd86c3ee77a116051
4
- data.tar.gz: 54a9502bfcabffb266b2cb9b7a0b98f95ecd3fbe
3
+ metadata.gz: 9eb067fcbf87836159c1afdfeb9fdf13a0b64c6a
4
+ data.tar.gz: 8e41c3f89e3de30798a252645ec77310d4cc39e3
5
5
  SHA512:
6
- metadata.gz: 4fd8d2bf9dadecaed2e2e54e97cffb8bc0a5f318638916b270987bc5ca752133a837de4d9f9c68e02bc182411973f4b6bd1f83dc0c5e23dbbea127010a0c8231
7
- data.tar.gz: 57b16b876a60d60109a812c487609fefdd0c91ece4d86c456049f7762ad8ae9b400bc0ee43f6973b6f795f7930a652ca03f3c2fbfc144dba6721acf0e07423f8
6
+ metadata.gz: 1b981fbc586dec4a9cfe4f08e973f8a333d7993a7aa5520124e330020cf0be64e8f421d9caa0b0b3f8e6e38288729edcc7209ebbca94eb8a171cf8c8e046d20a
7
+ data.tar.gz: 249ed0c41fad41c2ec69703df4eb17d5370981bd0fa8fb51f713436ffe958543cb2a54cff29383476e71e32711b8a7d05d8aac3897e5306486d3d592a8c8303d
data/.gitignore CHANGED
@@ -36,4 +36,5 @@ build/
36
36
  .rvmrc
37
37
 
38
38
 
39
- .DS_Store
39
+ .DS_Store
40
+ .env
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synapse_pay_rest (0.0.10)
4
+ synapse_pay_rest (0.0.13)
5
5
  rest-client
6
6
 
7
7
  GEM
@@ -9,11 +9,14 @@ GEM
9
9
  specs:
10
10
  ansi (1.5.0)
11
11
  builder (3.2.2)
12
- domain_name (0.5.25)
12
+ domain_name (0.5.20160826)
13
13
  unf (>= 0.0.5, < 1.0.0)
14
+ dotenv (2.1.1)
14
15
  http-cookie (1.0.2)
15
16
  domain_name (~> 0.5)
16
- mime-types (2.6.2)
17
+ mime-types (3.1)
18
+ mime-types-data (~> 3.2015)
19
+ mime-types-data (3.2016.0521)
17
20
  minitest (5.8.2)
18
21
  minitest-reporters (1.1.5)
19
22
  ansi
@@ -22,24 +25,25 @@ GEM
22
25
  ruby-progressbar
23
26
  netrc (0.11.0)
24
27
  rake (10.4.2)
25
- rest-client (1.8.0)
28
+ rest-client (2.0.0)
26
29
  http-cookie (>= 1.0.2, < 2.0)
27
- mime-types (>= 1.16, < 3.0)
28
- netrc (~> 0.7)
30
+ mime-types (>= 1.16, < 4.0)
31
+ netrc (~> 0.8)
29
32
  ruby-progressbar (1.7.5)
30
33
  unf (0.1.4)
31
34
  unf_ext
32
- unf_ext (0.0.7.1)
35
+ unf_ext (0.0.7.2)
33
36
 
34
37
  PLATFORMS
35
38
  ruby
36
39
 
37
40
  DEPENDENCIES
38
41
  bundler (~> 1.10)
42
+ dotenv
39
43
  minitest
40
44
  minitest-reporters
41
45
  rake (~> 10.0)
42
46
  synapse_pay_rest!
43
47
 
44
48
  BUNDLED WITH
45
- 1.10.6
49
+ 1.13.0
data/README.md CHANGED
@@ -1,11 +1,10 @@
1
1
  ## SynapsePayRest-Ruby
2
2
 
3
- Simple API wrapper for SynapsePay REST V3 API. This wrapper aims to handle the headers for each API request and appropriate error handling.
4
-
3
+ Simple API wrapper for SynapsePay REST V3 API. This wrapper aims to handle the headers for each API request and appropriate error handling. Not all API endpoints are supported.
5
4
 
6
5
  ## Code Example
7
6
 
8
- Check out the samples.md and our API documentation(http://docs.synapsepay.com/v3.1) for examples.
7
+ Check out [samples.md](https://github.com/synapsepay/SynapsePayRest-Ruby/blob/master/samples.md) and our [API documentation](http://docs.synapsepay.com/v3.1) for examples.
9
8
 
10
9
  ## Installation
11
10
 
@@ -1,6 +1,5 @@
1
1
  module SynapsePayRest
2
2
  class Nodes
3
-
4
3
  attr_accessor :client
5
4
 
6
5
  def initialize(client)
@@ -10,7 +9,7 @@ module SynapsePayRest
10
9
  def create_node_path(node_id: nil)
11
10
  path = ['/users', client.user_id, 'nodes' ]
12
11
  path << node_id if node_id
13
- return path.join('/')
12
+ path.join('/')
14
13
  end
15
14
 
16
15
  def add(payload: raise("payload is required"))
@@ -25,6 +24,7 @@ module SynapsePayRest
25
24
  client.get(path)
26
25
  end
27
26
 
27
+ # separate this into different methods
28
28
  def verify(node_id: nil, payload: raise("payload is required"))
29
29
  if node_id
30
30
  # verify microdeposits
@@ -35,7 +35,6 @@ module SynapsePayRest
35
35
  path = create_node_path
36
36
  response = @client.post(path, payload)
37
37
  end
38
- response
39
38
  end
40
39
 
41
40
  def delete(node_id: raise("node_id is required"))
@@ -1,6 +1,6 @@
1
1
  module SynapsePayRest
2
+ # rename this
2
3
  class Trans
3
-
4
4
  attr_accessor :client
5
5
 
6
6
  def initialize(client)
@@ -3,6 +3,7 @@ require 'base64'
3
3
  require 'open-uri'
4
4
 
5
5
  module SynapsePayRest
6
+ # should maybe create User class
6
7
  class Users
7
8
  # Should refactor this to HTTPClient
8
9
  VALID_QUERY_PARAMS = [:query, :page, :per_page].freeze
@@ -13,29 +14,25 @@ module SynapsePayRest
13
14
  @client = client
14
15
  end
15
16
 
16
- def create_user_path(user_id: nil)
17
- path = ['/users']
18
- path << user_id if user_id
19
- return path.join('/')
20
- end
21
-
17
+ # refactor to automate oauth
22
18
  def refresh(payload: raise("payload is required"))
23
19
  path = "/oauth/#{@client.user_id}"
24
20
  response = @client.post(path, payload)
25
21
  client.update_headers(oauth_key: response['oauth_key']) if response['oauth_key']
26
- return response
22
+ response
27
23
  end
28
24
 
29
- def get(user_id: nil, options: {})
25
+ def get(user_id: nil, **options)
30
26
  path = create_user_path(user_id: user_id)
31
27
 
32
- if options[:user_id]
28
+ # factor single user and all users into separate methods
29
+ if user_id
33
30
  response = client.get(path)
34
31
  client.update_headers(user_id: response['_id']) if response['_id']
35
32
  return response
36
33
  end
37
34
 
38
- # Should factor this out into HTTPClient
35
+ # Should factor this out into HTTPClient and separate args for paginate/search(name/email)/per_page
39
36
  params = VALID_QUERY_PARAMS.map do |p|
40
37
  options[p] ? "#{p}=#{options[p]}" : nil
41
38
  end.compact
@@ -49,29 +46,53 @@ module SynapsePayRest
49
46
 
50
47
  def update(payload: raise("payload is required"))
51
48
  path = create_user_path(user_id: client.user_id)
52
- client.patch(path, payload)
49
+ response = client.patch(path, payload)
50
+ client.update_headers(user_id: response['_id']) if response['_id']
51
+ response
53
52
  end
54
53
 
55
54
  def create(payload: raise("payload is required"))
56
55
  path = create_user_path
57
56
  response = client.post(path, payload)
58
57
  client.update_headers(user_id: response['_id']) if response['_id']
59
- return response
58
+ response
60
59
  end
61
60
 
62
- def add_doc(payload: raise("payload is required"))
63
- path = create_user_path(user_id: client.user_id)
64
- client.patch(path, payload)
61
+ def encode_attachment(file_path: raise("file_path is required"), file_type: nil)
62
+ # try to find file_type
63
+ if file_type.nil?
64
+ content_types = MIME::Types.type_for(file_path)
65
+ file_type = content_types.first.content_type if content_types.any?
66
+ end
67
+
68
+ # if file_type not found in previous step
69
+ if file_type.nil?
70
+ raise("File type not found. Specify a file_type argument.")
71
+ end
72
+
73
+ file_contents = open(file_path) { |f| f.read }
74
+ encoded = Base64.encode64(file_contents)
75
+ mime_padding = "data:#{file_type};base64,"
76
+ mime_padding + encoded
65
77
  end
66
78
 
79
+ # this is just an alias for update. leaving here for legacy users.
67
80
  def answer_kba(payload: raise("payload is required"))
68
- path = create_user_path(user_id: client.user_id)
69
- client.patch(path, payload)
81
+ update(payload: payload)
82
+ end
83
+
84
+ # this is just an alias for update. leaving here for legacy users.
85
+ def add_doc(payload: raise("payload is required"))
86
+ update(payload: payload)
70
87
  end
71
88
 
89
+ # deprecated
72
90
  def attach_file(file_path: raise("file_path is required"))
91
+ warn caller.first + " DEPRECATION WARNING: the method #{self.class}##{__method__} is deprecated. Use SynapsePayRest::Users::update with encode_attachment instead."
92
+
73
93
  file_contents = open(file_path) { |f| f.read }
74
- file_type = MIME::Types.type_for(file_path).first.try(:content_type)
94
+ content_types = MIME::Types.type_for(file_path)
95
+ file_type = content_types.first.content_type if content_types.any?
75
96
  if file_type.nil?
76
97
  raise("File type not found. Use attach_file_with_file_type(file_path: <file_path>, file_type: <file_type>)")
77
98
  else
@@ -79,7 +100,10 @@ module SynapsePayRest
79
100
  end
80
101
  end
81
102
 
103
+ # deprecated
82
104
  def attach_file_with_file_type(file_path: raise("file_path is required"), file_type: raise("file_type is required"))
105
+ warn caller.first + " DEPRECATION WARNING: the method #{self.class}##{__method__} is deprecated. Use SynapsePayRest::Users::update with encode_attachment instead."
106
+
83
107
  path = create_user_path(user_id: @client.user_id)
84
108
  file_contents = open(file_path) { |f| f.read }
85
109
  encoded = Base64.encode64(file_contents)
@@ -93,5 +117,13 @@ module SynapsePayRest
93
117
  }
94
118
  client.patch(path, payload)
95
119
  end
120
+
121
+ private
122
+
123
+ def create_user_path(user_id: nil)
124
+ path = ['/users']
125
+ path << user_id if user_id
126
+ path.join('/')
127
+ end
96
128
  end
97
129
  end
@@ -3,7 +3,6 @@ require 'json'
3
3
 
4
4
  module SynapsePayRest
5
5
  class HTTPClient
6
-
7
6
  attr_accessor :base_url, :config, :headers, :user_id
8
7
 
9
8
  def initialize(config, base_url, user_id: nil)
@@ -14,6 +13,7 @@ module SynapsePayRest
14
13
  end
15
14
 
16
15
  def get_headers
16
+ # refactor to use symbols
17
17
  user = "#{config['oauth_key']}|#{config['fingerprint']}"
18
18
  gateway = "#{config['client_id']}|#{config['client_secret']}"
19
19
  headers = {
@@ -26,7 +26,9 @@ module SynapsePayRest
26
26
  end
27
27
 
28
28
  def update_headers(user_id: nil, oauth_key: nil, fingerprint: nil, client_id: nil, client_secret: nil, ip_address: nil)
29
- self.user_id = user_id if user_id
29
+ # this doesn't really belongs in headers
30
+ self.user_id = user_id if user_id
31
+
30
32
  config['fingerprint'] = fingerprint if fingerprint
31
33
  config['oauth_key'] = oauth_key if oauth_key
32
34
  config['client_id'] = client_id if client_id
@@ -34,7 +36,6 @@ module SynapsePayRest
34
36
  config['ip_address'] = ip_address if ip_address
35
37
  end
36
38
 
37
-
38
39
  def post(path, payload)
39
40
  response = with_error_handling { RestClient.post(full_url(path), payload.to_json, get_headers) }
40
41
  JSON.parse(response)
@@ -1,3 +1,3 @@
1
1
  module SynapsePayRest
2
- VERSION = '0.0.13'
2
+ VERSION = '0.0.14'
3
3
  end
data/samples.md CHANGED
@@ -1,19 +1,18 @@
1
-
2
1
  ## Initialization
3
2
 
4
3
  ```ruby
5
4
  require 'synapse_pay_rest'
6
5
 
7
6
  options = {
8
- 'oauth_key' => USER_OAUTH KEY, # Optional
9
- 'fingerprint' => USER_FINGERPRINT,
10
- 'client_id' => YOUR_CLIENT_ID,
11
- 'client_secret' => YOUR_CLIENT_SECRET,
12
- 'ip_address' => USER_IP_ADDRESS,
13
- 'development_mode' => true #true will ping sandbox.synapsepay.com while false will ping synapsepay.com
7
+ 'oauth_key' => OAUTH_KEY, # Optional
8
+ 'fingerprint' => FINGERPRINT,
9
+ 'client_id' => CLIENT_ID,
10
+ 'client_secret' => CLIENT_SECRET,
11
+ 'ip_address' => IP_ADDRESS,
12
+ 'development_mode' => true # true will ping sandbox.synapsepay.com while false will ping synapsepay.com
14
13
  }
15
14
 
16
- USER_ID = ID_OF_USER # Optional
15
+ USER_ID = USER_ID # Optional (it the client will automatically update it after a GET or UPDATE call)
17
16
 
18
17
  client = SynapsePayRest::Client.new options: options, user_id: USER_ID
19
18
 
@@ -32,104 +31,134 @@ users_response = client.users.get
32
31
  # Create User
33
32
 
34
33
  create_payload = {
35
- "logins" => [
36
- {
37
- "email" => "rubyTest@synapsepay.com",
38
- "password" => "test1234",
39
- "read_only" => false
40
- }
41
- ],
42
- "phone_numbers" => [
43
- "901.111.1111"
44
- ],
45
- "legal_names" => [
46
- "RUBY TEST USER"
47
- ],
48
- "extra" => {
49
- "note" => "Interesting user",
50
- "supp_id" => "122eddfgbeafrfvbbb",
51
- "is_business" => false
52
- }
34
+ "logins" => [
35
+ {
36
+ "email" => "rubyTest@synapsepay.com",
37
+ "password" => "test1234",
38
+ "read_only" => false
39
+ }
40
+ ],
41
+ "phone_numbers" => [
42
+ "901.111.1111"
43
+ ],
44
+ "legal_names" => [
45
+ "RUBY TEST USER"
46
+ ],
47
+ "extra" => {
48
+ "note" => "Interesting user",
49
+ "supp_id" => "122eddfgbeafrfvbbb",
50
+ "is_business" => false
51
+ }
53
52
  }
54
53
 
55
- create_response = client.users.create(payload: create_payload)
54
+ create_user_response = client.users.create(payload: create_payload)
56
55
 
57
56
 
58
57
  # Get User
59
58
 
60
- user_response = client.users.get(user_id: USER_ID)
59
+ user_response = client.users.get(user_id: create_user_response['_id'])
61
60
 
62
61
 
63
- # Update a User
64
62
 
65
- update_payload = {
66
- "refresh_token" => "REFRESH_TOKEN",
67
- "update":{
68
- "login" => {
69
- "email" => "test2ruby@email.com",
70
- "password" => "test1234",
71
- "read_only" => true
72
- },
73
- "phone_number" => "9019411111",
74
- "legal_name" => "Some new name"
75
- }
63
+ # Refresh User
64
+
65
+ oauth_payload = {
66
+ "refresh_token" => user_response['refresh_token']
76
67
  }
77
68
 
78
- client.users.update(payload: update_payload)
69
+ oauth_response = client.users.refresh(payload: oauth_payload)
79
70
 
80
71
 
81
- # Add Document
82
-
83
- ssn_payload = {
84
- "doc" => {
85
- "birth_day" => 4,
86
- "birth_month" => 2,
87
- "birth_year" => 1940,
88
- "name_first" => "John",
89
- "name_last" => "doe",
90
- "address_street1" => "1 Infinite Loop",
91
- "address_postal_code" => "95014",
92
- "address_country_code" => "US",
93
- "document_value" => "3333",
94
- "document_type" => "SSN"
95
- }
96
- }
72
+ # Update a User
97
73
 
98
- ssn_response = client.users.add_doc(payload: ssn_payload)
74
+ update_payload = {
75
+ "refresh_token" => user_response['refresh_token'],
76
+ "update" => {
77
+ "login" => {
78
+ "email" => "test2ruby@email.com",
79
+ "password" => "test1234",
80
+ "read_only" => true
81
+ },
82
+ "phone_number" => "9019411111",
83
+ "legal_name" => "Some new name"
84
+ }
85
+ }
99
86
 
87
+ client.users.update(payload: update_payload)
100
88
 
101
- # Answer KBA Questions
102
89
 
103
- kba_payload = {
104
- "doc" => {
105
- "question_set_id" => "557520ad343463000300005a",
106
- "answers" => [
107
- { "question_id" => 1, "answer_id" => 1 },
108
- { "question_id" => 2, "answer_id" => 1 },
109
- { "question_id" => 3, "answer_id" => 1 },
110
- { "question_id" => 4, "answer_id" => 1 },
111
- { "question_id" => 5, "answer_id" => 1 }
112
- ]
113
- }
90
+ # Add Documents
91
+
92
+ # use users#encode_attachment to base64 encode a file for inclusion in the payload
93
+ govt_id_attachment = client.users.encode_attachment(file_path: FILE_PATH)
94
+ selfie_attachment = client.users.encode_attachment(file_path: FILE_PATH)
95
+
96
+ add_documents_payload = {
97
+ 'documents' => [{
98
+ 'email' => 'test2@test.com',
99
+ 'phone_number' => '901-942-8167',
100
+ 'ip' => '12134323',
101
+ 'name' => 'Snoopie',
102
+ 'alias' => 'Meow',
103
+ 'entity_type' => 'M',
104
+ 'entity_scope' => 'Arts & Entertainment',
105
+ 'day' => 2,
106
+ 'month' => 5,
107
+ 'year' => 2009,
108
+ 'address_street' => 'Some Farm',
109
+ 'address_city' => 'SF',
110
+ 'address_subdivision' => 'CA',
111
+ 'address_postal_code' => '94114',
112
+ 'address_country_code' => 'US',
113
+ 'virtual_docs' => [{
114
+ 'document_value' => '111-111-3333',
115
+ 'document_type' => 'SSN'
116
+ }],
117
+ 'physical_docs' => [{
118
+ 'document_value' => govt_id_attachment,
119
+ 'document_type' => 'GOVT_ID'
120
+ },
121
+ {
122
+ 'document_value' => selfie_attachment,
123
+ 'document_type' => 'SELFIE'
124
+ }],
125
+ 'social_docs' => [{
126
+ 'document_value' => 'https://www.facebook.com/sankaet',
127
+ 'document_type' => 'FACEBOOK'
128
+ }]
129
+ }]
114
130
  }
115
131
 
116
- kba_response = client.users.answer_kba(payload: kba_payload)
132
+ add_docs_response = client.users.update(payload: add_documents_payload)
117
133
 
118
134
 
119
- # Attach a file
120
-
121
- file_response = client.users.attach_file(file_path: 'PATH_TO_FILE')
135
+ # Answer KBA Questions
122
136
 
137
+ kyc_document = add_docs_response['documents'].last # to get most recent (or only) submitted set of KYC docs
123
138
 
124
- # Refresh User
139
+ ssn = kyc_document['virtual_docs'].find { |doc| doc['status'] == 'SUBMITTED|MFA_PENDING'}
125
140
 
126
- oauth_payload = {
127
- "refresh_token" => USER_REFRESH_TOKEN
141
+ kba_payload = {
142
+ 'documents' => [{
143
+ 'id' => kyc_document['id'],
144
+ 'virtual_docs' => [{
145
+ 'id' => ssn['id'],
146
+ 'meta' => {
147
+ 'question_set' => {
148
+ 'answers' => [
149
+ { 'question_id' => 1, 'answer_id' => 1 },
150
+ { 'question_id' => 2, 'answer_id' => 1 },
151
+ { 'question_id' => 3, 'answer_id' => 1 },
152
+ { 'question_id' => 4, 'answer_id' => 1 },
153
+ { 'question_id' => 5, 'answer_id' => 1 }
154
+ ]
155
+ }
156
+ }
157
+ }]
158
+ }]
128
159
  }
129
160
 
130
- oauth_response = client.users.refresh(payload: oauth_payload)
131
-
132
- ```
161
+ kba_response = client.users.update(payload: kba_payload)
133
162
 
134
163
 
135
164
  ## Node API Calls
@@ -145,13 +174,13 @@ nodes_response = client.nodes.get
145
174
  # Add SYNAPSE-US Node
146
175
 
147
176
  synapse_node_payload = {
148
- "type" => "SYNAPSE-US",
149
- "info" => {
150
- "nickname" => "My Synapse Wallet"
151
- },
152
- "extra" => {
153
- "supp_id" => "123sa"
154
- }
177
+ "type" => "SYNAPSE-US",
178
+ "info" => {
179
+ "nickname" => "My Synapse Wallet"
180
+ },
181
+ "extra" => {
182
+ "supp_id" => "123sa"
183
+ }
155
184
  }
156
185
 
157
186
  synapse_node_response = client.nodes.add(payload: synapse_node_payload)
@@ -160,12 +189,12 @@ synapse_node_response = client.nodes.add(payload: synapse_node_payload)
160
189
  # Add ACH-US node through account login
161
190
 
162
191
  login_payload = {
163
- "type" => "ACH-US",
164
- "info" => {
165
- "bank_id" => "synapse_good",
166
- "bank_pw" => "test1234",
167
- "bank_name" => "fake"
168
- }
192
+ "type" => "ACH-US",
193
+ "info" => {
194
+ "bank_id" => "synapse_good",
195
+ "bank_pw" => "test1234",
196
+ "bank_name" => "fake"
197
+ }
169
198
  }
170
199
 
171
200
  login_response = client.nodes.add(payload: login_payload)
@@ -174,8 +203,8 @@ login_response = client.nodes.add(payload: login_payload)
174
203
  # Verify ACH-US Node via MFA
175
204
 
176
205
  mfa_payload = {
177
- "access_token" => ACCESS_TOKEN_IN_LOGIN_RESPONSE,
178
- "mfa_answer" => "test_answer"
206
+ "access_token" => ACCESS_TOKEN_IN_LOGIN_RESPONSE,
207
+ "mfa_answer" => "test_answer"
179
208
  }
180
209
 
181
210
  mfa_response = client.nodes.verify(payload: mfa_payload)
@@ -184,18 +213,18 @@ mfa_response = client.nodes.verify(payload: mfa_payload)
184
213
  # Add ACH-US Node through Account and Routing Number Details
185
214
 
186
215
  acct_rout_payload = {
187
- "type" => "ACH-US",
188
- "info" => {
189
- "nickname" => "Ruby Library Savings Account",
190
- "name_on_account" => "Ruby Library",
191
- "account_num" => "72347235423",
192
- "routing_num" => "051000017",
193
- "type" => "PERSONAL",
194
- "class" => "CHECKING"
195
- },
196
- "extra" => {
197
- "supp_id" => "123sa"
198
- }
216
+ "type" => "ACH-US",
217
+ "info" => {
218
+ "nickname" => "Ruby Library Savings Account",
219
+ "name_on_account" => "Ruby Library",
220
+ "account_num" => "72347235423",
221
+ "routing_num" => "051000017",
222
+ "type" => "PERSONAL",
223
+ "class" => "CHECKING"
224
+ },
225
+ "extra" => {
226
+ "supp_id" => "123sa"
227
+ }
199
228
  }
200
229
 
201
230
  acct_rout_response = client.nodes.add(payload: acct_rout_payload)
@@ -204,7 +233,7 @@ acct_rout_response = client.nodes.add(payload: acct_rout_payload)
204
233
  # Verify ACH-US Node via Micro-Deposits
205
234
 
206
235
  micro_payload = {
207
- "micro" => [0.1,0.1]
236
+ "micro" => [0.1,0.1]
208
237
  }
209
238
 
210
239
  micro_response = client.nodes.verify(node_id: NODE_ID, payload: micro_payload)
@@ -228,28 +257,28 @@ transactions_response = client.trans.get(node_id: NODE_ID)
228
257
  #Create a Transaction
229
258
 
230
259
  trans_payload = {
231
- "to" => {
232
- "type" => "SYNAPSE-US",
233
- "id" => "560adb4e86c27331bb5ac86e"
234
- },
235
- "amount" => {
236
- "amount" => 1.10,
237
- "currency" => "USD"
238
- },
239
- "extra" => {
240
- "supp_id" => "1283764wqwsdd34wd13212",
241
- "note" => "Deposit to bank account",
242
- "webhook" => "http => //requestb.in/q94kxtq9",
243
- "process_on" => 1,
244
- "ip" => "192.168.0.1"
245
- },
246
- "fees" => [{
247
- "fee" => 1.00,
248
- "note" => "Facilitator Fee",
249
- "to" => {
250
- "id" => "55d9287486c27365fe3776fb"
251
- }
252
- }]
260
+ "to" => {
261
+ "type" => "SYNAPSE-US",
262
+ "id" => "560adb4e86c27331bb5ac86e"
263
+ },
264
+ "amount" => {
265
+ "amount" => 1.10,
266
+ "currency" => "USD"
267
+ },
268
+ "extra" => {
269
+ "supp_id" => "1283764wqwsdd34wd13212",
270
+ "note" => "Deposit to bank account",
271
+ "webhook" => "http => //requestb.in/q94kxtq9",
272
+ "process_on" => 1,
273
+ "ip" => "192.168.0.1"
274
+ },
275
+ "fees" => [{
276
+ "fee" => 1.00,
277
+ "note" => "Facilitator Fee",
278
+ "to" => {
279
+ "id" => "55d9287486c27365fe3776fb"
280
+ }
281
+ }]
253
282
  }
254
283
 
255
284
  create_response = client.trans.create(node_id: NODE_ID, payload: trans_payload)
@@ -263,7 +292,7 @@ transaction_response = client.trans.get(node_id: NODE_ID, trans_id: TRANS_ID)
263
292
  # Update Transaction
264
293
 
265
294
  update_payload = {
266
- "comment" => "hi"
295
+ "comment" => "hi"
267
296
  }
268
297
 
269
298
  update_response = client.trans.update(node_id: NODE_ID, trans_id: TRANS_ID, payload: update_payload)
@@ -273,4 +302,4 @@ update_response = client.trans.update(node_id: NODE_ID, trans_id: TRANS_ID, payl
273
302
 
274
303
  delete_trans_response = client.trans.delete(node_id: NODE_ID, trans_id: TRANS_ID)
275
304
 
276
- ```
305
+ ```
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "rake", "~> 10.0"
23
23
  s.add_development_dependency "minitest"
24
24
  s.add_development_dependency "minitest-reporters"
25
+ s.add_development_dependency "dotenv"
25
26
 
26
27
  s.add_dependency "rest-client"
27
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synapse_pay_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Hipps
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-09-16 00:00:00.000000000 Z
12
+ date: 2016-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -67,6 +67,20 @@ dependencies:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: dotenv
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
70
84
  - !ruby/object:Gem::Dependency
71
85
  name: rest-client
72
86
  requirement: !ruby/object:Gem::Requirement