synapse_payments 0.2.1 → 0.3.0
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/.travis.yml +1 -1
- data/README.md +2 -1
- data/lib/synapse_payments/user_client.rb +15 -0
- data/lib/synapse_payments/version.rb +1 -1
- data/samples.md +4 -2
- data/synapse_payments.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 627df51a7ca9b4cbc7e74aea0fafdd70903cf1ae
|
4
|
+
data.tar.gz: 4f75f645a697beaaaa4a25695b11d6114fb282d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 254f58ed523069c429d9df890e49ac945d8a716e200a6bdb0d601654d581604dab796f5a2eaa1282b82a3eaf3db7d389a692a9a09e83188560d977a5ddaf0fe6
|
7
|
+
data.tar.gz: 68c4b29014ba8c37ba394bea3c48a30041138a9dec3ac61ca7118e40daf9b8d259e06bd4a7c4eaa1c35c1d02e1ed08055df8941340d9433f97ee148bc397a8f9
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -46,9 +46,10 @@ Check out [samples.md](samples.md) to review how to use this library.
|
|
46
46
|
|
47
47
|
* add pagination/querying to `users.all`, `nodes.all`, and `transactions.all`
|
48
48
|
* add support for new `subscriptions` resource
|
49
|
-
* add new methods to UserClient: `link_bank_account`, `verify_mfa`, `
|
49
|
+
* add new methods to UserClient: `link_bank_account`, `verify_mfa`, `add_escrow_account`, etc.
|
50
50
|
* add `Banks` object with `list` method which returns supported banks from https://synapsepay.com/api/v3/institutions/show
|
51
51
|
* consider creating a `Response` object wrapper
|
52
|
+
* clean up object/folder structure
|
52
53
|
|
53
54
|
### Tests
|
54
55
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'mime/types'
|
2
|
+
|
1
3
|
module SynapsePayments
|
2
4
|
class UserClient
|
3
5
|
|
@@ -64,6 +66,19 @@ module SynapsePayments
|
|
64
66
|
@client.patch(path: "/users/#{@user_id}", oauth_key: @oauth_key, fingerprint: @fingerprint, json: data)
|
65
67
|
end
|
66
68
|
|
69
|
+
def attach_file(file_path)
|
70
|
+
file_contents = open(file_path) { |f| f.read }
|
71
|
+
file_type = ::MIME::Types.type_for(file_path).first.content_type
|
72
|
+
|
73
|
+
data = {
|
74
|
+
doc: {
|
75
|
+
attachment: "data:#{file_type};base64,#{Base64.encode64(file_contents)}"
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
@client.patch(path: "/users/#{@user_id}", oauth_key: @oauth_key, fingerprint: @fingerprint, json: data)
|
80
|
+
end
|
81
|
+
|
67
82
|
# Adds a bank account by creating a node of node type ACH-US.
|
68
83
|
#
|
69
84
|
# @param name [String] the name of the account holder
|
data/samples.md
CHANGED
@@ -106,9 +106,11 @@ response = user_client.answer_kba(
|
|
106
106
|
)
|
107
107
|
```
|
108
108
|
|
109
|
-
#### Attach photo ID
|
109
|
+
#### Attach photo ID or another file type
|
110
110
|
|
111
|
-
|
111
|
+
```ruby
|
112
|
+
response = user_client.attach_file(full_file_path)
|
113
|
+
```
|
112
114
|
|
113
115
|
#### Add a bank account
|
114
116
|
|
data/synapse_payments.gemspec
CHANGED
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Julio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11
|
11
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 0.9.8
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: mime-types
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '3.0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '3.0'
|
125
139
|
description: Requires Ruby 2.1 and up. Not all API actions are supported. Find out
|
126
140
|
more in the readme todo section.
|
127
141
|
email:
|