johnnybutler7
2011-Nov-22 13:23 UTC
redirect_to paypal with encrypted attributes via controller
Hi, I have a form below which submits fine to paypal with the encrypted parameters, <%= form_tag APP_CONFIG[:paypal_url] do %> <%= hidden_field_tag :cmd, "_s-xclick" %> <%= hidden_field_tag :encrypted, @order.paypal_encrypted %> <p><%= submit_tag "Checkout with Paypal" %></p> <% end %> If I try to send the form direct from the controller it doesnt work, ive tried various combinations, see below: redirect_to("https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_s- xclick&encrypted=" + @order.paypal_encrypted) and redirect_to URI.encode("https://www.sandbox.paypal.com/cgi-bin/webscr? cmd=_s-xclick&encrypted=" + @order.paypal_encrypted) Is this even possible and anyone know whats the best way to do it? JB -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling
2011-Nov-22 13:38 UTC
Re: redirect_to paypal with encrypted attributes via controller
On 22 November 2011 13:23, johnnybutler7 <johnnybutler7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a form below which submits fine to paypal with the encrypted > parameters, > > If I try to send the form direct from the controller it doesnt work, > ive tried various combinations, see below:You would probably need to make your redirects into POSTs somehow, not GETs. http://stackoverflow.com/questions/985596/redirect-to-using-post-in-rails -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
johnnybutler7
2011-Nov-22 14:38 UTC
Re: redirect_to paypal with encrypted attributes via controller
Thanks for the reply, i had looked at this option as an alternative and will press ahead. Its very unlikely a user will have js disabled but if they do then i can show the form and then let them post manually. cheers, JB On Nov 22, 1:38 pm, Michael Pavling <pavl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 22 November 2011 13:23, johnnybutler7 <johnnybutl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I have a form below which submits fine to paypal with the encrypted > > parameters, > > > If I try to send the form direct from the controller it doesnt work, > > ive tried various combinations, see below: > > You would probably need to make your redirects into POSTs somehow, not GETs. > > http://stackoverflow.com/questions/985596/redirect-to-using-post-in-r...-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.