篡改所以我有一個MVC5 Web應用程序,我想用支付網關整合,我必須做到以下幾點HTTP POST到支付網關的URL。驗證HTTP POST並確保數據不被用戶
@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="[email protected]" />
<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"/>
}
正如你可以看到數據可以容易地通過用戶編輯(例如檢查用鉻元素和他們可以只改變隱藏輸入的值),這意味着我需要做一堆的驗證,是有可能在我的服務器端做一個HTTP POST,而不是在之後重定向用戶?或者有沒有其他方法可以防止用戶篡改HTML值?
一個問題,我怎麼重定向用戶到支付網關頁面,如果'IsSuccessStatusCode == TRUE'?因爲'responseContent'只是一個HTML字符串。 – warheat1990
如果付款成功,您需要重定向用戶嗎?如果是的話只返回'重定向(「重定向URL」);' –
沒有我需要重定向到任何鏈接'l33tpaymentgateway'成功POST之後提供。我爲此打開了另一個線索,但迄今爲止沒有運氣。 http://stackoverflow.com/questions/33257254/how-to-perform-http-post-and-redirect-to-external-site-from-the-post-result – warheat1990