I am integrating my rails website with paypal. It seems that paypal wants me to make a POST to their website with the shopping cart details. This won''t work: post :website_name, :variables => {:varA => "blah, :varB => "blah"} I checked around google, but having trouble finding this one. Do I have to use "Net::HTTP" or something? - Steve --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
SenorCastro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Oct-09 19:51 UTC
Re: How do you POST to another website?
http = Net::HTTP.new(''www.paypal.com'' headers, response = http.post(post_page, post_parans) puts response You can also pass a hash of headers to the post/get methods. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 10/10/06, SenorCastro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <SenorCastro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > http = Net::HTTP.new(''www.paypal.com'' > headers, response = http.post(post_page, post_parans) > puts response > > You can also pass a hash of headers to the post/get methods.What i normally do in that case, is create a hidden form, populate the params parameter and post it to other website. Works great. -- There was only one Road; that it was like a great river: its springs were at every doorstep, and every path was its tributary. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
> I am integrating my rails website with paypal. It seems that paypal > wants me to make a POST to their website with the shopping cart > details. This won''t work: > post :website_name, :variables => {:varA => "blah, :varB => "blah"} > > I checked around google, but having trouble finding this one. Do I > have > to use "Net::HTTP" or something?You may find yesterday''s thread entitled ''Posting over https'' on Ruby Talk helpful. http://groups.google.com/group/ruby-talk-google/browse_thread/thread/ c712d0b123c61274 Regards, Andy Stewart --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On Oct 9, 2006, at 8:16 PM, hemant wrote:> > On 10/10/06, SenorCastro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <SenorCastro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> http = Net::HTTP.new(''www.paypal.com'' >> headers, response = http.post(post_page, post_parans) >> puts response >> >> You can also pass a hash of headers to the post/get methods. > > What i normally do in that case, is create a hidden form, populate the > params parameter and post it to other website. Works great. >This method works very well. I use it, and it''s described in my Rails e-commerce book: http://www.agilewebdevelopment.com/rails-ecommerce :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---