caboose-store 0.0.35 → 0.0.36

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
- MjI4Zjc2ZWUzNzFkMDUzZDVlNTNmODk5NDNjYTY1NzhhMmFiZGFlZA==
4
+ MTU2YzBkNGJlOTQ1NmM1OTkwYTExNmQ5ZDNlOWEyY2IwYzUwMmNmYg==
5
5
  data.tar.gz: !binary |-
6
- ZTRmOGFmODVhODY5YzgzNmNjOWE1NzRmY2Y2ZDJjNmNkYmUxMWQ2Yw==
6
+ NzUwNTdhOTEzMzIxYzMyNzUzNzBkYWFkOWU1ZTYyODI0NGMzNDkyMA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTA2YWRkNTQ2ZjNiNTI4ODM3MTgxN2MzZTMzNGMxNzhkZDI1ZGI0ZGRhMDJk
10
- NDY3NjcwMWY4ZmMwM2JmOGU3YTUwNTQ4OThjNzkyMGNhYzI4OGIwMDYyNTdk
11
- MzQzOWYxYzAzNWFlMjk0ZDYwZjI1YjcwN2YxNDQxZTliY2YwODI=
9
+ MmQ4ZTIzNTE0YjJiMzBmMjgxNGY4NTA2NTM4MjBmNzYzNzc3NDQxYmI2ZTI5
10
+ YTg5NDg1YTg2MWMxODY2ZTk2NGJmOTRiYTIyZDExNWZiMWZkNDI2ODhjNmE0
11
+ Zjc4ZDVkYWRjYzQyMWI0MDZhYWFlNmExNDEwMmJmM2JiZWY2ZDA=
12
12
  data.tar.gz: !binary |-
