Trying to replicate Webforms Realex solution using MVC
Hi folks,
I developed a simple enough solution on my website to take online payments via Realex. We use the redirect method, which requires us to submit approximately 10 hidden form fields to an external site (the Realex payment gateway). I developed a solution for this that basically works by me setting up the variables that I need using my button click event handler in my codebehind/.cs page, and on my aspx page, I have an <asp:button> and in the Postback declaration for this button, this is where I put the URL where my hidden data fields (approximately 10, which are done like this: <input type="hidden" name="AMOUNT" id="AMOUNT" value='<asp:Literal ID="Literal_HiddenField_AMOUNT" runat="server"></asp:Literal>' /> ), and then my Literal's are then accessed and set programmatically in my codebehind, (these fields are things like OrderID, TimeStamp, Amount, UserID etc), all gets submitted to my Realex payment page. This all works exactly as I want it to.
I've been developing a mobile website for our business, and have decided to do this using MVC. I have found MVC to be a completely different learning experience to Webforms, which I would have been fairly proficient with. Event handlers, something I relied heavily upon when I was developing in Webforms, are out the window it would seem using MVC.
I'm trying to come up with a simple MVC solution (guided by how I previously accomplished this using Webforms), that lets me put in an amount in a Textbox in my View, click a button and then this will gather up around 10 hidden form fields, and will post this data to a 3rd party website...
I have declared my hidden form fields in my view, but where I seem to be running into an issue is redirecting to my payment processors website. Using webforms, this was done using a Button Postback and declaring the URL there, but this is not an option in MVC it would seem. If anyone has done this before and can point me in the right direction, I'd be hugely grateful for any tips or pointers!