synapse_payments 0.2.1 → 0.3.0

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: 4e590a041ad9302f8877342b1b556f604a06de7a
4
- data.tar.gz: e0697290d288ef7c2f33cddd953dff2375a59350
3
+ metadata.gz: 627df51a7ca9b4cbc7e74aea0fafdd70903cf1ae
4
+ data.tar.gz: 4f75f645a697beaaaa4a25695b11d6114fb282d4
5
5
  SHA512:
6
- metadata.gz: e2e5ac93919fd1d18c0b2db8fd4c5e21261837afa4ab369f4c167d5e1d6a201e23d8957c73d6b7a5345bb6df7c9b7052378631485c9a9d55105c44add2ee6dea
7
- data.tar.gz: d57183991d048a031511ccc1e3958d15db5ba74b097cddb55e9c42ea733bac9e888616501f65eb69b8ad2e4dcb19ea488f966d085c9392a84a564b847d770b7e
6
+ metadata.gz: 254f58ed523069c429d9df890e49ac945d8a716e200a6bdb0d601654d581604dab796f5a2eaa1282b82a3eaf3db7d389a692a9a09e83188560d977a5ddaf0fe6
7
+ data.tar.gz: 68c4b29014ba8c37ba394bea3c48a30041138a9dec3ac61ca7118e40daf9b8d259e06bd4a7c4eaa1c35c1d02e1ed08055df8941340d9433f97ee148bc397a8f9
data/.travis.yml CHANGED
@@ -7,7 +7,7 @@ cache: bundler
7
7
  sudo: false
8
8
  fast_finish: true
9
9
  env:
10
- - USER_ID=
10
+ - USER_ID= SYNAPSE_PAYMENTS_CLIENT_ID= SYNAPSE_PAYMENTS_CLIENT_SECRET=
11
11
  notifications:
12
12
  email:
13
13
  on_success: always
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`, `attach_photo_id`, `add_escrow_account`
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
@@ -1,3 +1,3 @@
1
1
  module SynapsePayments
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
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
- NOTE: Action needs to be implemented.
111
+ ```ruby
112
+ response = user_client.attach_file(full_file_path)
113
+ ```
112
114
 
113
115
  #### Add a bank account
114
116
 
@@ -28,5 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "webmock"
29
29
 
30
30
  spec.add_dependency "http", '~> 0.9.8'
31
+ spec.add_dependency "mime-types", '~> 3.0'
31
32
 
32
33
  end
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.2.1
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-24 00:00:00.000000000 Z
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: