I am trying to create an extremely simple Paypal user integration with rails. I am following Ryan Bates Railscast # 141 on this, and I have simplified it even further. If you have experience with simple, easy integration with PayPal, any advice would be appreciated!
I am trying to transfer everything through my account model. Proof of concept.
def paypal_url(return_url)
values = {
:business => 'jwade_1268181180_biz@gmail.com',
: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, create a link:
<%= link_to "Checkout", @account.paypal_url(accounts_path) %>
Paypal detects an error: " Your shopping cart is empty ", which is strange because I see everything that my model sends in the URL:
https://www.sandbox.paypal.com/cgi-bin/webscr?amount=7&business=jwade_1268181180_biz@gmail.com&cmd=_cart&invoice=&item_name=Barcoden+Membership&item_number=1&quantity=1&return=/accounts&upload=1
source
share