caboose-cms 0.5.209 → 0.5.210

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmYwOGNkY2QyNDllNDhhZGNiNjdlOWIyOGRhODU2MWI2NTQ2ZDA4YQ==
4
+ NGFkYzFmNDk4NWRjNjlmYTM5OGQ0ZjA3NjJjODdiNGMzYjAwODA3NQ==
5
5
  data.tar.gz: !binary |-
6
- MmY5OTU3YmQxYTRiZGZjNzk4Mjc4ZmE1ZGRhOTg0ZWQ5ZjU1MzE4ZQ==
6
+ NGQ4OGU0ZGVlMDYxODM2NTFjMTRkYTBiZWU4Y2E4NTIxZjRhYzc4Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTE4NjMzOTM3ZjdhNWRkN2NhZWVhYzFjM2RjMmUwNWEzYzU3OWMwMDI4NmUw
10
- ZGJkYzRjNWZmOGI0NGRmNjQ5NmRjNzBmNGE5ZDlkYjk5MzYyN2EwZDg1ZGNl
11
- NTI0OWFkNWEyOTYxZjhmYzQ1YTE4YjNiMzY4MTA1NzYwYmIxMzg=
9
+ MWE1YmRhOWUzODMyNDA3ODNmM2M4OTAzYmE5MzJkM2NmNjllNWQ3OTAwOGY1
10
+ YTBjYWI2NDk3YzE3ZDhjMjcxZGM4NmNlYTk1ZmE1OGM0NjA1NjEyMmMzYzhh
11
+ YmE0ZTE2NjU5ZDdkMzdlZWRmNDI5NDZmNDVmZmM0Mzc3NzIxODQ=
12
12
  data.tar.gz: !binary |-
13
- OWRjNjk1M2U3NmRkZjg1MmEwZTFmYjY4OGRhYTEwZGM5ZThjYzM3M2U5ZmYy
14
- OWQwNWE3N2ZjYWIzYjBiYjNhZWZiOWFjM2JhZTgwODJlOGE3MWEyYWI3NmUx
15
- ZTY2OGZlNzNlMTI5YTg0ZWZkMTk4YWE4NmUwMjRiYzMyYWM4MWU=
13
+ MWRjODBlN2Y3ZjYzYTkxOGQ2ZmMwMTdiYjY4ODg5YzU2MjA4YzIzZjUzYzA1
14
+ NzM1YTMwNDc4OGU5OGM5YWUwMzc3ZDc2YWVhZThkNjRhNjc5YTAzZjM4YzYx
15
+ ODZmNTc0OTNjNGVjMmEwMzFhODMzMTQ1MDdlMTUzYmNhNWYwMWE=
@@ -126,7 +126,7 @@ module Caboose
126
126
  dimensions[2] = dimensions[0] / 2.54
127
127
  end
128
128
 
129
- return Package.new(weight, dimensions, :units => :imperial)
129
+ return ActiveShipping::Package.new(weight, dimensions, :units => :imperial)
130
130
  end
131
131
 
132
132
  end
@@ -3,7 +3,7 @@ require 'active_shipping'
3
3
 
4
4
  module Caboose
5
5
  class ShippingCalculator
6
-
6
+
7
7
  def self.custom_rates(store_config, order)
8
8
  return eval(store_config.custom_shipping_function)
9
9
  end
@@ -81,12 +81,12 @@ module Caboose
81
81
  order = op.order
82
82
  sc = order.site.store_config
83
83
  sa = order.shipping_address
84
- origin = Location.new(:country => sc.origin_country, :state => sc.origin_state, :city => sc.origin_city, :zip => sc.origin_zip)
85
- destination = Location.new(:country => sc.origin_country, :state => sa.state, :city => sa.city, :postal_code => sa.zip)
84
+ origin = ActiveShipping::Location.new(:country => sc.origin_country, :state => sc.origin_state, :city => sc.origin_city, :zip => sc.origin_zip)
85
+ destination = ActiveShipping::Location.new(:country => sc.origin_country, :state => sa.state, :city => sa.city, :postal_code => sa.zip)
86
86
  carriers = {}
