public void Payment(PayuRequest request) { string firstName = request.FirstName; string amount = Convert.ToString(request.TransactionAmount); string productInfo = request.ProductInfo; string email = request.Email; string phone = request.Phone; PayUController myremotepost = new PayUController(); string key = ConfigurationManager.AppSettings["MERCHANT_KEY"]; string salt = ConfigurationManager.AppSettings["SALT"]; //posting all the parameters required for integration. myremotepost.Url = ConfigurationManager.AppSettings["PAYU_BASE_URL"]; myremotepost.SUrl = request.surl; myremotepost.FUrl = request.furl; myremotepost.Add("key", key); string txnid = Generatetxnid(); myremotepost.Add("txnid", txnid); myremotepost.Add("amount", amount); myremotepost.Add("productinfo", productInfo); myremotepost.Add("firstname", firstName); myremotepost.Add("phone", phone); myremotepost.Add("email", email); myremotepost.Add("udf1", request.udf1); myremotepost.Add("udf2", request.udf2); myremotepost.Add("surl", myremotepost.SUrl); //Change the success url here depending upon the port number of your local system. myremotepost.Add("furl", myremotepost.FUrl); //Change the failure url here depending upon the port number of your local system. // myremotepost.Add("service_provider", "payu_paisa"); string hashString = key + "|" + txnid + "|" + amount + "|" + productInfo + "|" + firstName + "|" + email + "|" + request.udf1 + "|" + request.udf2 + "|||||||||" + salt; //string hashString = "3Q5c3q|2590640|3053.00|OnlineBooking|vimallad|[email protected]|||||||||||mE2RxRwx"; string hash = Generatehash512(hashString); myremotepost.Add("hash", hash); myremotepost.Post(); }
public void Index(PayuRequest data) { try { RemotePost myremotepost = new RemotePost(); string key = ConfigurationManager.AppSettings["MERCHANT_KEY"]; string salt = ConfigurationManager.AppSettings["SALT"]; string surl = ConfigurationManager.AppSettings["SUCC_URL"]; string furl = ConfigurationManager.AppSettings["FAIL_URL"]; //posting all the parameters required for integration. myremotepost.Url = ConfigurationManager.AppSettings["PAYU_BASE_URL"]; myremotepost.Add("key", key); string txnid = Guid.NewGuid().ToString().Substring(12); myremotepost.Add("txnid", txnid); myremotepost.Add("amount", data.amount); myremotepost.Add("productinfo", data.productInfo); myremotepost.Add("firstName", data.firstName); myremotepost.Add("lastname", data.lastname); myremotepost.Add("email", data.email); myremotepost.Add("phone", data.phone); myremotepost.Add("address1", data.address1); myremotepost.Add("address2", data.address2); myremotepost.Add("city", data.city); myremotepost.Add("state", data.state); myremotepost.Add("zipcode", data.zipcode); myremotepost.Add("surl", surl); myremotepost.Add("furl", furl); string hashString = key + "|" + txnid + "|" + data.amount + "|" + data.productInfo + "|" + data.firstName + "|" + data.email + "|||||||||||" + salt; string hash = Hashing.Generatehash512(hashString); myremotepost.Add("hash", hash); myremotepost.Post(); } catch { throw; } }
public ActionResult Index() { try { PayuRequest payuRequest = new PayuRequest(); payuRequest.firstName = "Ankit"; payuRequest.lastname = "kanojia"; payuRequest.amount = "100.00"; payuRequest.productInfo = "Moto G4 Plus"; payuRequest.email = "*****@*****.**"; payuRequest.phone = "9099673090"; payuRequest.address1 = "O/P Inox multiplex"; payuRequest.address2 = "Zadeshwar Road"; payuRequest.city = "BHaruch"; payuRequest.state = "Gujarat"; payuRequest.zipcode = "392012"; return(View(payuRequest)); } catch { throw; } }