asaas-ruby 0.2.25 → 0.2.27

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
  SHA256:
3
- metadata.gz: 9014af80d8a4732eb528a51e063e99599dfdbbf968e40d91b2a73f747a58f13e
4
- data.tar.gz: f0b671789d112681d5067da1ffe2f8fa80e31bae950877b1e25cfe38281402c6
3
+ metadata.gz: 009e79c222a295a1148c7ad2e10a9990c4eee72e6500700749d8a4076683bc5a
4
+ data.tar.gz: 3c5f9396e8927f1c63c718c815a26cbc444bab68d783b1212154220153cc63ef
5
5
  SHA512:
6
- metadata.gz: 1e4a665d100614e4a709f511d01896169e29b2f9eea12ec01e32b48469eddc00f7415462e69e472f28a647ee96e74f1a5600626541a6770691a29a92d64a81f1
7
- data.tar.gz: 9301131f39710e62a87cbb36222e5670bbc107650a5c1d2a12a6e7772c2e4754d25fcbad24396c79b6882b7119448b75fb76eb22022b50321d18102a956f3c96
6
+ metadata.gz: ab0ec8e6a6003e139f5a39a618d307c20147ab7bd0db1a35ef26ace4a2b2eb3b95d85f731165ee45e7c2f50deb730a43df0bd7d3f328b66e7ad4db48f0bffbb6
7
+ data.tar.gz: 5143268bede2080f81bc18ebc09625d01cd0ab3578d3eb0e2e18d6f0ffc06b72f9648423d2ba05c247ce54ceebd7c113d7121f04c2bc48f74fa35c8436117792
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.4
1
+ 2.3.1
@@ -85,18 +85,12 @@ module Asaas
85
85
  end
86
86
 
87
87
  def request(method, params = {}, body = nil)
88
- body = body.to_h
89
- body = body.delete_if { |k, v| v.nil? || v.to_s.empty? }
90
- body = body.to_json
91
88
  @response = Typhoeus::Request.new(
92
89
  parse_url(params.fetch(:id, false)),
93
90
  method: method,
94
- body: body,
91
+ body: body_parser(body),
95
92
  params: params,
96
- headers: {
97
- 'access_token': @token || Asaas::Configuration.token,
98
- 'Content-Type': 'application/json'
99
- },
93
+ headers: request_headers,
100
94
  verbose: Asaas::Configuration.debug
101
95
  ).run
102
96
  end
@@ -153,6 +147,19 @@ module Asaas
153
147
  def get_headers
154
148
  { 'access_token': @token || Asaas::Configuration.token }
155
149
  end
150
+
151
+ def body_parser(body)
152
+ return nil unless body
153
+
154
+ body.to_h.delete_if { |k, v| v.nil? || v.to_s.empty? }.to_json
155
+ end
156
+
157
+ def request_headers
158
+ {
159
+ 'access_token': @token || Asaas::Configuration.token,
160
+ 'Content-Type': 'application/json'
161
+ }
162
+ end
156
163
  end
157
164
  end
158
165
  end
@@ -17,6 +17,7 @@ module Asaas
17
17
  attribute :country, String
18
18
  attribute :postalCode, String
19
19
  attribute :cpfCnpj, String
20
+ attribute :birthDate, String
20
21
  attribute :personType, String
21
22
  attribute :companyType, String
22
23
  attribute :apiKey, String
data/lib/asaas/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Asaas
2
- VERSION = '0.2.25'
2
+ VERSION = '0.2.27'
3
3
  end
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.25
4
+ version: 0.2.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos Junior
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-09 00:00:00.000000000 Z
11
+ date: 2023-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  - !ruby/object:Gem::Version
254
254
  version: '0'
255
255
  requirements: []
256
- rubygems_version: 3.2.17
256
+ rubygems_version: 3.0.9
257
257
  signing_key:
258
258
  specification_version: 4
259
259
  summary: Asass.com Ruby API Wrapper