So I have a MVC5 web application and I'm trying to integrate with payment gateway, and I must do the following HTTP POST to the payment gateway url.
@Html.BeginForm(null, null, FormMethod.Post, new { @action = "https://l33tpaymentgateway.com" })
{
<input id="MerchantCode" name="MerchantCode" type="hidden" value="12345" />
<input id="RefNo" name="RefNo" type="hidden" value="ABCDE" />
<input id="Amount" name="Amount" type="hidden" value="300" />
<input id="Currency" name="Currency" type="hidden" value="USD" />
<input id="UserEmail" name="UserEmail" type="hidden" value="warheat1990@warheat1990.com" />
<input id="Signature" name="Signature" type="hidden" value="1234567890" />
<input id="ResponseURL" name="ResponseURL" type="hidden" value="http://warheat1990.com" />
<input type="submit" value="submit"/>
}
As you can see data can easily be edited by user (for example Inspect element with chrome and they can just change the value of the hidden input) which means I need to do bunch of validation, is it possible to do a HTTP POST in my server side instead and redirect the user after? Or is there any other way to prevent user to tamper HTML value?