Fixed a bug where credits being nil would throw an error.
This commit is contained in:
parent
1cc9da2d68
commit
7b43b73f58
|
@ -237,8 +237,12 @@ module Spree::PaypalExpress
|
||||||
:amount => (credit.amount*100).to_i }
|
:amount => (credit.amount*100).to_i }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
credits_total = 0
|
||||||
|
if credits.respond_to? :compact
|
||||||
items.concat credits.compact!
|
items.concat credits.compact!
|
||||||
credits_total = credits.map {|i| i[:amount] * i[:qty] }.sum
|
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