87
- carriers['UPS'] = UPS.new( :login => sc.ups_username, :password => sc.ups_password, :key => sc.ups_key, :origin_account => sc.ups_origin_account) if sc.ups_username && sc.ups_username.strip.length > 0
88
- carriers['USPS'] = USPS.new( :login => sc.usps_username) if sc.usps_username && sc.usps_username.strip.length > 0
89
- carriers['FedEx'] = FedEx.new(:login => sc.fedex_username, :password => sc.fedex_password, :key => sc.fedex_key, :account => sc.fedex_account) if sc.fedex_username && sc.fedex_username.strip.length > 0
87
+ carriers['UPS'] = ActiveShipping::UPS.new( :login => sc.ups_username, :password => sc.ups_password, :key => sc.ups_key, :origin_account => sc.ups_origin_account) if sc.ups_username && sc.ups_username.strip.length > 0
88
+ carriers['USPS'] = ActiveShipping::USPS.new( :login => sc.usps_username) if sc.usps_username && sc.usps_username.strip.length > 0
89
+ carriers['FedEx'] = ActiveShipping::FedEx.new(:login => sc.fedex_username, :password => sc.fedex_password, :key => sc.fedex_key, :account => sc.fedex_account) if sc.fedex_username && sc.fedex_username.strip.length > 0
90
90
 
91
91
  sp = op.shipping_package
92
92
  package = op.activemerchant_package
@@ -115,22 +115,22 @@ module Caboose
115
115
  order = op.order
116
116
  sc = order.site.store_config
117
117
  sa = order.shipping_address
118
- origin = Location.new(:country => sc.origin_country, :state => sc.origin_state, :city => sc.origin_city, :zip => sc.origin_zip)
119
- destination = Location.new(:country => sc.origin_country, :state => sa.state, :city => sa.city, :postal_code => sa.zip)
118
+ origin = ActiveShipping::Location.new(:country => sc.origin_country, :state => sc.origin_state, :city => sc.origin_city, :zip => sc.origin_zip)
119
+ destination = ActiveShipping::Location.new(:country => sc.origin_country, :state => sa.state, :city => sa.city, :postal_code => sa.zip)
120
120
 
121
121
  carrier = case op.shipping_method.carrier
122
- when 'UPS' then UPS.new( :login => sc.ups_username, :password => sc.ups_password, :key => sc.ups_key, :origin_account => sc.ups_origin_account)
123
- when 'USPS' then USPS.new( :login => sc.usps_username)
124
- when 'FedEx' then FedEx.new(:login => sc.fedex_username, :password => sc.fedex_password, :key => sc.fedex_key, :account => sc.fedex_account)
122
+ when 'UPS' then ActiveShipping::UPS.new( :login => sc.ups_username, :password => sc.ups_password, :key => sc.ups_key, :origin_account => sc.ups_origin_account)
123
+ when 'USPS' then ActiveShipping::USPS.new( :login => sc.usps_username)
124
+ when 'FedEx' then ActiveShipping::FedEx.new(:login => sc.fedex_username, :password => sc.fedex_password, :key => sc.fedex_key, :account => sc.fedex_account)
125
125
  end
126
126
 
127
- Caboose.log(op.shipping_method.inspect)
127
+ #Caboose.log(op.shipping_method.inspect)
128
128
 
129
129
  sm = op.shipping_method
130
130
  package = op.activemerchant_package
131
131
  resp = carrier.find_rates(origin, destination, package)
132
132
  resp.rates.sort_by(&:price).each do |rate|
133
- Caboose.log("rate.service_code = #{rate.service_code}, rate.service_name = #{rate.service_name}")
133
+ #Caboose.log("rate.service_code = #{rate.service_code}, rate.service_name = #{rate.service_name}")
134
134
  sm2 = ShippingMethod.where( :carrier => sm.carrier, :service_code => rate.service_code, :service_name => rate.service_name).first
135
135
  sm2 = ShippingMethod.create(:carrier => sm.carrier, :service_code => rate.service_code, :service_name => rate.service_name) if sm2.nil?
136
136
  if sm2.id == sm.id
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.209'
2
+ VERSION = '0.5.210'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.209
4
+ version: 0.5.210
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry