I have situation like this:
- user submits form with
action='/pay' - in ‘/pay’ I have to add some additional parameters and send post request to
www.paymentprovider.com/new_payment
The problem is that I want to post and redirect (at the same time) user to this new website www.paymentprovider.com/new_payment. Currently I am using
Net::HTTP.post_form
Do you know any ways to achieve this?
You cannot do a post and redirect without breaking the internet. 🙂
If you want to use this workflow, you will need to proxy the request.
As an example:
Since this is all happening locally, the option above would seem to be a waste. If /pay is simply missing some parameters and info could you simply supply them in your view? This way you could have both /pay and /new_payment postback to the same location and use two separate views to handle the initial get request.