solidus_melhor_envio 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ad45c61e6fda2543564f9139188b9b06cd3c64d8b8b60dece02ce1503d095d4
4
- data.tar.gz: 2728d6275ae9c6d520924fe7591990b4d35b05195ada580bab675997d3e2a287
3
+ metadata.gz: 25b987cb1b08b32fa00f4f7cbbf15e087639ad909ba220f254625ff09762a30e
4
+ data.tar.gz: 1b9c3f1adce6452dff74d5929f7f35e4d5c5b062184765343e6e7feccf9812d8
5
5
  SHA512:
6
- metadata.gz: 977782b31359d3fe2ae205eba17c671e1e251d02b190fd12899c8f11e2ccc91df77ff75f8ddb7fa17aea524015872c63185d7d2edb3625628c911349dc7aca02
7
- data.tar.gz: 056d4c17829312baa57dd11fa3a48002b94f6efcc87f731e1a25b318c715f1156388574b5317c200efbd74f80184261b63cfae7f4b60dcae23ce5ca08fa9c192
6
+ metadata.gz: 72d1ff43fc7824968d6b2156b6b457782733b595ab7f14ba8cd7f059c5e5d100b4b4076e97c3826310b5ece6d06ec364252ad97fab2aad0f89d034d719892dcb
7
+ data.tar.gz: 22ef59f425df9104b584190c5939f6783127dffb15163cbb4a00bd7d2cf17f3e8fdf5ffe902f539e84f8d06c35b0e42a72a228653d4dfdabb0c74b9cfac385c5
data/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [![codecov](https://codecov.io/gh/solidusio-contrib/solidus_melhor_envio/branch/master/graph/badge.svg)](https://codecov.io/gh/solidusio-contrib/solidus_melhor_envio)
5
5
 
6
6
  <!-- Explain what your extension does. -->
7
+ Gem utilizada para integrar o MelhorEnvio (cotação de frete) no Solidus.
7
8
 
8
9
  ## Installation
9
10
 
@@ -21,7 +22,38 @@ bin/rails generate solidus_melhor_envio:install
21
22
 
22
23
  ## Usage
23
24
 
24
- <!-- Explain how to use your extension once it's been installed. -->
25
+ Adicionar no aquivo `/config/initializers/spree.rb` a linha abaixo, para configurar como padrão o MelhorEnvio:
26
+
27
+ ```ruby
28
+ Spree.config do |config|
29
+
30
+ # +++
31
+ config.stock.estimator_class= 'SolidusMelhorEnvio::ShippingEstimator'
32
+ end
33
+ ```
34
+ No arquivo `/config/initializers/solidus_melhor_envio.rb` definir as variáveis `app_name` (nome do aplicativo cadastrado no MelhorEnvio), `postal_code_from` (Código Postal de origem) e `services` (id dos serviços de frete desejados que retorne na requisição)
35
+
36
+ ```ruby
37
+ SolidusMelhorEnvio.configure do |config|
38
+
39
+ config.app_name = '' # ex. 'app_name'
40
+ config.postal_code_from = '' # ex.: '01555-000'
41
+ config.services = '' # ex.: '1,2,3,4' - valores separados por vírgula
42
+ end
43
+ ```
44
+
45
+ Após, criar a `SolidusMelhorEnvio::Account`, onde ficarão registrados os dados necessários para as requisições à API do MelhorEnvio. Exemplo:
46
+
47
+ ```ruby
48
+ SolidusMelhorEnvio::Account.create!({
49
+ app_name: 'app_name',
50
+ api_base_url: 'https://www.melhorenvio.com.br',
51
+ client_id: '12345',
52
+ client_secret: '123456',
53
+ refresh_token: '1234',
54
+ user_agent: 'usuario@example.com'
55
+ })
56
+ ```
25
57
 
26
58
  ## Development
27
59
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusMelhorEnvio
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_melhor_envio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hamilton Tumenas Borges