What''s the cleanest way to do this? With Net::HTTP? I have a form that''s sent to a controller and validated. If its valid I''d like to send the user on (along with the info they''ve entered) to an external site to process payment. Thanks, Dave
If you''re sending them along, isn''t that a redirect, not a POST? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20110629/7285a32b/attachment.html>
Can I send POST data along with a redirect? Dave On Wed, Jun 29, 2011 at 3:44 PM, Steve Klabnik <steve at steveklabnik.com> wrote:> If you''re sending them along, isn''t that a redirect, not a POST? > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Dave
No, redirects are an HTTP response, they''re not a new request. Can you give a more concrete example? Your explanation sounds like you''re trying to do two different things, and I''m not sure which you mean. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20110629/3859b826/attachment.html>
To illuminate the difference: User goes to website, webserver asks camping "What should I tell this guy?" camping goes to other website using Net::HTTP, talks to other website a bit, then hangs up and goes back to the web server who asked that question and says...? If you want the user to send a post request to another page, that''s a bit tricky. Probably the best way to do it is to send them back a <form> with some <input type=hidden name=thing value=blah> type elements in it, then a little <script> which says: <script> document.forms[0].submit(); </script> at the end of the page. You should probably also include a submit button in the form for people with javascript turned off. On 30/06/2011, at 4:46 AM, David Susco wrote:> What''s the cleanest way to do this? With Net::HTTP? I have a form > that''s sent to a controller and validated. If its valid I''d like to > send the user on (along with the info they''ve entered) to an external > site to process payment. > > Thanks, > Dave > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
Ideally I''d like a user to be able to submit a form to the camping app, having camping do all the validation and some preprocessing and then have the camping app send the user to an external site (with the post data) where the user can complete a payment. Dave On Wed, Jun 29, 2011 at 5:00 PM, Steve Klabnik <steve at steveklabnik.com> wrote:> No, redirects are an HTTP response, they''re not a new request. > Can you give a more concrete example? Your explanation sounds like you''re > trying to do two different things, and I''m not sure which you mean. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Dave
Can you tell us what payment processing system you''re trying to work with? Is it PayPal or Google Checkout? Bitcoin? ;-) On Thu, Jun 30, 2011 at 6:48 AM, David Susco <dsusco at gmail.com> wrote:> Ideally I''d like a user to be able to submit a form to the camping > app, having camping do all the validation and some preprocessing and > then have the camping app send the user to an external site (with the > post data) where the user can complete a payment. > > Dave > > On Wed, Jun 29, 2011 at 5:00 PM, Steve Klabnik <steve at steveklabnik.com> > wrote: > > No, redirects are an HTTP response, they''re not a new request. > > Can you give a more concrete example? Your explanation sounds like you''re > > trying to do two different things, and I''m not sure which you mean. > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > > > > -- > Dave > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20110702/13164961/attachment-0001.html>
None of those, I''m in education, and we have to go through Sallie Mae. Dave On Sun, Jul 3, 2011 at 1:16 AM, John Beppu <john.beppu at gmail.com> wrote:> Can you tell us what payment processing system you''re trying to work with? > Is it PayPal or Google Checkout? > Bitcoin? ?;-) > > On Thu, Jun 30, 2011 at 6:48 AM, David Susco <dsusco at gmail.com> wrote: >> >> Ideally I''d like a user to be able to submit a form to the camping >> app, having camping do all the validation and some preprocessing and >> then have the camping app send the user to an external site (with the >> post data) where the user can complete a payment. >> >> Dave >> >> On Wed, Jun 29, 2011 at 5:00 PM, Steve Klabnik <steve at steveklabnik.com> >> wrote: >> > No, redirects are an HTTP response, they''re not a new request. >> > Can you give a more concrete example? Your explanation sounds like >> > you''re >> > trying to do two different things, and I''m not sure which you mean. >> > _______________________________________________ >> > Camping-list mailing list >> > Camping-list at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/camping-list >> > >> >> >> >> -- >> Dave >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Dave
Does Sallie Mae provide a payment processing API? I searched for it, but I couldn''t find anything. On Sun, Jul 3, 2011 at 4:46 AM, David Susco <dsusco at gmail.com> wrote:> None of those, I''m in education, and we have to go through Sallie Mae. > > Dave > > On Sun, Jul 3, 2011 at 1:16 AM, John Beppu <john.beppu at gmail.com> wrote: > > Can you tell us what payment processing system you''re trying to work > with? > > Is it PayPal or Google Checkout? > > Bitcoin? ;-) > > > > On Thu, Jun 30, 2011 at 6:48 AM, David Susco <dsusco at gmail.com> wrote: > >> > >> Ideally I''d like a user to be able to submit a form to the camping > >> app, having camping do all the validation and some preprocessing and > >> then have the camping app send the user to an external site (with the > >> post data) where the user can complete a payment. > >> > >> Dave > >> > >> On Wed, Jun 29, 2011 at 5:00 PM, Steve Klabnik <steve at steveklabnik.com> > >> wrote: > >> > No, redirects are an HTTP response, they''re not a new request. > >> > Can you give a more concrete example? Your explanation sounds like > >> > you''re > >> > trying to do two different things, and I''m not sure which you mean. > >> > _______________________________________________ > >> > Camping-list mailing list > >> > Camping-list at rubyforge.org > >> > http://rubyforge.org/mailman/listinfo/camping-list > >> > > >> > >> > >> > >> -- > >> Dave > >> _______________________________________________ > >> Camping-list mailing list > >> Camping-list at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/camping-list > > > > > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > > > > -- > Dave > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20110703/20f06d72/attachment.html>
They do not, pretty much they need a few input tags and that''s about it. I''m just looking to do my form validation/preparation server-side instead of client-side. Dave On Sun, Jul 3, 2011 at 9:35 PM, John Beppu <john.beppu at gmail.com> wrote:> Does Sallie Mae provide a payment processing API? ?I searched for it, but I > couldn''t find anything. > > On Sun, Jul 3, 2011 at 4:46 AM, David Susco <dsusco at gmail.com> wrote: >> >> None of those, I''m in education, and we have to go through Sallie Mae. >> >> Dave >> >> On Sun, Jul 3, 2011 at 1:16 AM, John Beppu <john.beppu at gmail.com> wrote: >> > Can you tell us what payment processing system you''re trying to work >> > with? >> > Is it PayPal or Google Checkout? >> > Bitcoin? ?;-) >> > >> > On Thu, Jun 30, 2011 at 6:48 AM, David Susco <dsusco at gmail.com> wrote: >> >> >> >> Ideally I''d like a user to be able to submit a form to the camping >> >> app, having camping do all the validation and some preprocessing and >> >> then have the camping app send the user to an external site (with the >> >> post data) where the user can complete a payment. >> >> >> >> Dave >> >> >> >> On Wed, Jun 29, 2011 at 5:00 PM, Steve Klabnik <steve at steveklabnik.com> >> >> wrote: >> >> > No, redirects are an HTTP response, they''re not a new request. >> >> > Can you give a more concrete example? Your explanation sounds like >> >> > you''re >> >> > trying to do two different things, and I''m not sure which you mean. >> >> > _______________________________________________ >> >> > Camping-list mailing list >> >> > Camping-list at rubyforge.org >> >> > http://rubyforge.org/mailman/listinfo/camping-list >> >> > >> >> >> >> >> >> >> >> -- >> >> Dave >> >> _______________________________________________ >> >> Camping-list mailing list >> >> Camping-list at rubyforge.org >> >> http://rubyforge.org/mailman/listinfo/camping-list >> > >> > >> > _______________________________________________ >> > Camping-list mailing list >> > Camping-list at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/camping-list >> > >> >> >> >> -- >> Dave >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Dave
I have a bad feeling about whatever you''re trying to do. However, I want to make sure that my interpretation of your intent is correct. 1. It sounds like you want to create a web app that provides a form. 2. When this form is submitted (and assuming the data is valid), you want to POST this data to a URL at https://www.salliemae.com/. 3. Then, it sounds like you want to send a redirect so that the user of your webapp ends up at an appropriate page at https://www.salliemae.com/(possibly with a prefilled form courtesy of your work). If this is the case, you have a big problem -- salliemae.com login info is needed in too many places. Step 2 (which happens on the server side) needs the user''s Sallie Mae login credentials in order to perform a successful POST, and that''s unwise to give out. Your users should never have to trust you with their Sallie Mae username and password. That should be private information, never to be given out to 3rd parties (including you). Step 3 also requires that the user''s browser already be logged in to salliemae.com or the redirect wouldn''t work. I have the feeling that you''re trying to simplify a person''s user experience by prefilling a cumbersome form, but your strategy for doing this may be flawed. --beppu On Sun, Jul 3, 2011 at 8:06 PM, David Susco <dsusco at gmail.com> wrote:> They do not, pretty much they need a few input tags and that''s about > it. I''m just looking to do my form validation/preparation server-side > instead of client-side. > > Dave > > On Sun, Jul 3, 2011 at 9:35 PM, John Beppu <john.beppu at gmail.com> wrote: > > Does Sallie Mae provide a payment processing API? I searched for it, but > I > > couldn''t find anything. > > > > On Sun, Jul 3, 2011 at 4:46 AM, David Susco <dsusco at gmail.com> wrote: > >> > >> None of those, I''m in education, and we have to go through Sallie Mae. > >> > >> Dave > >> > >> On Sun, Jul 3, 2011 at 1:16 AM, John Beppu <john.beppu at gmail.com> > wrote: > >> > Can you tell us what payment processing system you''re trying to work > >> > with? > >> > Is it PayPal or Google Checkout? > >> > Bitcoin? ;-) > >> > > >> > On Thu, Jun 30, 2011 at 6:48 AM, David Susco <dsusco at gmail.com> > wrote: > >> >> > >> >> Ideally I''d like a user to be able to submit a form to the camping > >> >> app, having camping do all the validation and some preprocessing and > >> >> then have the camping app send the user to an external site (with the > >> >> post data) where the user can complete a payment. > >> >> > >> >> Dave > >> >> > >> >> On Wed, Jun 29, 2011 at 5:00 PM, Steve Klabnik < > steve at steveklabnik.com> > >> >> wrote: > >> >> > No, redirects are an HTTP response, they''re not a new request. > >> >> > Can you give a more concrete example? Your explanation sounds like > >> >> > you''re > >> >> > trying to do two different things, and I''m not sure which you mean. > >> >> > _______________________________________________ > >> >> > Camping-list mailing list > >> >> > Camping-list at rubyforge.org > >> >> > http://rubyforge.org/mailman/listinfo/camping-list > >> >> > > >> >> > >> >> > >> >> > >> >> -- > >> >> Dave > >> >> _______________________________________________ > >> >> Camping-list mailing list > >> >> Camping-list at rubyforge.org > >> >> http://rubyforge.org/mailman/listinfo/camping-list > >> > > >> > > >> > _______________________________________________ > >> > Camping-list mailing list > >> > Camping-list at rubyforge.org > >> > http://rubyforge.org/mailman/listinfo/camping-list > >> > > >> > >> > >> > >> -- > >> Dave > >> _______________________________________________ > >> Camping-list mailing list > >> Camping-list at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/camping-list > > > > > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > > > > -- > Dave > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20110704/f4bf7608/attachment.html>
They''re never providing login credentials, merely going to a payment gateway that has received a post request. Essentially all I''m asking is can a camping controller serve as a middle man for a post request to another url? Before I did form validation with JS client-side and then posted the info to SM. Now, I''m asking can I post the info to a camping controller, do the validation and then send the user off with another post request. If not, then I''ll have to see if I can do the validation/prep with Ajax instead of a submit, then just post directly to SM from the form. Dave On Mon, Jul 4, 2011 at 10:46 AM, John Beppu <john.beppu at gmail.com> wrote:> I have a bad feeling about whatever you''re trying to do. ?However, I want to > make sure that my interpretation of your intent is correct. > > It sounds like you want to create a web app that provides a form. > When this form is submitted (and assuming the data is valid),?you want to > POST this data to a URL at?https://www.salliemae.com/. > Then, it sounds like you want to send a redirect so that the user of your > webapp ends up at an appropriate page at https://www.salliemae.com/ > (possibly with a prefilled form courtesy of your work). > > If this is the case, you have a big problem -- salliemae.com login info is > needed in too many places. > Step 2 (which happens on the server side) needs the user''s Sallie Mae login > credentials in order to perform a successful POST, and that''s unwise to give > out. ?Your users should never have to trust you with their Sallie Mae > username and password. ?That should be private information, never to be > given out to 3rd parties (including you). > Step 3 also requires that the user''s browser already be logged in to > salliemae.com or the redirect wouldn''t work. > > I have the feeling that you''re trying to simplify a person''s user experience > by prefilling a cumbersome form, but your strategy for doing this may be > flawed. > --beppu > On Sun, Jul 3, 2011 at 8:06 PM, David Susco <dsusco at gmail.com> wrote: >> >> They do not, pretty much they need a few input tags and that''s about >> it. I''m just looking to do my form validation/preparation server-side >> instead of client-side. >> >> Dave >> >> On Sun, Jul 3, 2011 at 9:35 PM, John Beppu <john.beppu at gmail.com> wrote: >> > Does Sallie Mae provide a payment processing API? ?I searched for it, >> > but I >> > couldn''t find anything. >> > >> > On Sun, Jul 3, 2011 at 4:46 AM, David Susco <dsusco at gmail.com> wrote: >> >> >> >> None of those, I''m in education, and we have to go through Sallie Mae. >> >> >> >> Dave >> >> >> >> On Sun, Jul 3, 2011 at 1:16 AM, John Beppu <john.beppu at gmail.com> >> >> wrote: >> >> > Can you tell us what payment processing system you''re trying to work >> >> > with? >> >> > Is it PayPal or Google Checkout? >> >> > Bitcoin? ?;-) >> >> > >> >> > On Thu, Jun 30, 2011 at 6:48 AM, David Susco <dsusco at gmail.com> >> >> > wrote: >> >> >> >> >> >> Ideally I''d like a user to be able to submit a form to the camping >> >> >> app, having camping do all the validation and some preprocessing and >> >> >> then have the camping app send the user to an external site (with >> >> >> the >> >> >> post data) where the user can complete a payment. >> >> >> >> >> >> Dave >> >> >> >> >> >> On Wed, Jun 29, 2011 at 5:00 PM, Steve Klabnik >> >> >> <steve at steveklabnik.com> >> >> >> wrote: >> >> >> > No, redirects are an HTTP response, they''re not a new request. >> >> >> > Can you give a more concrete example? Your explanation sounds like >> >> >> > you''re >> >> >> > trying to do two different things, and I''m not sure which you >> >> >> > mean. >> >> >> > _______________________________________________ >> >> >> > Camping-list mailing list >> >> >> > Camping-list at rubyforge.org >> >> >> > http://rubyforge.org/mailman/listinfo/camping-list >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> Dave >> >> >> _______________________________________________ >> >> >> Camping-list mailing list >> >> >> Camping-list at rubyforge.org >> >> >> http://rubyforge.org/mailman/listinfo/camping-list >> >> > >> >> > >> >> > _______________________________________________ >> >> > Camping-list mailing list >> >> > Camping-list at rubyforge.org >> >> > http://rubyforge.org/mailman/listinfo/camping-list >> >> > >> >> >> >> >> >> >> >> -- >> >> Dave >> >> _______________________________________________ >> >> Camping-list mailing list >> >> Camping-list at rubyforge.org >> >> http://rubyforge.org/mailman/listinfo/camping-list >> > >> > >> > _______________________________________________ >> > Camping-list mailing list >> > Camping-list at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/camping-list >> > >> >> >> >> -- >> Dave >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Dave