protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { NameValueCollection nvc = Request.Form; string mmp_Transaction = nvc["mmp_txn"].ToString(); string PaymentStatus = nvc["f_code"].ToString(); string MerchantTransactionId = Request.Form["mer_txn"]; string Amount = Request.Form["amt"]; string Product = Request.Form["prod"]; string TransactionDate = Request.Form["date"]; string BankTransactionId = Request.Form["bank_txn"]; string ClientCode = Request.Form["clientcode"]; // Encrypted User Information string BankName = Request.Form["bank_name"]; //User Details string Udf1 = Request.Form["udf1"]; //First Name string Udf2 = Request.Form["udf2"]; //Email string Udf3 = Request.Form["udf3"]; //Mobile string Udf4 = Request.Form["udf4"]; //Address string Udf5 = Request.Form["udf5"]; //Bank Name string Udf6 = Request.Form["udf6"]; //EMI Option string strResponceIP = HttpContext.Current.Request.UserHostAddress; string strRemarks = "txnId:" + MerchantTransactionId + ", txnStatus:" + PaymentStatus + ", amount:" + Amount + ", pgTxnId:" + mmp_Transaction + ", BankTransactionId:" + BankTransactionId + ", Udf1:" + Udf1 + ", Udf2:" + Udf2 + ", Udf3:" + Udf3 + ", Udf4:" + Udf4 + ", Udf5:" + Udf5 + ", Udf6:" + Udf6; string ATOMPaymentIP = ConfigurationManager.AppSettings["ATOMPaymentIP"].ToString();//203.114.240.183--Stage //Verify the Response Server if (Request.UrlReferrer.Host.Trim() != ATOMPaymentIP) { // REDIRECT TO ERROR PAGE IF RESPONSE IP IS NOT VERIFIED } // CHECK THE PAYMENT STATUS AND VALIDATE THE TRANSACTION ID if (PaymentStatus.ToUpper().Trim() == "OK" && transactionid.Trim()==MerchantTransactionId.Trim()) { //"Transaction proceed successfully." // UPDATE THE TRANSACTION STATUS IN DB // // CODE FOR UPDATE STATUS // // // REDIRECT TO SUCCESS PAGE OR SHOW THE PAYMENT RESPONSE ON SAME PAGE } else { // PAYMENT STATUS IS NOT SUCCESS OR TRANSACTION ID IS NOT VERIFIED // REDIRECT TO ERROR PAGE } } } catch (Exception ex) { // HANDLE ERROR } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)