samedi 13 juin 2015

Getting the property send by api in mvc

I am using paytab's API. (paytab is a payment gate way api). after payement it will return to my actionresult TheReturnPage(). There I need to get the payement_refrence property which the paytab send with the POST method. in two tier i did it like this and worked for me

 public partial class TheReturnPage : System.Web.UI.Page

    protected void Page_Load(object sender, EventArgs e)
        HttpContext c = HttpContext.Current;
        if (c.Request["payment_reference"] != null)

            string paymentReference = c.Request["payment_reference"].ToString();
            if (VerifyPayment(paymentReference))
                //Payment is verified and logging out from payment process
                if (LogoutPayment())
                    TextBox1.Text = "Payment is verified and logged out successfuly";

How can I do the same in MVC? paytab manual you can find here.

Aucun commentaire:

Enregistrer un commentaire