correios_api 0.2.0 → 0.4.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
  SHA256:
3
- metadata.gz: 6231f36d0629eb37a315f601efd989c9deef75f17293c88cf17d345ac473efbf
4
- data.tar.gz: 31cc6e528e9a5ef6f549f350a0a8708ad31c1d55f7b4af3ea1a48c3a8fede1a5
3
+ metadata.gz: c04ca80a840910c4b9a5d45576156d0b76a802a9ac96209251af67ee5f962b63
4
+ data.tar.gz: f28c0c03c2e7404913d966371f908ce23280401d4e2a48140b57a1f0096721a0
5
5
  SHA512:
6
- metadata.gz: 0f79d16d786de5e94e57ccf784bf372e87d5387dfabd27d48bc298ad416f281238c7fdb827731778aefafbf86e79aa5e3f551ce4e86c43245f8cbee4ba286369
7
- data.tar.gz: a7403032b2701c0ea50182645ff71597580f8993a78fb19abb427fba172ffca04157fc3d2ee5b53dc0a939f55f7b8f2ef39ab9bbb05ac636988509f473c52695
6
+ metadata.gz: 86fdff098c2634dfcaf8c93d4b1e3f91aa863049132ae104007fa236e93834f22b04cf7a099fd25528e02eeff36133aa5a993fefc5e1666d2d5a089e6128363b
7
+ data.tar.gz: 1421c93d0e0f2e28d76c10bf96622890d6ecfed530a412c1a4bc509abb16cb250376bc198f3b5d6f5cd04fba6eb5a10679ec8ba302d3437c2f2cc42f58e7c301
@@ -29,9 +29,10 @@ module CorreiosApi
29
29
  @password = password
30
30
  @post_card = post_card
31
31
  @contract_number = contract_number
32
- if @access_token.nil? || @expires_in < Time.now
33
- authenticate
34
- end
32
+ @access_token = access_token
33
+ # if @access_token.nil? || @expires_in < Time.now
34
+ # authenticate
35
+ # end
35
36
  end
36
37
 
37
38
  def authenticate
@@ -93,7 +94,7 @@ module CorreiosApi
93
94
  larguraInformada: width_cm,
94
95
  comprimentoInformado: length_cm,
95
96
  cienteObjetoNaoProibido: "1",
96
- modalidadePagamento: "2", # 1-à vista, 2-à faturar, 3- à avista e à afaturar e 4- Prestação de contas recebimento ou pagamento
97
+ modalidadePagamento: "2" # 1-à vista, 2-à faturar, 3- à avista e à afaturar e 4- Prestação de contas recebimento ou pagamento
97
98
  # solicitarColeta: "N",
98
99
  # dataPrevistaPostagem: "29/09/2024"
99
100
  }
@@ -161,7 +162,7 @@ module CorreiosApi
161
162
  def delivery_time zipcode_from, zipcode_to
162
163
  body = {
163
164
  idLote: "1",
164
- parametrosPrazo: SERVICES.map { |service| { coProduto: service[:code], nuRequisicao: 1, cepOrigem: zipcode_from, cepDestino: zipcode_to } }
165
+ parametrosPrazo: SERVICES.map { |service| {coProduto: service[:code], nuRequisicao: 1, cepOrigem: zipcode_from, cepDestino: zipcode_to} }
165
166
  }
166
167
  response = post(
167
168
  "/prazo/v1/nacional",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CorreiosApi
4
- VERSION = "0.2.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/correios_api.rb CHANGED
@@ -2,7 +2,6 @@ require_relative "correios_api/version"
2
2
 
3
3
  require "base64"
4
4
  require "ac"
5
- require "dotenv"
6
5
 
7
6
  require "correios_api/client"
8
7
  require "correios_api/rate"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: correios_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todas Essas Coisas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-24 00:00:00.000000000 Z
11
+ date: 2024-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64