public CommonDbResponse CheckVianetAccount(VianetBillInquiryCommon Common) { CommonDbResponse response = new CommonDbResponse(); Dictionary <string, string> Data = new Dictionary <string, string>(); Data.Add("VianetCustomerId", Common.VianetCustomerId); Data.Add("IpAddress", Common.IpAddress); Data.Add("UserId", Common.UserId); GatewaySwitchAbstractService factory = GatewaySwitchAbstractFactory.Create("cgpay"); var fresponse = factory.GetUserDetails("33", Data); response.Message = fresponse.Message; response.GatewayName = fresponse.GatewayName; if (fresponse.Code == "000") { response.Code = ResponseCode.Success; response.Data = fresponse.Data; } else { response.Code = ResponseCode.Failed; } return(response); }
public ActionResult VianetBillPayment(VianetBillInquiryResponseModel Response) { if (Response.Encryptioncontent.DecryptParameter() != (Response.VianetCustomerId + Response.BillAmount)) { this.ShowPopup(1, "Data Mismatch"); return(RedirectToAction("VianetBillInquiry")); } if (string.IsNullOrEmpty(Response.BillAmount) && string.IsNullOrEmpty(Response.RenewalPlans)) { this.ShowPopup(1, "Invalid Plan"); return(View(Response)); } VianetBillPaymentModel payment = new VianetBillPaymentModel(); if (!string.IsNullOrEmpty(Response.RenewalPlans)) { var plan = Response.RenewalPlans; var plansplit = plan.Split('|'); payment.VianetCustomerId = Response.VianetCustomerId; if (plansplit.Length == 2) { payment.Amount = plansplit[0]; payment.PlanId = plansplit[1]; } else { this.ShowPopup(1, "Select Plan Invalid"); return(RedirectToAction("VianetBillInquiry")); } } else { payment.Amount = Response.BillAmount; } var jstring = Newtonsoft.Json.JsonConvert.SerializeObject(payment); MobileTopUpPaymentRequest mtpr = new MobileTopUpPaymentRequest() { action_user = Session["UserName"].ToString(), product_id = Response.ProductId.DecryptParameter(), amount = payment.Amount, subscriber_no = payment.VianetCustomerId, quantity = "", additonal_data = jstring, CreatedIp = ApplicationUtilities.GetIP() }; var response = _mtp.MobileTopUpPaymentRequest(mtpr); if (response.Code == 0) { payment.TransactionId = response.Extra1; VianetBillPaymentCommon pcommon = new VianetBillPaymentCommon(); var amt = payment.Amount.Contains(".") ? payment.Amount.Split('.')[0].ToString() : payment.Amount; payment.Amount = amt; pcommon = payment.MapObject <VianetBillPaymentCommon>(); var paymentresponse = _vianet.BillPayment(pcommon); bool failed = true; if (paymentresponse.GatewayName == "PRABHUPAY") { if (paymentresponse.Code == shared.Models.ResponseCode.Success) { var ppresponse = (prabhupay.service.data.ReturnTransaction)paymentresponse.Data; var data = new MobileTopUpPaymentUpdateRequest(); data.action_user = Session["username"].ToString(); data.refstan = ppresponse.TransactionId; data.transaction_id = response.Extra1; data.additonal_data = Newtonsoft.Json.JsonConvert.SerializeObject(ppresponse); data.amount = pcommon.Amount; data.status_code = ppresponse.Code; data.remarks = ppresponse.Message; data.ip_address = ApplicationUtilities.GetIP(); response = _mtp.MobileTopUpPaymentResponse(data); failed = false; //return RedirectToAction("ResultPage", "WorldLinkBillPayment", new { txnid = ppresponse }); return(RedirectToAction("ResultPage", "VianetBillPayment", new { txnid = response.Extra1.EncryptParameter() })); } else if (paymentresponse.Code == shared.Models.ResponseCode.Exception) { var ppresponse = (prabhupay.service.data.ReturnTransaction)paymentresponse.Data; var data = new MobileTopUpPaymentUpdateRequest(); data.action_user = Session["username"].ToString(); data.transaction_id = response.Extra1; data.refstan = ppresponse.TransactionId; data.additonal_data = Newtonsoft.Json.JsonConvert.SerializeObject(ppresponse); data.amount = pcommon.Amount; data.status_code = ppresponse.Code; data.remarks = ppresponse.Message; data.ip_address = ApplicationUtilities.GetIP(); //data.product_id = pcommon.; data.partner_txn_id = ppresponse.TransactionId; response = _mtp.MobileTopUpPaymentResponse(data); failed = false; return(RedirectToAction("ResultPage", "VianetBillPayment", new { txnid = response.Extra1.EncryptParameter() })); } else { var ppresponse = (prabhupay.service.data.ReturnTransaction)paymentresponse.Data; var data = new MobileTopUpPaymentUpdateRequest(); data.action_user = Session["UserName"].ToString(); data.transaction_id = response.Extra1; data.additonal_data = Newtonsoft.Json.JsonConvert.SerializeObject(ppresponse); data.amount = pcommon.Amount; data.status_code = ((int)paymentresponse.Code).ToString(); data.remarks = paymentresponse.Message; data.ip_address = ApplicationUtilities.GetIP(); //data.product_id = pcommon.ProductId; response = _mtp.MobileTopUpPaymentResponse(data); } response.SetMessageInTempData(this, "VianetBillPayment"); if (failed) { VianetBillInquiryCommon query = new VianetBillInquiryCommon() { VianetCustomerId = payment.VianetCustomerId }; return(RedirectToAction("VianetBillInquiry", new { wpm = query })); } } } response.SetMessageInTempData(this, "VianetBillPayment"); VianetBillInquiryCommon que = new VianetBillInquiryCommon() { VianetCustomerId = payment.VianetCustomerId }; return(RedirectToAction("VianetBillInquiry", new { wpm = que })); }
public ActionResult VianetBillInquiry(VianetBillInquiryModel wpm) { VianetBillInquiryCommon wpc = wpm.MapObject <VianetBillInquiryCommon>(); var productdetails = GetVianetproductDetails(); wpm.ProductLogo = productdetails.ProductLogo; wpm.CommissionType = productdetails.CommissionType; wpm.CommissionValue = productdetails.CommissionValue; wpc.IpAddress = ApplicationUtilities.GetIP(); wpc.UserId = ApplicationUtilities.GetSessionValue("userid").ToString(); var inquiry = _vianet.CheckVianetAccount(wpc); VianetBillInquiryResponseModel vnet = new VianetBillInquiryResponseModel(); vnet.ProductLogo = productdetails.ProductLogo; vnet.CommissionType = productdetails.CommissionType; vnet.CommissionValue = productdetails.CommissionValue; vnet.ProductId = productdetails.ProductId.EncryptParameter(); if (inquiry.GatewayName.ToUpper() == "PRABHUPAY") { if (inquiry.Code == shared.Models.ResponseCode.Success) { var obj = Newtonsoft.Json.JsonConvert.SerializeObject(inquiry.Data); var prabhupayinqresp = Newtonsoft.Json.JsonConvert.DeserializeObject <PrabhuPayVianetBillInquiryResponseModel>(obj); vnet.CustomerName = prabhupayinqresp.CustomerName; vnet.VianetCustomerId = prabhupayinqresp.VianetCustomerId; vnet.PaymentMessage = prabhupayinqresp.PaymentMessage; List <PlansModel> lst = new List <PlansModel>(); foreach (var item in prabhupayinqresp.RenewalPlans) { PlansModel plan = new PlansModel() { PlanId = item.PlanId, PlanAmount = item.PlanAmount, PlanName = item.PlanName, PlanDescription = item.PlanDescription }; lst.Add(plan); } //wlink.RenewalPlans = lst; //var planlst = DropdownPlan(lst); //if (planlst == null) //{ // ViewBag.Planlist = null; //} ViewBag.Planlist = ApplicationUtilities.SetDDLValue(DropdownPlan(lst), "", "--Select--"); vnet.Encryptioncontent = (prabhupayinqresp.VianetCustomerId + prabhupayinqresp.BillAmount).EncryptParameter(); string AgentId = Session["AgentId"].ToString(); var TxnLimit = _transactionLimit.GetTransactionLimitForUser(AgentId); var trangrid = ProjectGrid.TransactionLimit(TxnLimit); ViewData["trangrid"] = trangrid; return(View("VianetBillPayment", vnet)); } else { string AgentId = Session["AgentId"].ToString(); var TxnLimit = _transactionLimit.GetTransactionLimitForUser(AgentId); var trangrid = ProjectGrid.TransactionLimit(TxnLimit); ViewData["trangrid"] = trangrid; this.ShowPopup(1, inquiry.Message); return(View(wpm)); } } this.ShowPopup(1, "Service Unavaliable"); return(View(wpm)); }
public CommonDbResponse CheckVianetAccount(VianetBillInquiryCommon Common) { return(repo.CheckVianetAccount(Common)); }