protected void btnSubmit_Click(object sender, EventArgs e) { try { string uid = Configuration.SuvidhaUser; string pin = Configuration.SuvidhaPin; string fname = txtFirstname.Text; string lname = txtLastname.Text; string mobileno = txtMobileno.Text; string URL = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/CustomerRegistration?Username="******"&Password="******"&Mobile=" + mobileno + "&FName=" + fname + "&LName=" + lname + ""; var httpWebRequest = (HttpWebRequest)WebRequest.Create(URL); string postData = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/CustomerRegistration?Username="******"&Password="******"&Mobile=" + mobileno + "&FName=" + fname + "&LName=" + lname + ""; httpWebRequest.Method = WebRequestMethods.Http.Post; httpWebRequest.ContentType = "application/x-www-form-urlencoded"; httpWebRequest.ContentLength = postData.Length; using (StreamWriter writer = new StreamWriter(httpWebRequest.GetRequestStream())) { writer.Write(postData); } var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); CustRegistraion cr = js.Deserialize <CustRegistraion>(result); int user_id = cr.UserId; string requestno = cr.requestNo; string errormsg = cr.ErrorMsg; Session["OtcRef"] = requestno; Session["Mobileno"] = mobileno; if (errormsg != null) { lblMessage.ForeColor = Color.Red; lblMessage.Text = errormsg; } else { Int32 custid = Convert.ToInt32(ddUserIDno.SelectedValue); string userIdentyno = ddUserIDno.SelectedItem.ToString(); obj_wallet.AddAPIcustomerRegistration(user_id, requestno, custid, userIdentyno); lblMessage.ForeColor = Color.Green; lblMessage.Text = "OTP send on registered mobile"; } txtFirstname.Text = ""; txtLastname.Text = ""; txtMobileno.Text = ""; } } catch { } }
private void BindGetLogin(string mobileno) { try { string uid = Configuration.SuvidhaUser; string pin = Configuration.SuvidhaPin; string URL = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/GetLogin?Username="******"&Password="******"&Mobile=" + mobileno + ""; var httpWebRequest = (HttpWebRequest)WebRequest.Create(URL); httpWebRequest.Method = WebRequestMethods.Http.Get; httpWebRequest.ContentType = "application/x-www-form-urlencoded"; var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); CustRegistraion cr = js.Deserialize <CustRegistraion>(result); string mobile = cr.Mobileno; string balance = cr.Balance; string requestno = cr.RequestNo; string card = cr.CardExists; string errormsg = cr.ErrorMsg; string ressponse = cr.Response; string message = cr.Message; string code = cr.Code; Int32 ac_beneficiary = cr.beneficiary.Count; string benefcode = cr.beneficiary[0].BeneficiaryCode; //string benefname = cr.beneficiary[1].BeneficiaryName; //string beneftype = cr.beneficiary[2].BeneficiaryType; //string accountno = cr.beneficiary[3].AccountNumber; //string accounttype = cr.beneficiary[4].AccountType; //string beneifsc = cr.beneficiary[5].IFSC; //string active = cr.beneficiary[6].Active; Session["BenfCode"] = benefcode; string accountno = ddAcountno.SelectedItem.ToString(); string rtID = GetApiEditID(accountno, mobileno); if (ressponse == "SUCCESS") { obj_wallet.UpdateAPIBeneLogDetail(requestno, benefcode, message, rtID); } else { lblMessage.ForeColor = Color.Red; lblMessage.Text = errormsg; } } } catch { } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { if (Session["TranferOTP"].ToString() == Session["txtCodeTranferOTP"].ToString()) { string uid = Configuration.SuvidhaUser; string pin = Configuration.SuvidhaPin; string mobileno = Session["MobileNo"].ToString(); string benecode = Session["BenfCode"].ToString(); string ifsccode = Session["IfscCode"].ToString(); string amount = Session["TransferAmount"].ToString(); string paytype = Session["BeneficiaryType"].ToString(); string accountno = Session["BeneAccount"].ToString(); string beneName = Session["BeneName"].ToString(); string transactionId = TransactionID(); string URL = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/MoneyTransfer?Username="******"&Password="******"&Mobile=" + mobileno + "&BeneCode=" + benecode + "&IFSC=" + ifsccode + "&Amount=" + amount + "&PayType=" + paytype + "&AccountNumber=" + accountno + "&Name=" + beneName + "&YourTransactionID=" + transactionId + ""; var httpWebRequest = (HttpWebRequest)WebRequest.Create(URL); string postData = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/MoneyTransfer?Username="******"&Password="******"&Mobile=" + mobileno + "&BeneCode=" + benecode + "&IFSC=" + ifsccode + "&Amount=" + amount + "&PayType=" + paytype + "&AccountNumber=" + accountno + "&Name=" + benecode + "&YourTransactionID=" + transactionId + ""; httpWebRequest.Method = WebRequestMethods.Http.Post; httpWebRequest.ContentType = "application/x-www-form-urlencoded"; httpWebRequest.ContentLength = postData.Length; using (StreamWriter writer = new StreamWriter(httpWebRequest.GetRequestStream())) { writer.Write(postData); } var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); CustRegistraion cr = js.Deserialize <CustRegistraion>(result); Int32 user_id = cr.UserId; string bankAcno = cr.BankAccNo; string benename = cr.BeneficiaryName; string sendermobile = cr.SenderMobile; string requestno = cr.requestNo; string errormsg = cr.ErrorMsg; string message = cr.Message; if (message == "SUCCESS") { string trasactionno = TransactionID(); string sysIPaddress = GetIPAddress(); Int32 userID = Convert.ToInt32(Session["Customerid"]); obj_wallet.UpdateCustomerWalletFundtransfer(Convert.ToDecimal(txtAmount.Text), userID); obj_wallet.AddFundTransferDetail(trasactionno, userID, Session["UserIdenfifyNo"].ToString(), Session["BeneName"].ToString(), Session["BeneAccount"].ToString(), Session["BeneficiaryType"].ToString(), Session["IfscCode"].ToString(), Session["MobileNo"].ToString(), Convert.ToDecimal(Session["TransferAmount"]), sysIPaddress); string mobile = Session["MobileNo"].ToString(); SendMsg(mobile); string requeststatus = "Amount Transfered"; BindUserWalletDetails(Convert.ToString(userID)); Session["transactiontype"] = "Withdrawal Amount"; int logid = Convert.ToInt32(Session["userid"]); obj_wallet.DeductCustomerWalletAmt(Convert.ToInt32(Session["walletid"]), userID, Convert.ToDecimal(Session["walletamount"]), Convert.ToDecimal(Session["TransferAmount"]), trasactionno, Session["transactiontype"].ToString(), requeststatus, Session["Customername"].ToString(), Session["CustEmailid"].ToString(), logid, Session["UserIdenfifyNo"].ToString()); obj_wallet.UpdateCustomerWalletFundtransfer(Convert.ToDecimal(Session["TransferAmount"]), logid); bool status = true; long transaccont = Convert.ToInt64(Session["BeneAccount"]); decimal tranferamount = Convert.ToDecimal(Session["TransferAmount"]); string requestid = Convert.ToString(Session["RequestID"]); if (Session["RequestID"] != null) { obj_wallet.UpdateCustomerFundTransferStatus(status, tranferamount, transaccont, requeststatus, requestid); } lblMessage.ForeColor = Color.Green; lblMessage.Text = "Amount Transfer Successfully!"; Session["MobileNo"] = null; Session["BeneAccount"] = null; Session["BeneName"] = null; Session["IfscCode"] = null; Session["BeneficiaryType"] = null; Session["TransferAmount"] = null; Session["Customerid"] = null; Session["TranferOTP"] = null; txtAmount.Text = ""; Session["RequestUserid"] = null; Session["RequestID"] = null; Session["RequestAmount"] = null; Session["TranferOTP"] = null; Session["txtCodeTranferOTP"] = null; } if (errormsg != null) { lblMessage.ForeColor = Color.Red; lblMessage.Text = errormsg; } } } else { lblMessage.ForeColor = Color.Red; lblMessage.Text = "OTP entered is incorrect"; } } catch { } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { string uid = Configuration.SuvidhaUser; string pin = Configuration.SuvidhaPin; string mobileno = txtMobileno.Text; string beneName = txtNameBene.Text; string accountno = txtAccountno.Text; string benetype = ddBeneType.SelectedItem.ToString(); string ifsc = txtIfsccode.Text; string URL = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/AddNewBeneficiary?Username="******"&Password="******"&Mobile=" + mobileno + "&Name=" + beneName + "&AccNo=" + accountno + "&BeneType=" + benetype + "&ifsc=" + ifsc + ""; var httpWebRequest = (HttpWebRequest)WebRequest.Create(URL); string postData = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/AddNewBeneficiary?Username="******"&Password="******"&Mobile=" + mobileno + "&Name=" + beneName + "&AccNo=" + accountno + "&BeneType=" + benetype + "&ifsc=" + ifsc + ""; httpWebRequest.Method = WebRequestMethods.Http.Post; httpWebRequest.ContentType = "application/x-www-form-urlencoded"; httpWebRequest.ContentLength = postData.Length; using (StreamWriter writer = new StreamWriter(httpWebRequest.GetRequestStream())) { writer.Write(postData); } var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); CustRegistraion cr = js.Deserialize <CustRegistraion>(result); int user_id = cr.UserId; string benefictype = cr.BeneficiaryType; string bankAcno = cr.BankAccNo; string benename = cr.BeneficiaryName; string sendermobile = cr.SenderMobile; string ifsccode = cr.IfscCode; string Requestno = cr.requestNo; string type = cr.Type; string errormsg = cr.ErrorMsg; Session["OtcRef1"] = Requestno; Session["Mobileno"] = sendermobile; string rtId = GetApiTIDByMobile(sendermobile); if (errormsg != null) { lblMessage.ForeColor = Color.Red; lblMessage.Text = errormsg; } else { lblMessage.ForeColor = Color.Green; lblMessage.Text = "OTP send on mobile"; obj_wallet.UpdateAPIaddnewBeneficiary(user_id, benefictype, accountno, benename, sendermobile, ifsccode, Requestno, type, rtId); } txtMobileno.Text = ""; txtAccountno.Text = ""; txtIfsccode.Text = ""; txtNameBene.Text = ""; ddBeneType.SelectedIndex = 0; } } catch { } }
protected void lnkResedOtp_Click(object sender, EventArgs e) { try { string userid = ddUserIDno.SelectedValue; string mobilenum = txtMobileno.Text; BindOtcrefMobile(userid, mobilenum); string uid = Configuration.SuvidhaUser; string pin = Configuration.SuvidhaPin; string otcref = ""; if (Session["OtcRef1"] != null) { otcref = Convert.ToString(Session["OtcRef1"]); } string mobileno = ""; if (Session["Mobileno"] != null) { mobileno = Convert.ToString(Session["Mobileno"]); } string URL = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/ResendOtc?Username="******"&Password="******"&Mobile=" + mobileno + "&OTCREF=" + otcref + ""; var httpWebRequest = (HttpWebRequest)WebRequest.Create(URL); string postData = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/ResendOtc?Username="******"&Password="******"&Mobile=" + mobileno + "&OTCREF=" + otcref + ""; httpWebRequest.Method = WebRequestMethods.Http.Post; httpWebRequest.ContentType = "application/x-www-form-urlencoded"; httpWebRequest.ContentLength = postData.Length; using (StreamWriter writer = new StreamWriter(httpWebRequest.GetRequestStream())) { writer.Write(postData); } var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); CustRegistraion cr = js.Deserialize <CustRegistraion>(result); int user_id = cr.UserId; string sedermobile = cr.SenderMobile; string Otp = cr.otc; string requestno = cr.requestNo; string Otpref = cr.otcRef; string errormsg = cr.ErrorMsg; if (errormsg != null) { lblMessage.ForeColor = Color.Red; lblMessage.Text = errormsg; } else { lblMessage.ForeColor = Color.Green; lblMessage.Text = "Resend OTP on registered mobile"; } } } catch { } }
protected void btnOTP_Click(object sender, EventArgs e) { try { string uid = Configuration.SuvidhaUser; string pin = Configuration.SuvidhaPin; string otcref = ""; if (Session["OtcRef1"] != null) { otcref = Session["OtcRef1"].ToString(); } string otc = txtOTP.Text; string mobileno = ""; if (Session["Mobileno"] != null) { mobileno = Session["Mobileno"].ToString(); } string URL = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/VerifyBeneRegOtc?Username="******"&Password="******"&Mobile=" + mobileno + "&OtcRef=" + otcref + "&Otc=" + otc + ""; var httpWebRequest = (HttpWebRequest)WebRequest.Create(URL); string postData = "http://recharge.suvidhaarecharge.com/api/MoneyTransfer/VerifyBeneRegOtc?Username="******"&Password="******"&Mobile=" + mobileno + "&OtcRef=" + otcref + "&Otc=" + otc + ""; httpWebRequest.Method = WebRequestMethods.Http.Post; httpWebRequest.ContentType = "application/x-www-form-urlencoded"; httpWebRequest.ContentLength = postData.Length; using (StreamWriter writer = new StreamWriter(httpWebRequest.GetRequestStream())) { writer.Write(postData); } var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); CustRegistraion cr = js.Deserialize <CustRegistraion>(result); int user_id = cr.UserId; string sedermobile = cr.SenderMobile; string Otp = cr.otc; string requestno = cr.requestNo; string Otpref = cr.otcRef; string errormsg = cr.ErrorMsg; string rtId = GetApiTID(Otpref); if (requestno == "Success") { obj_wallet.UpdateAPIBeneficiaryOtc(user_id, otc, requestno, otcref, rtId); lblMessage.ForeColor = Color.Green; lblMessage.Text = "Registration OTP verify successfully"; } else { lblMessage.ForeColor = Color.Red; lblMessage.Text = errormsg; } } } catch { } }