valken-shipping 1.1.4 → 1.1.5

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: fa9324cff477a6c9ab22438c530c614b020f66e209ae5e50ac88f0ced04b7a49
4
- data.tar.gz: 0dc95eabe9d8fcfe12cd667288f9b0a84548b3e2ecf631d0a0b04189c1b20724
3
+ metadata.gz: 7608c70f08d733b5da90794c417ad5bc0b70a85ec6250fe8803f97359e5d6f6a
4
+ data.tar.gz: d3ff069bfa00e8bba8e8ff3c5a286bd52d837062d8abaa08c0230c497346c439
5
5
  SHA512:
6
- metadata.gz: 5e8b065cc02c8af0d8ecee5a34ea80fcb7f6d86fe3e22ed6d2824513c956637404f8bc4973bcbfe3afa5851fa6e58423bf2e8de2227ee26a0c336bbf4078eae0
7
- data.tar.gz: 34f59bb3e5fdb30bdf227120aca4b1d71016b5af15b79a094d9c5d9c3d8a02f4ac47d5a7ef0e1aa1303c0a4489b40bde4de86a425a75dd40e02fa40dfe37be94
6
+ metadata.gz: 140ef76ea1c80c5ecc8acc17e8553d725a648d005fd460e3b866224ac934c328637da2597c98f6bae5982a9bb0fcb6778fe78f6a646adfe485fa9659edb4f647
7
+ data.tar.gz: 601497d3f3e14b71ddd8efeadae6f9830d51d0ecb318e9a4d9b7b5329bc1f0f1be288aeefc9723a38252a0f1c0f8f877f2369d3d3b8fe6e8f18d7ba990f3b7cb
@@ -79,7 +79,8 @@ module Workarea
79
79
  def get_free_shipping
80
80
  ShippingOption.new(
81
81
  carrier: "Free Shipping",
82
- name: "5 to 9 Day",
82
+ name: "Valken Economy",
83
+ sub_name: "5 - 9 Business Days",
83
84
  service_code: "Free",
84
85
  price: Money.new(0.0, "USD"),
85
86
  tax_code: "TAX01"
@@ -104,7 +105,8 @@ module Workarea
104
105
 
105
106
  ShippingOption.new(
106
107
  carrier: "LTL Shipping",
107
- name: "3 to 5 Day",
108
+ name: "Valken Standard",
109
+ sub_name: "3 - 5 Business Days",
108
110
  service_code: "LTL01",
109
111
  price: Money.new(weight_price * 100, "USD"),
110
112
  tax_code: "TAX01"
@@ -164,7 +166,7 @@ module Workarea
164
166
  uniq_delivery_dates.each_with_index do |date, index|
165
167
  selected_rates = rates.select {|rate| rate.delivery_date.present? && rate.delivery_date == date}
166
168
  cheap_rate = selected_rates.sort_by(&:price).first
167
- description = "#{cheap_rate.delivery_date.strftime('%a, %d %b %Y')}"
169
+ description = "#{cheap_rate.delivery_date.strftime('%A, %B %d, %Y')}"
168
170
  shipping_option = create_shipping_options(cheap_rate, service_code[index], description)
169
171
  filtered_rates.push(shipping_option)
170
172
  end
@@ -175,7 +177,8 @@ module Workarea
175
177
  def create_shipping_options(rate, rate_label = nil, description = nil)
176
178
  ShippingOption.new(
177
179
  carrier: rate.carrier,
178
- name: rate_label || rate.service_name,
180
+ name: Workarea.config.shipping_rates[0].keys[0],
181
+ sub_name: Workarea.config.shipping_rates[0].values[0],
179
182
  service_code: rate.service_code,
180
183
  description: description,
181
184
  price: Money.new(rate.price, rate.currency),
@@ -185,7 +188,5 @@ module Workarea
185
188
  )
186
189
  )
187
190
  end
188
-
189
-
190
191
  end
191
192
  end
@@ -1,7 +1,7 @@
1
1
  module Workarea
2
2
  decorate ShippingOption, with: :valken do
3
3
  decorated do
4
- attr_reader :description
4
+ attr_reader :description, :sub_name
5
5
  end
6
6
 
7
7
  class_methods do
@@ -3,13 +3,12 @@ Workarea.configure do |config|
3
3
 
4
4
  config.weight_table = {"2": 5, "15": 15, "200": 1, "2500": 200}
5
5
 
6
-
7
6
  config.shipping_rates = [
8
- "Overnight",
9
- "2 Day",
10
- "3 Day"
7
+ {"Valken Overnight" => "Overnight"},
8
+ {"Valken Express 2-Day" => "2 Business Days"},
9
+ {"Valken Express 3-Day" => "3 Business Days"}
11
10
  ]
12
- config.ups_options = {"12"=> "3 Day", "01"=> "Overnight", "02"=> "2 Day"}
13
- config.fedex_options = {"STANDARD_OVERNIGHT"=> "Overnight", "FEDEX_2_DAY"=> "2 Day", "GROUND_HOME_DELIVERY"=> "3 Day"}
11
+ config.ups_options = {"12"=> "Valken Express 3-Day", "01"=> "Valken Overnight", "02"=> "Valken Express 2-Day"}
12
+ config.fedex_options = {"STANDARD_OVERNIGHT"=> "Valken Overnight", "FEDEX_2_DAY"=> "Valken Express 2-Day", "GROUND_HOME_DELIVERY"=> "Valken Express 3-Day"}
14
13
  end
15
14
  Valken::Shipping.auto_initialize_gateway
@@ -1,5 +1,5 @@
1
1
  module Valken
2
2
  module Shipping
3
- VERSION = '1.1.4'
3
+ VERSION = '1.1.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valken-shipping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sushmitha02