Displaying 2 results from an estimated 2 matches for "amount_#".
Did you mean:
amount_1
2012 Sep 01
4
Basic Paypal
...d::Base
def paypal_url(return_url)
values = {
:business => '''',
:cmd => ''_cart'',
:upload => 1,
:return => return_url,
:invoice => id
}
line_items.each_with_index do |item, index|
values.merge!({
"amount_#{index+1}" => 500,
"item_name_#{index+1}" => car,
"item_number_#{index+1}" => 5,
"quantity_#{index+1}" => 1
})
end
"https://www.sandbox.paypal.com/cgi-bin/webscr?" + values.to_query
end
end
it is unable to identi...
2007 Jul 04
5
stack level too deep
...This is the method that is being called :
def redirect_to_paypal
create_order
more_options = Hash.new
x = 1
@order.line_items.each do |item|
more_options["item_name_#{x}"] = item.product.title # this is
the line that is causing the error
more_options["amount_#{x}"] = item.product.price
more_options["quantity_#{x}"] = item.quantity
x += 1
end
@html = render_to_string( :partial => "switch_to_paypal", :object
=> @order, :locals => { :more_options => more_options } )
end
Can someone figure out wh...