Redirect with POST parameters in MVC 4 for Payment Gateway Integration

后端 未结 3 1698
难免孤独
难免孤独 2021-01-20 20:14

I am trying to do a payment gateway integration using mvc4 in razor. In that i need to call a page with prefilled post form.

Using the below method, I am forming th

3条回答
  •  Happy的楠姐
    2021-01-20 20:37

    You cannot post a form by Redirect method. You could send generated form string to View and after that post the form by Javascript.

    public ActionResult OrderSummary()
    {
        string request=PreparePOSTForm("payment URL","hashdata required for payment")
        return View(model:request);
    }
    

    and in View of OrderSummary:

    @model string
    
    @Html.Raw(Model)
    
    
    

提交回复
热议问题