solidus_melhor_envio 1.0.0 → 1.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c6708cbeb3642d4badecc81cf24b42297e7db6254f4492a4edfe92d057f9cc2
|
4
|
+
data.tar.gz: 8820b20d0e323555d53ffc3a81d01bd0fd6e01538b81238a8d7feb80d19c326a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aa5fbdfaa69349510abf0cedc2a805c08bf90796f827c10fdfda8bede9a2c2d963bfeaeec28d11fcbea9d4d6559e434cf870fcb274505715f7674035a7400c6
|
7
|
+
data.tar.gz: 280368821229c67f4e57bbb4ed0534e90902a3a16513e4348db15d17b64a01363a6fab7e76d95bdca4bc3c86f8cbf6f4b996ae9ddc7088977c8133787cad3bfb
|
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
|
-
|
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,6 +1,6 @@
|
|
1
1
|
class AddDeliveryTimeToSpreeShippingRate < ActiveRecord::Migration[7.0]
|
2
2
|
def change
|
3
|
-
add_column :spree_shipping_rates, :min_delivery_time, :integer
|
4
|
-
add_column :spree_shipping_rates, :max_delivery_time, :integer
|
3
|
+
add_column :spree_shipping_rates, :min_delivery_time, :integer, if_not_exists: true
|
4
|
+
add_column :spree_shipping_rates, :max_delivery_time, :integer, if_not_exists: true
|
5
5
|
end
|
6
6
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_melhor_envio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hamilton Tumenas Borges
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|