valken-shipping 1.1.5 → 2.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab3690dda426e4cf2d007e9c44872957323960c8457434bef1134c1f373194f4
|
4
|
+
data.tar.gz: 38f098df1c9aa7a8a83bbbb8fd52a34984aa0329fc8e248dc9337f5aeacb3d05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c629f3bc576ff4f7019966324569b77424d5d09e4af73928f5587c025fb1c2152d3224ca284d004b182b57ebaa736327d1ceb4683a022ed6299f8f3305a10ce1
|
7
|
+
data.tar.gz: eea6eb560252fef7fdd359b4ae4d59a277a7694c6dfa6c79708b5141d9f29ed1d4663e0782d8b5e02c075432b4f3a5b824bc4a0a8849bf92a4fb32f9b84ea1a1
|
@@ -167,18 +167,18 @@ module Workarea
|
|
167
167
|
selected_rates = rates.select {|rate| rate.delivery_date.present? && rate.delivery_date == date}
|
168
168
|
cheap_rate = selected_rates.sort_by(&:price).first
|
169
169
|
description = "#{cheap_rate.delivery_date.strftime('%A, %B %d, %Y')}"
|
170
|
-
shipping_option = create_shipping_options(cheap_rate, service_code[index], description)
|
170
|
+
shipping_option = create_shipping_options(cheap_rate, service_code[index], description, Workarea.config.shipping_rates[index])
|
171
171
|
filtered_rates.push(shipping_option)
|
172
172
|
end
|
173
173
|
filtered_rates
|
174
174
|
end
|
175
175
|
|
176
176
|
# creating a ShippingOption
|
177
|
-
def create_shipping_options(rate, rate_label = nil, description = nil)
|
177
|
+
def create_shipping_options(rate, rate_label = nil, description = nil, sub_name)
|
178
178
|
ShippingOption.new(
|
179
179
|
carrier: rate.carrier,
|
180
|
-
name:
|
181
|
-
sub_name:
|
180
|
+
name: rate_label.keys.join || rate.service_name,
|
181
|
+
sub_name: sub_name.values.join,
|
182
182
|
service_code: rate.service_code,
|
183
183
|
description: description,
|
184
184
|
price: Money.new(rate.price, rate.currency),
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Workarea
|
2
2
|
decorate Shipping, with: :valken do
|
3
|
-
decorated do
|
3
|
+
decorated do
|
4
|
+
field :tracking_number, type: String
|
4
5
|
end
|
5
6
|
|
6
7
|
class_methods do
|
@@ -9,7 +10,7 @@ module Workarea
|
|
9
10
|
def find_method_options(packages, shipping_option)
|
10
11
|
return [] if address.blank? || packages.blank?
|
11
12
|
shipping_option = shipping_option || Workarea.config.gateways.shipping
|
12
|
-
|
13
|
+
|
13
14
|
origin = ActiveShipping::Location.new(Workarea.config.shipping_origin)
|
14
15
|
response = shipping_option.find_rates(
|
15
16
|
origin,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valken-shipping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sushmitha02
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
|
-
rubygems_version: 3.0.
|
73
|
+
rubygems_version: 3.0.8
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: shipping options
|