Previous commit was defective, credits_total would not have been calculated if a nil didn't exist in a valid credits array.
This commit is contained in:
parent
8800abf9bb
commit
c82156ef67
|
@ -239,10 +239,11 @@ module Spree::PaypalExpress
|
||||||
end
|
end
|
||||||
|
|
||||||
credits_total = 0
|
credits_total = 0
|
||||||
if credits.compact!
|
credits.compact!
|
||||||
items.concat credits
|
if !credits.empty?
|
||||||
credits_total = credits.map {|i| i[:amount] * i[:qty] }.sum
|
items.concat credits
|
||||||
end
|
credits_total = credits.map {|i| i[:amount] * i[:qty] }.sum
|
||||||
|
end
|
||||||
|
|
||||||
opts = { :return_url => request.protocol + request.host_with_port + "/orders/#{order.number}/checkout/paypal_confirm?payment_method_id=#{payment_method}",
|
opts = { :return_url => request.protocol + request.host_with_port + "/orders/#{order.number}/checkout/paypal_confirm?payment_method_id=#{payment_method}",
|
||||||
:cancel_return_url => "http://" + request.host_with_port + "/orders/#{order.number}/edit",
|
:cancel_return_url => "http://" + request.host_with_port + "/orders/#{order.number}/edit",
|
||||||
|
|
Loading…
Reference in New Issue