asaas-ruby 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/asaas/api/base.rb +2 -3
- data/lib/asaas/api/documents.rb +33 -0
- data/lib/asaas/client.rb +4 -0
- data/lib/asaas/configuration.rb +1 -1
- data/lib/asaas/models/account.rb +2 -1
- data/lib/asaas/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dd811d70deee95872c2f97b1d72affb8b76ed1ae9f29f9e8ead2e8017a43309
|
4
|
+
data.tar.gz: 199bdb9a806540e89a5a756c41300f2ff324018cff4fce69ff929bf6975cb6b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8852d4cf92d4cc18307a2e0ad561d55a261f865b318f1ac6e66d28edd3bfdb3f5e1963322951c835715b3bc8bdb5b930da1a656156f6664e98f72ab53940090d
|
7
|
+
data.tar.gz: 52ca4fb2cf3b529f841d4b939a98302c0f5f58927b4d2452ba81dfa24eed79dd070ba6ad3e8bb336afce1bdbdcd628a6c5ee2c856a4e76829456a6a95bdd9536
|
data/README.md
CHANGED
data/lib/asaas/api/base.rb
CHANGED
@@ -14,7 +14,6 @@ module Asaas
|
|
14
14
|
@route = route
|
15
15
|
@api_version = api_version || Asaas::Configuration.api_version
|
16
16
|
@endpoint = Asaas::Configuration.get_endpoint(api_version)
|
17
|
-
puts @endpoint
|
18
17
|
end
|
19
18
|
|
20
19
|
def extract_meta(meta)
|
@@ -94,7 +93,7 @@ module Asaas
|
|
94
93
|
method: method,
|
95
94
|
body: body,
|
96
95
|
params: params,
|
97
|
-
headers: {
|
96
|
+
headers: {
|
98
97
|
'access_token': @token || Asaas::Configuration.token,
|
99
98
|
'Content-Type': 'application/json'
|
100
99
|
},
|
@@ -156,4 +155,4 @@ module Asaas
|
|
156
155
|
end
|
157
156
|
end
|
158
157
|
end
|
159
|
-
end
|
158
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Asaas
|
2
|
+
module Api
|
3
|
+
class Documents < Asaas::Api::Base
|
4
|
+
|
5
|
+
def initialize(token)
|
6
|
+
super(token, 2, '/documents')
|
7
|
+
end
|
8
|
+
|
9
|
+
def upload(document_type, group_type, file)
|
10
|
+
group_types = %w[ASAAS_ACCOUNT_OWNER PARTNER LIMITED_COMPANY]
|
11
|
+
types = %w[IDENTIFICATION SOCIAL_CONTRACT]
|
12
|
+
|
13
|
+
raise ArgumentError, 'Wrong document_type' unless types.include? document_type
|
14
|
+
raise ArgumentError, 'Wrong group_type' unless group_types.include? group_type
|
15
|
+
|
16
|
+
@response = Typhoeus.post(URI(endpoint + route).to_s,
|
17
|
+
body: {
|
18
|
+
documentType: document_type
|
19
|
+
documentGroupType: group_type,
|
20
|
+
documentFile: file
|
21
|
+
},
|
22
|
+
headers: {
|
23
|
+
'access_token': @token || Asaas::Configuration.token,
|
24
|
+
'Content-Type': 'multipart/form-data'
|
25
|
+
},
|
26
|
+
verbose: Asaas::Configuration.debug
|
27
|
+
)
|
28
|
+
@response
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/asaas/client.rb
CHANGED
data/lib/asaas/configuration.rb
CHANGED
data/lib/asaas/models/account.rb
CHANGED
@@ -12,6 +12,7 @@ module Asaas
|
|
12
12
|
attribute :complement, Types::Coercible::String.optional
|
13
13
|
attribute :province, Types::Coercible::String.optional
|
14
14
|
attribute :postalCode, Types::Coercible::String.optional
|
15
|
-
attribute :apiKey, Types::Coercible::String.optional.default(nil)
|
15
|
+
attribute :apiKey, Types::Coercible::String.optional.default(nil)
|
16
|
+
attribute :companyType, Types::Coercible::String.optional.default(nil)
|
16
17
|
end
|
17
18
|
end
|
data/lib/asaas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asaas-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Junior
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -232,6 +232,7 @@ files:
|
|
232
232
|
- lib/asaas/api/base.rb
|
233
233
|
- lib/asaas/api/city.rb
|
234
234
|
- lib/asaas/api/customer.rb
|
235
|
+
- lib/asaas/api/documents.rb
|
235
236
|
- lib/asaas/api/notification.rb
|
236
237
|
- lib/asaas/api/payment.rb
|
237
238
|
- lib/asaas/api/subscription.rb
|