diff --git a/app/controllers/checkout_controller_decorator.rb b/app/controllers/checkout_controller_decorator.rb index cc78b68..b412c1c 100644 --- a/app/controllers/checkout_controller_decorator.rb +++ b/app/controllers/checkout_controller_decorator.rb @@ -150,6 +150,7 @@ CheckoutController.class_eval do #need to force checkout to complete state until @order.state == "complete" if @order.next! + @order.update! state_callback(:after) end end @@ -226,7 +227,7 @@ CheckoutController.class_eval do { :name => item.variant.product.name, :description => item.variant.product.description[0..120], :sku => item.variant.sku, - :qty => item.quantity, + :quantity => item.quantity, :amount => price, :weight => item.variant.weight, :height => item.variant.height, @@ -239,7 +240,7 @@ CheckoutController.class_eval do { :name => credit.label, :description => credit.label, :sku => credit.id, - :qty => 1, + :quantity => 1, :amount => (credit.amount*100).to_i } end end @@ -248,7 +249,7 @@ CheckoutController.class_eval do credits.compact! if credits.present? items.concat credits - credits_total = credits.map {|i| i[:amount] * i[:qty] }.sum + credits_total = credits.map {|i| i[:amount] * i[:quantity] }.sum end opts = { :return_url => request.protocol + request.host_with_port + "/orders/#{order.number}/checkout/paypal_confirm?payment_method_id=#{payment_method}",