synapse_fi 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/samples.md ADDED
@@ -0,0 +1,455 @@
1
+ # Client
2
+
3
+ ## Initializing Client
4
+
5
+ - Set up a .env file to fetch your client_id and client_secret
6
+ - Returns Client instance
7
+ - Set raise_for_202 as true if you want 2FA and MFA to be raised
8
+
9
+ ```bash
10
+ args = {
11
+ client_id: ENV.fetch("client_id"),
12
+ client_secret: ENV.fetch("client_secret"),
13
+ fingerprint: "fp",
14
+ ip_address: 'ip',
15
+ development_mode: true,
16
+ raise_for_202: true
17
+ }
18
+
19
+ client = Synapse::Client.new(args)
20
+ ```
21
+
22
+ ## Creating USER
23
+
24
+ - Returns user instance
25
+
26
+ ```bash
27
+ payload = {
28
+ "logins": [
29
+ {
30
+ "email": "test@synapsefi.com"
31
+ }
32
+ ],
33
+ "phone_numbers": [
34
+ "901.111.1111",
35
+ "test@synapsefi.com"
36
+ ],
37
+ "legal_names": [
38
+ "Test User"
39
+ ],
40
+ "extra": {
41
+ "supp_id": "122eddfgbeafrfvbbb",
42
+ "cip_tag":1,
43
+ "is_business": false
44
+ }
45
+ }
46
+
47
+ user = client.create_user(payload: payload)
48
+ ```
49
+
50
+ ## Update Headers
51
+
52
+ - Updates current headers for future request
53
+
54
+ ```bash
55
+ headers = client.update_headers(fingerprint:nil, idemopotency_key:nil, ip_address:nil)
56
+ ```
57
+
58
+ ## Get USER
59
+ - returns USER instance
60
+
61
+ ```bash
62
+ user_id = "1232"
63
+ user = client.get_user(user_id: user_id,full_dehydrate: true)
64
+ ```
65
+
66
+ ## Get all USERS
67
+ - returns USERS instance
68
+ - Array of users on a platform
69
+
70
+ ```bash
71
+ users = client.get_users(** options)
72
+ ```
73
+
74
+ ## Gets all transactions on a platform
75
+
76
+ - returns Transactions instance
77
+ - array of Transaction instance
78
+
79
+ ```bash
80
+ trans = client.get_transaction(page: nil, per_page: nil, query: nil)
81
+ ```
82
+
83
+ ## Get all platform nodes
84
+ - Returns Nodes instance
85
+ - Array of Node instance
86
+ - Page (optional params)
87
+ - Per Page (optional params)
88
+
89
+ ```bash
90
+ Nodes = client.get_all_nodes(** options)
91
+ ```
92
+
93
+ ## Get Institutions
94
+
95
+ - Returns institutions available for bank logins
96
+ - Page (optional params)
97
+ - Per Page (optional params)
98
+
99
+ ```bash
100
+ institutions = client.get_all_institutions(** options)
101
+ ```
102
+
103
+ ## Create subscription
104
+ - Scope must be an array or else method will raise an error
105
+ - Returns subscription instace
106
+
107
+ ```bash
108
+ scope = ["TRAN|PATCH"]
109
+ url = "webhooks.com"
110
+ subscription = client.create_subscriptions(scope: scope, url: url )
111
+ ```
112
+
113
+ ## Get all platforms subscription
114
+ - Developer has option to
115
+ - Page (optional params)
116
+ - Per Page (optional params)
117
+
118
+ ```bash
119
+ subscriptions = client.get_all_subscriptions(** options)
120
+ ```
121
+
122
+ ## Get a subscription by id
123
+ - returns a subscription instance
124
+
125
+ ```bash
126
+ subscription_id = "2342324"
127
+ subscription = client.get_subscription(subscriptions_id:)
128
+ ```
129
+
130
+ ## Update Subscription
131
+
132
+ - Updates a subscription scope or url
133
+ - Returns a subscription instance
134
+
135
+ ```bash
136
+ subscription_id = "2342324"
137
+ scope = ["TRAN|PATCH"]
138
+ subscription = client.update_subscriptions(subscription_id: subscription_id , scope: scope)
139
+ ```
140
+
141
+ ## Issue Public Key
142
+
143
+ - Returns api response
144
+
145
+ ```bash
146
+ scope = ["USERS|GET"]
147
+ public_key = client.issue_public_key(scope: scope)
148
+ ```
149
+ ## Locate ATM
150
+ - Returns all atms nearby
151
+ - Param zip
152
+ - Param radius
153
+ - Param lat
154
+ - Param lon
155
+
156
+ ```bash
157
+ atms = client.locate_atm(** options)
158
+ ```
159
+
160
+ ## Get Crypto Quotes
161
+
162
+ - Returns Crypto Currencies Quotes
163
+
164
+ ```bash
165
+ crypto_quotes = client.get_crypto_quotes()
166
+ ```
167
+
168
+ ## Get Market Data
169
+
170
+ - Returns Crypto market data
171
+ - Param limit
172
+ - Param currency
173
+
174
+
175
+ ```bash
176
+ crypto_data = client.get_crypto_market_data(** options)
177
+ ```
178
+
179
+ # User
180
+
181
+ ## Update User Documents
182
+
183
+ - Updates user documents
184
+
185
+ ```bash
186
+ body = {
187
+ "update":{
188
+ "login":{
189
+ "email":"test2@synapsefi.com"
190
+ },
191
+ "remove_login":{
192
+ "email":"test@synapsefi.com"
193
+ },
194
+ "phone_number":"901-111-2222",
195
+ "remove_phone_number":"901.111.1111"
196
+ }
197
+ }
198
+
199
+
200
+ user = user.user_update(payload:)
201
+ ```
202
+
203
+ ## Get User Node
204
+
205
+ - Gets User node
206
+ - Param full_dehydrate or force_refresh
207
+
208
+ ```bash
209
+ node_id = "5bd9e7b3389f2400adb012ae"
210
+
211
+ node = user.get_user_node(node_id: node_id, full_dehydrate: true, force_refresh: true)
212
+ ```
213
+
214
+ ## Get All User Nodes
215
+
216
+ - Options[page, per_page, type]
217
+ ```bash
218
+ Nodes = user.get_all_nodes(**options)
219
+ ```
220
+
221
+ ## Authenticate a USER
222
+
223
+ - Authenticates users
224
+ - Params Scope [Array]
225
+ - Param Idempotency_key [String] (optional)
226
+
227
+ ```bash
228
+ response = user.authenticate(** options)
229
+ ```
230
+
231
+ ## Select 2FA device
232
+
233
+ - Register new fingerprint
234
+ - Param device
235
+ - Param Idempotency_key [String] (optional)
236
+
237
+ ```bash
238
+ response = user.select_2fa_device(device:)
239
+ ```
240
+
241
+ ## Confirm 2FA pin
242
+
243
+ - Supply pin
244
+ - Param pin
245
+ - Param Idempotency_key [String] (optional)
246
+
247
+ ```bash
248
+ response = user.confirm_2fa_pin(pin:)
249
+ ```
250
+
251
+ ## Get user transactions
252
+
253
+ - Returns transactons instance
254
+ - Options[page, per_page, type]
255
+
256
+ ```bash
257
+ transactions = user.get_user_transactions(** options)
258
+ ```
259
+
260
+ ## Create Node
261
+
262
+ - Creates Node
263
+ - Param node payload
264
+ - Param Idempotency_key [String] (optional)
265
+ - Returns node or access token depending on node
266
+
267
+ ```bash
268
+ node = user.create_node(payload:, options)
269
+ ```
270
+
271
+ ## ACH MFA
272
+
273
+ - Submit MFA question and access token
274
+ - Param MFA payload
275
+ - Param Idempotency_key [String] (optional)
276
+ - Returns node or access token depending on node
277
+
278
+ ```bash
279
+ node = user.ach_mfa(payload:, options)
280
+ ```
281
+
282
+ ## Create UBO
283
+
284
+ - Upload an Ultimate Beneficial Ownership or REG GG Form
285
+
286
+ ```bash
287
+ response = user.create_ubo(payload:)
288
+ ```
289
+
290
+ ## Get User Statement
291
+
292
+ - Gets user statements
293
+ - Options[page, per_page, type]
294
+
295
+ ```bash
296
+ statement = user.get_user_statement()
297
+ ```
298
+
299
+ ## Ship Card
300
+
301
+ - Initate card shipment
302
+ - Param node_id
303
+ - Param payload
304
+
305
+ ```bash
306
+ node = user.ship_card()
307
+ ```
308
+
309
+ ## Reset Debit Cards
310
+
311
+ - Get new card number and cvv
312
+ - Param node_id
313
+
314
+ ```bash
315
+ node = user.reset_debit_card(node_id:)
316
+ ```
317
+
318
+ ## Create Transaction
319
+
320
+ - Create a node transaction
321
+ - Param node_id
322
+ - Param payload
323
+ - Param Idempotency_key [String] (optional)
324
+
325
+ ```bash
326
+ transaction = user.create_transaction(node_id:, payload:, ** options)
327
+ ```
328
+
329
+ ## Get Node Transaction
330
+
331
+ - Param node_id
332
+ - Param trans_id
333
+
334
+ ```bash
335
+ transaction = user.get_node_transaction(node_id:, trans_id:)
336
+ ```
337
+
338
+ ## Get all node transaction
339
+
340
+ - Param node_id
341
+ - Options[page, per_page, type]
342
+
343
+ ```bash
344
+ nodes = user.get_all_node_transaction(node_id:, options)
345
+ ```
346
+
347
+ ## Verify Micro Deposit
348
+
349
+ - Param node_id
350
+ - Param payload
351
+
352
+ ```bash
353
+ node = user.verify_micro_deposit(node_id:, payload:)
354
+ ```
355
+
356
+ ## Reinitiate Micro Deposit
357
+
358
+ - Param node_id
359
+
360
+ ```bash
361
+ node = user.reinitiate_micro_deposit(node_id:)
362
+ ```
363
+
364
+ ## Generate Apple pay Token
365
+
366
+ - Param node_id
367
+ - Param payload
368
+
369
+ ```bash
370
+ response = user.generate_apple_pay_token(node_id:, payload:)
371
+ ```
372
+
373
+ ## Update Node
374
+
375
+ - Param node_id
376
+ - Param payload
377
+
378
+ ```bash
379
+ node = user.generate(node_id:, payload:)
380
+ ```
381
+
382
+ ## Delete Node
383
+
384
+ - Param node_id
385
+
386
+ ```bash
387
+ response = user.delete_node(node_id:)
388
+ ```
389
+
390
+ ## Dummy Transactions
391
+
392
+ - initiates a dummy transaction to a node
393
+ - Param node_id [String]
394
+ - Param is_credit [Boolean]
395
+
396
+ ```bash
397
+ response = user.dummy_transactions(node_id:, is_credit:)
398
+ ```
399
+
400
+
401
+ ## Comment on status
402
+
403
+ - Param node_id
404
+ - Param trans_id
405
+ - Param payload
406
+
407
+ ```bash
408
+ transaction = user.comment_transaction(node_id:, trans_id:, payload:)
409
+ ```
410
+
411
+ ## Cancel Transaction
412
+
413
+ - Param node_id
414
+ - Param trans_id
415
+
416
+ ```bash
417
+ response = user.cancel_transaction(node_id:, trans_id:)
418
+ ```
419
+
420
+ ## Dispute Card Transactions
421
+
422
+ - Param node_id
423
+ - Param trans_id
424
+
425
+ ```bash
426
+ response = user.dispute_user_transactions(node_id:, trans_id:)
427
+ ```
428
+
429
+ ## Get All Subnets
430
+
431
+ - Param node_id
432
+ - Options[page, per_page, type]
433
+
434
+ ```bash
435
+ subnets = user.get_all_subnets(node_id:, options)
436
+ ```
437
+
438
+ ## Get Subnet
439
+
440
+ - Param node_id
441
+ - Param subnet_id
442
+
443
+ ```bash
444
+ subnet = user.get_subnet(node_id:, subnet_id:)
445
+ ```
446
+ ## Get Node Statements
447
+
448
+ - Param node_id
449
+ - Options[page, per_page, type]
450
+
451
+ ```bash
452
+ response = get_node_statements(node_id:, ** options)
453
+ ```
454
+
455
+
Binary file
@@ -0,0 +1,89 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'date'
4
+ require 'synapse_api/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'synapse_fi'
8
+ s.version = Synapse::VERSION
9
+ s.date = Date.today.to_s
10
+ s.author = ['Emmanuel Mawutor']
11
+ s.email = 'help@synapsepay.com'
12
+ s.summary = 'SynapseFI v3 Rest Native API Library'
13
+ s.homepage = 'https://rubygems.org/gems/synapse_fi'
14
+ s.license = 'MIT'
15
+
16
+ s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ s.bindir = 'exe'
18
+ s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ s.require_paths = ['lib']
20
+
21
+ s.required_ruby_version = '>= 2.1.0'
22
+
23
+ s.add_dependency 'rest-client', '~> 2.0'
24
+
25
+ s.add_development_dependency 'bundler', '~> 1.10'
26
+ s.add_development_dependency 'minitest', '~> 5.8.2'
27
+ s.add_development_dependency 'minitest-reporters', '~> 1.1.5'
28
+ s.add_development_dependency 'dotenv', '~> 2.1.1'
29
+ end
30
+
31
+
32
+ # https://stackoverflow.com/questions/25190363/what-are-files-executables-test-files-and-require-paths-in-gemspec-fi
33
+ # s.add_development_dependency 'simplecov', '~> 0.12.0' # counts the number of times each line of application code is run during your test suite
34
+ # s.add_development_dependency 'm', '~> 1.5.0' # testing to run test line by line
35
+ # s.add_development_dependency 'rake', '~> 10.0' # dont need, i dont have any rake test files
36
+
37
+
38
+
39
+
40
+
41
+ #gem 'synapse_pay_rest'
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
data/yarn.lock ADDED
@@ -0,0 +1,8 @@
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ dotenv@^6.2.0:
6
+ version "6.2.0"
7
+ resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064"
8
+ integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==
metadata ADDED
@@ -0,0 +1,148 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: synapse_fi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Emmanuel Mawutor
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-12-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 5.8.2
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 5.8.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest-reporters
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 1.1.5
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.1.5
69
+ - !ruby/object:Gem::Dependency
70
+ name: dotenv
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.1.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.1.1
83
+ description:
84
+ email: help@synapsepay.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - ".DS_Store"
90
+ - ".env.sample"
91
+ - ".gitignore"
92
+ - Gemfile
93
+ - Gemfile.lock
94
+ - README.md
95
+ - lib/synapse_api/.DS_Store
96
+ - lib/synapse_api/client.rb
97
+ - lib/synapse_api/error.rb
98
+ - lib/synapse_api/http_request.rb
99
+ - lib/synapse_api/node.rb
100
+ - lib/synapse_api/nodes.rb
101
+ - lib/synapse_api/subnet.rb
102
+ - lib/synapse_api/subnets.rb
103
+ - lib/synapse_api/subscription.rb
104
+ - lib/synapse_api/subscriptions.rb
105
+ - lib/synapse_api/transaction.rb
106
+ - lib/synapse_api/transactions.rb
107
+ - lib/synapse_api/user.rb
108
+ - lib/synapse_api/users.rb
109
+ - lib/synapse_api/version.rb
110
+ - node_modules/.yarn-integrity
111
+ - node_modules/dotenv/CHANGELOG.md
112
+ - node_modules/dotenv/LICENSE
113
+ - node_modules/dotenv/README.md
114
+ - node_modules/dotenv/config.js
115
+ - node_modules/dotenv/lib/cli-options.js
116
+ - node_modules/dotenv/lib/env-options.js
117
+ - node_modules/dotenv/lib/main.js
118
+ - node_modules/dotenv/package.json
119
+ - package.json
120
+ - samples.md
121
+ - synapse_fi-0.0.0.gem
122
+ - synapse_fi.gemspec
123
+ - yarn.lock
124
+ homepage: https://rubygems.org/gems/synapse_fi
125
+ licenses:
126
+ - MIT
127
+ metadata: {}
128
+ post_install_message:
129
+ rdoc_options: []
130
+ require_paths:
131
+ - lib
132
+ required_ruby_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: 2.1.0
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ requirements: []
143
+ rubyforge_project:
144
+ rubygems_version: 2.5.2.3
145
+ signing_key:
146
+ specification_version: 4
147
+ summary: SynapseFI v3 Rest Native API Library
148
+ test_files: []