valken-shipping 3.0.3.pre → 3.0.3

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: bcfa8404b116337a84e98d859e0490b2c306ca286337be2fd64436add9ca7323
4
- data.tar.gz: 24a83e8fa9abfd9e9c5e57e37db4beaf4f4abab4a45c1b1bbbca23b5bae56ebc
3
+ metadata.gz: 41ebb107a33cc7d396971570bfe858014bfbbddfdbbca108d3574125564bc657
4
+ data.tar.gz: 11d04d7d9854c6f0583cc7c8b20dacc44512c51bbaee776a7b2cf9c18bb2362b
5
5
  SHA512:
6
- metadata.gz: 95791f77bb3756a6ab9fc00e15dc18723da1953133db0092738f55f36e630b2ccb465d38c248939775158a1e14c04dfec726d7716e82b0611cab1351041dbd0c
7
- data.tar.gz: 1a0aa5af87a183054ec21a491e3ed03d6e69990ac62934b5f00c84aeb47b8a8984c49b7499e5639cf7efd55d4eac67e0af177cded9222a0b20b10daccb3b9782
6
+ metadata.gz: 4f32dd08d61768e8412e561942a593345aee9d98227b611a1968be21e20fda4486de4c2e11a71a42ad7702e05b9bbac0865390d0e6be02bc005fcb6145af4532
7
+ data.tar.gz: 1b06b1c55b8817b7be7d6a284026444030b13039cec74112c5f46f87f075013126b85c25bf2ef25883da460b0f86457a80c48287d60757be29c88c594a85b6cf
@@ -47,31 +47,16 @@ module Workarea
47
47
  packaging.packages,
48
48
  {
49
49
  ground: is_ground,
50
- special_region: is_special_region?,
51
- free_shipping: is_free_ship
50
+ special_region: is_special_region?
52
51
  }
53
52
  )
54
53
  shipping_options = response.rates.sort_by(&:price).map do |rate|
55
54
  ShippingOption.from_rate_estimate(rate)
56
55
  end
57
56
 
58
- shipping_options.unshift(get_free_shipping) if is_free_ship
59
57
  shipping_options
60
58
  end
61
59
 
62
-
63
- # Free shipping option.
64
- def get_free_shipping
65
- ShippingOption.new(
66
- carrier: "Free Shipping",
67
- name: "Valken Economy",
68
- sub_name: "5 - 9 Business Days",
69
- service_code: "Free",
70
- price: Money.new(0.0, Money.default_currency.to_s),
71
- tax_code: "TAX01"
72
- )
73
- end
74
-
75
60
  def is_ground
76
61
  ground_ship_attribute = Workarea.config.shipping_attributes[:ground_shipping_only]
77
62
  product_carrier_type = product_details.map{ |item| item[:en][ground_ship_attribute] }.flatten
@@ -82,27 +67,6 @@ module Workarea
82
67
  Workarea.config.special_region.include?(@shipping.address.region)
83
68
  end
84
69
 
85
- # if any of the product is NO FREE SHIPPING = TRUE then return false
86
- # if free shipping config is then return true
87
- # if user applies free shipping promo code then return true
88
- def is_free_ship
89
- free_ship_attribute = Workarea.config.shipping_attributes[:no_free_shipping]
90
- product_carrier_type = product_details.map{ |item| item[:en][free_ship_attribute] }.flatten
91
- return false if product_carrier_type.include?("true")
92
-
93
- return true if Workarea.config.show_free_shipping
94
-
95
- test_order = order.clone
96
- test_shipping = shipping.clone
97
- test_shipping.apply_shipping_service(get_free_shipping.to_h)
98
-
99
- price_adjustments = Pricing.find_shipping_discounts(
100
- test_order,
101
- test_shipping
102
- )
103
- return price_adjustments.present? && price_adjustments.any?
104
- end
105
-
106
70
  def product_details
107
71
  # product_attributes = @order.items.map(&:product_attributes)
108
72
 
@@ -61,13 +61,14 @@
61
61
  %td= text_field_tag "rates[#{rate.id}][tier_weight_max]", rate.tier_weight_max, class: 'text-box'
62
62
  %td= text_field_tag "rates[#{rate.id}][tier_min]", rate.tier_min, class: 'text-box'
63
63
  %td= text_field_tag "rates[#{rate.id}][tier_max]", rate.tier_max, class: 'text-box'
64
- %td= check_box_tag 'rates_to_remove[]', rate.id
64
+ %td= check_box_tag 'rates_to_remove[]', rate.id, false, id: nil
65
+
65
66
  %tr{ data: { cloneable_row: '' } }
66
67
  %td= text_field_tag 'new_rates[][price]', '', placeholder: 'New Price Tier', class: 'text-box'
67
68
  %td= text_field_tag 'new_rates[][tier_weight_min]', '', placeholder: 'Min Weight Value', class: 'text-box'
68
69
  %td= text_field_tag 'new_rates[][tier_weight_max]', '', placeholder: 'Max Weight Value', class: 'text-box'
69
70
  %td= text_field_tag 'new_rates[][tier_min]', '', placeholder: 'Min Value', class: 'text-box'
70
- %td= text_field_tag 'new_rates[][tier_min]', '', placeholder: 'Min Value', class: 'text-box'
71
+ %td= text_field_tag 'new_rates[][tier_max]', '', placeholder: 'Min Value', class: 'text-box'
71
72
  %td
72
73
 
73
74
  .workflow-bar
@@ -4,7 +4,9 @@ module ActiveShipping
4
4
  class VALKEN < UPS
5
5
 
6
6
  def find_rates(origin, destination, packages, options = {})
7
- return get_workarea_rates(origin, destination, packages, options) if options[:ground]
7
+ if options[:ground] || (::Workarea.config.default_shipping)
8
+ return get_workarea_services(origin, destination, packages, options)
9
+ end
8
10
  super
9
11
  end
10
12
 
@@ -34,7 +36,8 @@ module ActiveShipping
34
36
  end
35
37
 
36
38
  workarea_rates = get_workarea_services(origin, destination, packages, options).rates
37
- if message == "Failure: Maximum number of packages exceeded (200)"
39
+
40
+ if message.include?("Failure: Maximum number of packages exceeded")
38
41
  RateResponse.new(true, "Only workarea shipping service", {}, rates: workarea_rates, xml: "", request: "")
39
42
  else
40
43
  RateResponse.new(success, message, Hash.from_xml(response).values.first, rates:(filtered_rates + workarea_rates).flatten, xml: response, request: last_request)
@@ -1,5 +1,5 @@
1
1
  module Valken
2
2
  module Shipping
3
- VERSION = '3.0.3.pre'.freeze
3
+ VERSION = '3.0.3'.freeze
4
4
  end
5
5
  end
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: 3.0.3.pre
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sushmitha02
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-03 00:00:00.000000000 Z
11
+ date: 2021-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.4
19
+ version: '5.2'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 5.2.4.2
22
+ version: 5.2.4.5
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 5.2.4
29
+ version: '5.2'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 5.2.4.2
32
+ version: 5.2.4.5
33
33
  description: Choosing multiple carrier shipping options
34
34
  email:
35
35
  - sushmitha.h@trikatechnologies.com
@@ -76,9 +76,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">"
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: 1.3.1
81
+ version: '0'
82
82
  requirements: []
83
83
  rubygems_version: 3.0.3
84
84
  signing_key: