solidus_bling 3.0.2 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/solidus_bling/order.rb +6 -6
- data/app/models/solidus_bling/token.rb +0 -4
- data/app/views/spree/admin/solidus_bling/accounts/_form.html.erb +7 -0
- data/app/views/spree/admin/solidus_bling/accounts/index.html.erb +7 -0
- data/db/migrate/20231110113221_create_solidus_bling_shipping_methods.rb +2 -2
- data/lib/solidus_bling/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59e29330f3c5da9ebba7b08113fa4c6b859861c715040e0915274b7d5af0ae32
|
4
|
+
data.tar.gz: a6adb152b89aa7aa7a2243d5098aba58563b06e8e6c34a938cf021bce7b353f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d927218a320e560c0aaaae330c8d5e2402cf45d0298f64a7940b32ff7af065a26468787cac1526c02bb2192424b9add5358bc4f5aa9d4d4ca8f88e143596af3d
|
7
|
+
data.tar.gz: 8a1b799003bd9f5bfe457e8ef2bac6ba09cd2a5c6698be82699cde210a17d3c1e7d0295db4eb7e8ea7f4eac030ca4e66c85ec859fa89a5acac0c60fa0b865703
|
@@ -15,7 +15,7 @@ module SolidusBling
|
|
15
15
|
observacoes_internas = internal_observations
|
16
16
|
transporte = shipment
|
17
17
|
|
18
|
-
|
18
|
+
BlingApi::Order.new(
|
19
19
|
id_contato: contato.id,
|
20
20
|
items: items,
|
21
21
|
parcelas: parcelas,
|
@@ -80,13 +80,13 @@ module SolidusBling
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def internal_observations
|
83
|
-
"Pagamento: #{@parcelas}x R$ #{(@order.total.to_f / @parcelas).round(2)}"
|
83
|
+
"Pagamento: #{@parcelas}x R$ #{(@order.total.to_f / @parcelas).round(2)}" \
|
84
|
+
"\n" \
|
85
|
+
"Forma de envio: #{@order.shipments.last.selected_shipping_rate.name}" \
|
84
86
|
"\n" +
|
85
|
-
|
87
|
+
build_cupons(@order.promotions).to_s +
|
86
88
|
"\n" +
|
87
|
-
|
88
|
-
"\n" +
|
89
|
-
"#{build_order_url}"
|
89
|
+
build_order_url.to_s
|
90
90
|
end
|
91
91
|
|
92
92
|
def shipment
|
@@ -2,10 +2,6 @@ module SolidusBling
|
|
2
2
|
class Token < ::Ac::Base
|
3
3
|
BASE_URL = "https://www.bling.com.br/Api/v3"
|
4
4
|
|
5
|
-
def initialize
|
6
|
-
super
|
7
|
-
end
|
8
|
-
|
9
5
|
def authorize bling_account, code
|
10
6
|
basic_encoded = Base64.strict_encode64("#{bling_account.client_id}:#{bling_account.client_secret}")
|
11
7
|
headers = {
|
@@ -59,6 +59,13 @@
|
|
59
59
|
<%= form.text_field :access_token, class: 'fullwidth' %>
|
60
60
|
<%= form.error_message_on :access_token %>
|
61
61
|
<% end %>
|
62
|
+
|
63
|
+
<div class="field">
|
64
|
+
<%= label_tag :token_expires_in, "Token Expiration" %>
|
65
|
+
<div class="fullwidth" id="token_expires_in" name="token_expires_in">
|
66
|
+
<%= bling_account.token_expires_in %>
|
67
|
+
</div>
|
68
|
+
</div>
|
62
69
|
</div>
|
63
70
|
</div>
|
64
71
|
</fieldset>
|
@@ -54,6 +54,13 @@
|
|
54
54
|
<%= label_tag :access_token, "Access Token" %>
|
55
55
|
<%= text_field_tag :access_token, account.access_token, class:"fullwidth", disabled: true %>
|
56
56
|
</div>
|
57
|
+
|
58
|
+
<div class="field">
|
59
|
+
<%= label_tag :token_expires_in, "Token Expiration" %>
|
60
|
+
<div class="fullwidth" id="token_expires_in" name="token_expires_in">
|
61
|
+
<%= account.token_expires_in %>
|
62
|
+
</div>
|
63
|
+
</div>
|
57
64
|
</div>
|
58
65
|
</div>
|
59
66
|
</fieldset>
|
@@ -3,8 +3,8 @@ class CreateSolidusBlingShippingMethods < ActiveRecord::Migration[7.0]
|
|
3
3
|
create_table :solidus_bling_shipping_methods do |t|
|
4
4
|
t.string :alias
|
5
5
|
t.string :company
|
6
|
-
t.integer :account_id, null: false, index:
|
7
|
-
t.integer :spree_shipping_method_id, null: false, index:
|
6
|
+
t.integer :account_id, null: false, index: {name: "solidus_bling_shipping_account_index"}
|
7
|
+
t.integer :spree_shipping_method_id, null: false, index: {name: "solidus_bling_spree_shipping_index"}
|
8
8
|
|
9
9
|
t.timestamps
|
10
10
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_bling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
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-
|
11
|
+
date: 2023-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|