I'm trying to create an ultra simple paypal custom integration with rails. I'm following Ryan Bates Railscast #141 on this subject and I've simplified it even further. If you have experience with super simple paypal integration, any advice would be appreciated!
I'm attempting to pass everything through my account model. A proof-of-concept.
def paypal_url(return_url)
values = {
:business => '[email protected]',
:cmd => '_cart',
:upload => 1,
:return => return_url,
:invoice => 2,
:amount => 7,
:item_name => 'Membership',
:item_number => 1,
:quantity => 1
}
"https://www.sandbox.paypal.com/cgi-bin/webscr?" + values.to_query
end
and of course I create a link:
<%= link_to "Checkout", @account.paypal_url(accounts_path) %>
The Paypal detects an error: "Your shopping cart is empty", which is strange because I can see everything my model passes in the URL:
https://www.sandbox.paypal.com/cgi-bin/webscr?amount=7&[email protected]&cmd=_cart&invoice=&item_name=Barcoden+Membership&item_number=1&quantity=1&return=/accounts&upload=1