13
- YjczYmIzM2M1Y2IzOTFjMTVkZDcxNTk2NTFlMGFiMjc4Y2YwYjBkYzk2YjMy
14
- Y2U5ZmUyMDQ0ZmQ0N2M4ZGY5YWFiOWNhYjE3OWM4MTlkOTg4MjIxZjAyOWE3
15
- ODVlY2FhZDllOGJjODM4MDI2NmRmNzg5ZmUyODE2NTE1YmU4OWU=
13
+ OGM5Y2ExMDFmYTU2YmU0ODE5ZTY3OTNmZmM5YzM5YWNhMjc3MWJhZmNjY2U1
14
+ OWE3YTdlYTJlY2VhODM3MGYyY2Y4MTgyMzczMmZjNjg4YjNjZDJhNGE0Y2Ex
15
+ NjExNWEyMDJhZWI5NGVmZTM3OTFiZGUxZTRiNjlmZGE2MmIzN2U=
@@ -166,7 +166,7 @@ Caboose.Store.Modules.Checkout = (function() {
166
166
  $.ajax({
167
167
  url: '/checkout/shipping',
168
168
  type: 'put',
169
- data: { shipping_code: event.target.value },
169
+ data: { shipping_method_code: event.target.value },
170
170
  success: function(response) {
171
171
  if (response.success) {
172
172
  self.order = response.order;
@@ -192,7 +192,7 @@ Caboose.Store.Modules.Checkout = (function() {
192
192
  self.paymentSubmitHandler = function(event) {
193
193
  event.preventDefault();
194
194
 
195
- if (!self.order.shipping_code) {
195
+ if (!self.order.shipping_method_code) {
196
196
  alert('Please choose a shipping method');
197
197
  } else {
198
198
  self.$checkout.off('submit', '#checkout-payment form#payment').addClass('loading');
@@ -17,8 +17,8 @@ Caboose.Store.Modules.CheckoutStep3 = (function() {
17
17
  url: '/checkout/shipping',
18
18
  type: 'put',
19
19
  data: {
20
- shipping_method: $(event.target).data('shipping-method'),
21
- shipping_code: $(event.target).data('shipping-code')
20
+ shipping_method: $(event.target).data('shipping-method'),
21
+ shipping_method_code: $(event.target).data('shipping-code')
22
22
  },
23
23
  success: function(resp) {
24
24
  if (resp.errors && resp.errors.length > 0)
@@ -163,7 +163,7 @@ module CabooseStore
163
163
  # PUT /checkout/shipping
164
164
  def update_shipping
165
165
  @order.shipping_method = params[:shipping_method]
166
- @order.shipping_method_code = params[:shipping_code]
166
+ @order.shipping_method_code = params[:shipping_method_code]
167
167
  render :json => {
168
168
  :success => @order.save,
169
169
  :errors => @order.errors.full_messages
@@ -17,9 +17,9 @@ module CabooseStore
17
17
  attr_accessible :id,
18
18
  :order_number,
19
19
  :subtotal,
20
- :tax,
21
- :shipping_code,
20
+ :tax,
22
21
  :shipping_method,
22
+ :shipping_method_code,
23
23
  :shipping,
24
24
  :handling,
25
25
  :discount,
@@ -170,7 +170,7 @@ module CabooseStore
170
170
  end
171
171
 
172
172
  def calculate_shipping
173
- return 0 if !self.shipping_address || !self.shipping_code
173
+ return 0 if !self.shipping_address || !self.shipping_method_code
174
174
  ShippingCalculator.rate(self)[:total_price]
175
175
  end
176
176
 
@@ -101,7 +101,8 @@ class CabooseStore::Schema < Caboose::Utilities::Schema
101
101
  [ :referring_site , :text ],
102
102
  [ :landing_page , :string ],
103
103
  [ :landing_page_ref , :string ],
104
- [ :shipping_code , :string ],
104
+ [ :shipping_method , :string ],
105
+ [ :shipping_method_code , :string ],
105
106
  [ :transaction_id , :string ],
106
107
  [ :auth_code , :string ],
107
108
  [ :alternate_id , :integer ],
@@ -58,7 +58,7 @@ module CabooseStore
58
58
  ups_response = ups.find_rates(origin, destination, packages)
59
59
 
60
60
  rates = ups_response.rates.collect do |rate|
61
- next if CabooseStore::allowed_shipping_codes && !CabooseStore::allowed_shipping_codes.index(rate.service_code)
61
+ next if CabooseStore::allowed_shipping_method_codes && !CabooseStore::allowed_shipping_method_codes.index(rate.service_code)
62
62
 
63
63
  {
64
64
  :service_code => rate.service_code,
@@ -72,8 +72,8 @@ module CabooseStore
72
72
  end
73
73
 
74
74
  def self.rate(order)
75
- return nil if !order.shipping_code
76
- self.rates(order).each { |rate| return rate if rate[:service_code] == order.shipping_code }
75
+ return nil if !order.shipping_method_code
76
+ self.rates(order).each { |rate| return rate if rate[:service_code] == order.shipping_method_code }
77
77
  return nil
78
78
  end
79
79
  end
data/lib/caboose-store.rb CHANGED
@@ -14,7 +14,7 @@ module CabooseStore
14
14
  :authorize_net_login_id,
15
15
  :authorize_net_transaction_key,
16
16
  :handling_percentage,
17
- :allowed_shipping_codes,
18
- :default_shipping_code
17
+ :allowed_shipping_method_codes,
18
+ :default_shipping_method_code
19
19
  end
20
20
 
@@ -80,7 +80,7 @@ module CabooseStore::BootStrapper
80
80
  :landing_page_ref => params[:ref] || nil
81
81
  )
82
82
 
83
- order.update_attribute(:shipping_code, CabooseStore::default_shipping_code) if CabooseStore::default_shipping_code
83
+ order.update_attribute(:shipping_method_code, CabooseStore::default_shipping_method_code) if CabooseStore::default_shipping_method_code
84
84
 
85
85
  # Define the cart ID
86
86
  session[:cart_id] = order.id
@@ -1,3 +1,3 @@
1
1
  module CabooseStore
2
- VERSION = '0.0.35'
2
+ VERSION = '0.0.36'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.35
4
+ version: 0.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry