synapseruby 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/synapse_api/subnet.rb +3 -1
- data/lib/synapse_api/user.rb +51 -6
- data/lib/synapse_api/version.rb +1 -1
- data/pkg/synapseruby-1.0.0.gem +0 -0
- data/pkg/synapseruby-1.0.1.gem +0 -0
- data/samples.md +18 -3
- metadata +3 -5
- data/pkg/synapse_fi-0.0.3.gem +0 -0
- data/pkg/synapse_fi-0.0.4.gem +0 -0
- data/pkg/synapse_fi-1.0.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fced61e8e7be25063e9d004d2a68c4386fde180
|
4
|
+
data.tar.gz: dde3dcaf54d19c58ff3985bcdd64085eaec8307c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c57e9a256a2f3f941c8215647920884b753e4b62a890ca9a6a17a0dd739ade22ae96c6fd9b99c106328656533a4e1c8b881d554f8db68a901911c1dcc83910c
|
7
|
+
data.tar.gz: d0455e20b7e385fb7af609d10c3468c9fd3cd71daddb009c4c944488ba32a511368c23529d6557504bb573c0479cbdda43f92503e23d0245def5dcf51865f983
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ $ gem install synapseruby
|
|
26
26
|
## Documentation
|
27
27
|
|
28
28
|
- [API docs](http://docs.synapsefi.com/v3.1)
|
29
|
-
- [
|
29
|
+
- [synapseruby gem docs](https://rubygems.org/gems/synapseruby)
|
30
30
|
- [Samples demonstrating common operations](samples.md)
|
31
31
|
|
32
32
|
## Contributing
|
data/lib/synapse_api/subnet.rb
CHANGED
data/lib/synapse_api/user.rb
CHANGED
@@ -323,12 +323,15 @@ module Synapse
|
|
323
323
|
statements
|
324
324
|
end
|
325
325
|
|
326
|
-
# Request to ship
|
326
|
+
# Request to ship CARD-US
|
327
|
+
# @note Deprecated
|
327
328
|
# @param node_id [String]
|
328
329
|
# @param payload [Hash]
|
329
330
|
# @return [Synapse::Node] or [Hash]
|
330
|
-
def
|
331
|
+
def ship_card_node(node_id:, payload:)
|
332
|
+
|
331
333
|
path = node(user_id: self.user_id, node_id: node_id) + "?ship=YES"
|
334
|
+
|
332
335
|
begin
|
333
336
|
response = client.patch(path,payload)
|
334
337
|
rescue Synapse::Error::Unauthorized
|
@@ -342,11 +345,31 @@ module Synapse
|
|
342
345
|
type: response["type"])
|
343
346
|
end
|
344
347
|
|
348
|
+
# Request to ship user debit card [Subnet]
|
349
|
+
# @param node_id [String]
|
350
|
+
# @param payload [Hash]
|
351
|
+
# @param subnet_id [String]
|
352
|
+
# @return [Synapse::Node] or [Hash]
|
353
|
+
def ship_card(node_id:, payload:, subnet_id:)
|
354
|
+
|
355
|
+
path = node(user_id: self.user_id, node_id: node_id) + "/subnets/#{subnet_id}/ship"
|
356
|
+
|
357
|
+
begin
|
358
|
+
response = client.patch(path,payload)
|
359
|
+
rescue Synapse::Error::Unauthorized
|
360
|
+
self.authenticate()
|
361
|
+
response = client.patch(path,payload)
|
362
|
+
end
|
363
|
+
Subnet.new(subnet_id: response["subnet_id"], payload: response, node_id: response["node_id"])
|
364
|
+
|
365
|
+
end
|
366
|
+
|
345
367
|
# Resets debit card number, cvv, and expiration date
|
368
|
+
# @note Deprecated
|
346
369
|
# @see https://docs.synapsefi.com/docs/reset-debit-card
|
347
370
|
# @param node_id [String]
|
348
371
|
# @return [Synapse::Node] or [Hash]
|
349
|
-
def
|
372
|
+
def reset_card_node(node_id:)
|
350
373
|
path = node(user_id: self.user_id, node_id: node_id) + "?reset=YES"
|
351
374
|
payload = {}
|
352
375
|
begin
|
@@ -602,7 +625,7 @@ module Synapse
|
|
602
625
|
dispute
|
603
626
|
end
|
604
627
|
|
605
|
-
# Creates subnet for a node
|
628
|
+
# Creates subnet for a node debit card or act/rt number
|
606
629
|
# @param node_id [String]
|
607
630
|
# @param payload [Hash]
|
608
631
|
# @param idempotency_key [String] (optional)
|
@@ -620,6 +643,24 @@ module Synapse
|
|
620
643
|
Subnet.new(subnet_id: subnet['_id'], payload: subnet, node_id: node_id)
|
621
644
|
end
|
622
645
|
|
646
|
+
# Updates subnet debit card and act/rt number
|
647
|
+
# @param node_id [String]
|
648
|
+
# @param payload [Hash]
|
649
|
+
# @param subnet_id [String]
|
650
|
+
# @return [Synapse::Subnet]
|
651
|
+
def update_subnet(node_id:, payload:, subnet_id:, **options)
|
652
|
+
path = subnet_path(user_id: self.user_id, node_id: node_id, subnet_id: subnet_id)
|
653
|
+
|
654
|
+
begin
|
655
|
+
subnet = client.patch(path,payload)
|
656
|
+
rescue Synapse::Error::Unauthorized
|
657
|
+
self.authenticate()
|
658
|
+
subnet = client.patch(path,payload)
|
659
|
+
end
|
660
|
+
Subnet.new(subnet_id: subnet['_id'], payload: subnet, node_id: node_id)
|
661
|
+
end
|
662
|
+
|
663
|
+
|
623
664
|
# Gets all node subnets
|
624
665
|
# @param node_id [String]
|
625
666
|
# @param page [Integer]
|
@@ -757,8 +798,12 @@ module Synapse
|
|
757
798
|
path
|
758
799
|
end
|
759
800
|
|
760
|
-
def subnet_path(user_id:, node_id:)
|
761
|
-
|
801
|
+
def subnet_path(user_id:, node_id:, subnet_id: nil)
|
802
|
+
if subnet_id
|
803
|
+
path = "/users/#{user_id}/nodes/#{node_id}/subnets/#{subnet_id}"
|
804
|
+
else
|
805
|
+
path = "/users/#{user_id}/nodes/#{node_id}/subnets"
|
806
|
+
end
|
762
807
|
path
|
763
808
|
end
|
764
809
|
end
|
data/lib/synapse_api/version.rb
CHANGED
Binary file
|
data/pkg/synapseruby-1.0.1.gem
CHANGED
Binary file
|
data/samples.md
CHANGED
@@ -32,6 +32,7 @@
|
|
32
32
|
+ [Subnets](#subnets)
|
33
33
|
* [Create Subnet](#create-subnet)
|
34
34
|
* [Get Subnet](#get-subnet)
|
35
|
+
* [Update Subnet](#update-subnet)
|
35
36
|
+ [Transactions](#transactions)
|
36
37
|
* [Create Transaction](#create-transaction)
|
37
38
|
* [Get Transaction](#get-transaction)
|
@@ -328,14 +329,14 @@ body = {
|
|
328
329
|
"fee_node_id":"5ba05e7920b3aa006482c5ad",
|
329
330
|
"expedite":True
|
330
331
|
}
|
331
|
-
node = user.
|
332
|
+
node = user.ship_card_node(node_id: node_id, payload: body)
|
332
333
|
```
|
333
334
|
|
334
335
|
#### Reset Debit Cards
|
335
336
|
|
336
337
|
```bash
|
337
338
|
node_id = '5ba05ed620b3aa005882c52a'
|
338
|
-
node = user.
|
339
|
+
node = user.reset_card_node(node_id: node_id)
|
339
340
|
```
|
340
341
|
|
341
342
|
#### Verify Micro Deposit
|
@@ -403,10 +404,24 @@ user.create_subnet(node_id: node_id, payload: body)
|
|
403
404
|
#### Get Subnet
|
404
405
|
```bash
|
405
406
|
node_id = '594e606212e17a002f2e3251'
|
406
|
-
|
407
|
+
subnet_id = '59c9f77cd412960028b99d2b'
|
407
408
|
subnet = user.get_subnet(node_id:, subnet_id:)
|
408
409
|
```
|
409
410
|
|
411
|
+
#### Update Subnet
|
412
|
+
```bash
|
413
|
+
node_id = '594e606212e17a002f2e3251'
|
414
|
+
subnet_id = '59c9f77cd412960028b99d2b'
|
415
|
+
body = {
|
416
|
+
"preferences": {
|
417
|
+
"allow_foreign_transactions":true,
|
418
|
+
"daily_atm_withdrawal_limit":100,
|
419
|
+
"daily_transaction_limit":900
|
420
|
+
}
|
421
|
+
}
|
422
|
+
subnet = user.update_subnet(node_id: node_id, payload: body, subnet_id: subnet_id)
|
423
|
+
```
|
424
|
+
|
410
425
|
### Transactions
|
411
426
|
|
412
427
|
#### Create Transaction
|
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.2
|
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-01-
|
11
|
+
date: 2019-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -122,9 +122,7 @@ files:
|
|
122
122
|
- lib/synapse_api/users.rb
|
123
123
|
- lib/synapse_api/version.rb
|
124
124
|
- lib/synapse_fi.rb
|
125
|
-
- pkg/
|
126
|
-
- pkg/synapse_fi-0.0.4.gem
|
127
|
-
- pkg/synapse_fi-1.0.0.gem
|
125
|
+
- pkg/synapseruby-1.0.0.gem
|
128
126
|
- pkg/synapseruby-1.0.1.gem
|
129
127
|
- samples.md
|
130
128
|
- synapse_fi.gemspec
|
data/pkg/synapse_fi-0.0.3.gem
DELETED
Binary file
|
data/pkg/synapse_fi-0.0.4.gem
DELETED
Binary file
|
data/pkg/synapse_fi-1.0.0.gem
DELETED
Binary file
|