me_api 2.4.5 → 2.4.6
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/me_api/client_production.rb +10 -3
- data/lib/me_api/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e24fa0aecaa1b517d3e3226e081428f9ea8e0c1ec51798841b027303a418aa6
|
|
4
|
+
data.tar.gz: dcd37c499f6f2ffaaf4e1fefabdf763b70eba891d03ec9890ff858d394603147
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a0207de8bc3aba0b9188628a0eae6242bead7b5b5f2dc83e7cf0eae2fdb87b376befbe2a9b73fc28eb28ba16767cf86bb02c76de202c166ee603f1172de7c64
|
|
7
|
+
data.tar.gz: fb132ba5a842ca17bd3c6f48b57b2d2a354b31e57f6f1666e4fb6d2e3245ef3db798331cd6c0a365f9d5e92ce7f939ca0d31bc383e8cfd7a5b4783a639c8639f
|
|
@@ -2,6 +2,7 @@ module MeApi
|
|
|
2
2
|
class ClientProduction < Ac::Base
|
|
3
3
|
BASE_URL = "https://melhorenvio.com.br"
|
|
4
4
|
SAVE_RESPONSES = true
|
|
5
|
+
MAX_INSURANCE_VALUE = 1500
|
|
5
6
|
|
|
6
7
|
attr_accessor :refresh, :client_id, :client_secret, :token_expires_at, :test_mode
|
|
7
8
|
def initialize(access_token: nil, refresh: nil, client_id:, client_secret:, token_expires_at: nil, test_mode: false)
|
|
@@ -57,7 +58,7 @@ module MeApi
|
|
|
57
58
|
},
|
|
58
59
|
package: volume.to_api_format,
|
|
59
60
|
options: {
|
|
60
|
-
insurance_value: contents_value_brl,
|
|
61
|
+
insurance_value: capped_insurance_value(contents_value_brl),
|
|
61
62
|
receipt: false,
|
|
62
63
|
own_hand: false
|
|
63
64
|
},
|
|
@@ -107,7 +108,7 @@ module MeApi
|
|
|
107
108
|
volume.to_api_format
|
|
108
109
|
end,
|
|
109
110
|
options: {
|
|
110
|
-
insurance_value: insurance_value,
|
|
111
|
+
insurance_value: capped_insurance_value(insurance_value),
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
114
|
|
|
@@ -148,7 +149,13 @@ module MeApi
|
|
|
148
149
|
end
|
|
149
150
|
|
|
150
151
|
private
|
|
151
|
-
|
|
152
|
+
|
|
153
|
+
def capped_insurance_value(value)
|
|
154
|
+
return value if value.nil?
|
|
155
|
+
|
|
156
|
+
[value.to_f, MAX_INSURANCE_VALUE].min
|
|
157
|
+
end
|
|
158
|
+
|
|
152
159
|
def cleaned_tax_id(tax_id)
|
|
153
160
|
tax_id.gsub(/\D/, "")
|
|
154
161
|
end
|
data/lib/me_api/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: me_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.4.
|
|
4
|
+
version: 2.4.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Todas Essas Coisas
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-11-27 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: ac
|
|
@@ -23,6 +24,7 @@ dependencies:
|
|
|
23
24
|
- - ">="
|
|
24
25
|
- !ruby/object:Gem::Version
|
|
25
26
|
version: 1.1.0
|
|
27
|
+
description:
|
|
26
28
|
email:
|
|
27
29
|
- contato7bulloleo@gmail.com
|
|
28
30
|
executables: []
|
|
@@ -45,6 +47,7 @@ licenses:
|
|
|
45
47
|
metadata:
|
|
46
48
|
homepage_uri: https://github.com/todasessascoisas/me_api
|
|
47
49
|
source_code_uri: https://github.com/todasessascoisas/me_api
|
|
50
|
+
post_install_message:
|
|
48
51
|
rdoc_options: []
|
|
49
52
|
require_paths:
|
|
50
53
|
- lib
|
|
@@ -59,7 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
59
62
|
- !ruby/object:Gem::Version
|
|
60
63
|
version: '0'
|
|
61
64
|
requirements: []
|
|
62
|
-
rubygems_version: 3.
|
|
65
|
+
rubygems_version: 3.5.3
|
|
66
|
+
signing_key:
|
|
63
67
|
specification_version: 4
|
|
64
68
|
summary: ''
|
|
65
69
|
test_files: []
|