synapsis_v3 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/synapsis_v3/api_operations/show.rb +10 -0
- data/lib/synapsis_v3/api_resource.rb +2 -1
- data/lib/synapsis_v3/transaction.rb +28 -0
- data/lib/synapsis_v3/user.rb +10 -1
- data/lib/synapsis_v3/version.rb +1 -1
- data/lib/synapsis_v3.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf3fb00e061d1dbb72561083a4b623eb7e41ce87
|
4
|
+
data.tar.gz: f9fbc911ed82caec128e197a74c4284dd90ecf7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edcb9fc1abe8b767af40dab833291446227b772466dca49416a1a0014d3eefbf7d6bffe45b1c813aa1ac42c91d8ffcff22cf6926d9161afa4f42eafa47ca4b5a
|
7
|
+
data.tar.gz: b371f065a1becf026312dc2f10fa9ee2f202fcf74be9012524f65d6d0e10be0f92271cc70f1a2d528f8d6d6b8bf56e6d2eb6f84cb6328bd1bfbbda30efb6fa6a
|
@@ -22,7 +22,8 @@ class Synapsis::APIResource
|
|
22
22
|
if response.success?
|
23
23
|
return parsed_response
|
24
24
|
else
|
25
|
-
|
25
|
+
puts response
|
26
|
+
raise Synapsis::Error, parsed_response[class_name] || parsed_response['reason'] || parsed_response['error_message'] || parsed_response['error']['en']
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
@@ -1,4 +1,16 @@
|
|
1
1
|
class Synapsis::Transaction < Synapsis::APIResource
|
2
|
+
extend Synapsis::APIOperations::Show
|
3
|
+
|
4
|
+
module Status
|
5
|
+
QUEUED_BY_SYNAPSE = 'QUEUED-BY-SYNAPSE'
|
6
|
+
QUEUED_BY_RECEIVER = 'QUEUED-BY-RECEIVER'
|
7
|
+
CREATED = 'CREATED'
|
8
|
+
PROCESSING_DEBIT = 'PROCESSING-DEBIT'
|
9
|
+
PROCESSING_CREDIT = 'PROCESSING-CREDIT'
|
10
|
+
SETTLED = 'SETTLED'
|
11
|
+
CANCELED = 'CANCELED'
|
12
|
+
RETURNED = 'RETURNED'
|
13
|
+
end
|
2
14
|
|
3
15
|
# Synapse uses the same endpoint for other Synapse accounts, Account/Routing number, Bank Login, Wire-US, Wire-INT
|
4
16
|
# Add via bank username/password
|
@@ -12,5 +24,21 @@ class Synapsis::Transaction < Synapsis::APIResource
|
|
12
24
|
response = request(:post, add_transaction_url, params)
|
13
25
|
return_response(response)
|
14
26
|
end
|
27
|
+
|
28
|
+
def self.show(params)
|
29
|
+
response = show_request(params)
|
30
|
+
return_response(response)
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.cancel(params)
|
34
|
+
cancel_transaction_url = "#{API_V3_PATH}trans/cancel"
|
35
|
+
|
36
|
+
response = request(:post, cancel_transaction_url, params)
|
37
|
+
return_response(response)
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.class_name
|
41
|
+
'trans'
|
42
|
+
end
|
15
43
|
end
|
16
44
|
|
data/lib/synapsis_v3/user.rb
CHANGED
@@ -34,8 +34,17 @@ class Synapsis::User < Synapsis::APIResource
|
|
34
34
|
def self.add_document(params)
|
35
35
|
add_document_url = "#{API_V3_PATH}user/doc/attachments/add"
|
36
36
|
|
37
|
-
response = request(:post, add_document_url, params)
|
37
|
+
response = request(:post, add_document_url, convert_attachment_to_base_64(params))
|
38
|
+
|
38
39
|
return_response(response)
|
39
40
|
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def self.convert_attachment_to_base_64(doc_params)
|
45
|
+
doc_params[:user][:doc][:attachment] = "data:text/csv;base64,#{Base64.encode64(File.open(doc_params[:user][:doc][:attachment], 'rb') { |f| f.read })}"
|
46
|
+
|
47
|
+
return doc_params
|
48
|
+
end
|
40
49
|
end
|
41
50
|
|
data/lib/synapsis_v3/version.rb
CHANGED
data/lib/synapsis_v3.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synapsis_v3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daryll Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- bin/setup
|
115
115
|
- lib/synapsis_v3.rb
|
116
116
|
- lib/synapsis_v3/api_operations/create.rb
|
117
|
+
- lib/synapsis_v3/api_operations/show.rb
|
117
118
|
- lib/synapsis_v3/api_resource.rb
|
118
119
|
- lib/synapsis_v3/error.rb
|
119
120
|
- lib/synapsis_v3/node.rb
|