public string FillInformantInfo(ClinicalDocument clinicalDoc, Factory hl7factory, III hl7III, PatientClinicalInformation patientinfo) { string informantdetais = string.Empty; var informant = clinicalDoc.Informant.Append(); //assignedEntity.Time.AsDateTime = DateTime.Now; //var assignedAuthor = assignedEntity.AssignedAuthor; hl7III = informant.AsAssignedEntity.Id.Append(); hl7III.Init("2.16.840.1.113883.4.6", "KP00017"); IPN AsName = hl7factory.CreatePN(); addressphno = new GenerateAddressPhNo(); addressinfo = new AddressModel();///Fill Clinic Address addressinfo.street = patientinfo.ptClinicInformation.ClinicStreeet; addressinfo.city = patientinfo.ptClinicInformation.ClinicCity; addressinfo.state = patientinfo.ptClinicInformation.ClinicState; addressinfo.country = patientinfo.ptClinicInformation.ClinicCountry; addressinfo.pinCode = patientinfo.ptClinicInformation.ClinicZip.ToString(); informant.AsAssignedEntity.Addr.Add(addressphno.GenerateAddress(addressinfo, hl7factory)); ///END contactinfo = new PhNoModel(); ///FIll Clinic Contact Number contactinfo.telcomUse = "WP"; contactinfo.telcomValue = patientinfo.ptClinicInformation.ClinicPhoneNumber; contactinfo.nullFlavor = "UNK"; informant.AsAssignedEntity.Telecom.Add(addressphno.GeneratePhNo(contactinfo, hl7factory)); ///END AsName = informant.AsAssignedEntity.AssignedPerson.Name.Append(); ///Manage Clinic Name nameinfo = new NameModel(); nameinfo.Createengiven = patientinfo.ptClinicInformation.ClinicName; addressphno.FillName(nameinfo, AsName, hl7factory);///FIll Clinic Name informantdetais = clinicalDoc.Xml; return(informantdetais); }
public ActionResult PayPal() { // Here we create an instance of the handler which extracts // data from PayPal's POST so we need to pass it the 'Request' // object from the controller. Paypal_IPN paypalResponse = new Paypal_IPN("test", Request); if (paypalResponse.TXN_ID != null) { IPN ipn = new IPN(); ipn.TransactionID = paypalResponse.TXN_ID; decimal amount = Convert.ToDecimal(paypalResponse.PaymentGross); ipn.TransactionAmount = amount; //ipn.buyerEmail = paypalResponse.PayerEmail; ipn.TxTime = DateTime.Now; ipn.SessionID = paypalResponse.Custom; ipn.FirstName = paypalResponse.PayerFirstName; ipn.LastName = paypalResponse.PayerLastName; ipn.TotalTickets = paypalResponse.Quantity; ipn.PaymentStatus = paypalResponse.PaymentStatus; _context.IPNs.Add(ipn); _context.SaveChanges(); } return(View()); }
public void PaySuccess(string msg, string id, string create_time, string state, string email, string firstName, string lastName, string amount) { IPN iPN = new IPN() { transactionID = id, txTime = create_time, paymentStatus = state, buyerEmail = email, firstName = firstName, lastName = lastName, amount = amount }; _context.IPNs.Add(iPN); _context.SaveChanges(); List <AccountGood> CartaccountGoods = _context.AccountGoods.Where(ag => ag.Account_ID == _context.Users.Where(name => name.UserName == User.Identity.Name).Select(i => i.Id).FirstOrDefault() && ag.Type == "cart").ToList(); CookieHelper cookieHelper = new CookieHelper(_httpContextAccessor, Request, Response); Order newOrder = new Order() { Order_id = ar.generateNewOrderID(), Account_ID = _context.Users.Where(name => name.UserName == User.Identity.Name).Select(i => i.Id).FirstOrDefault(), order_time = DateTime.Now, total_price = Convert.ToDecimal(cookieHelper.Get("totalPrice")), total_number = Convert.ToInt32(cookieHelper.Get("totalPieces")) }; _context.Orders.Add(newOrder); _context.SaveChanges(); foreach (var item in CartaccountGoods) { OrderGoods temp = new OrderGoods() { Order_id = newOrder.Order_id, goods_id = item.Goods_ID, Quantity = item.Quantity }; _context.OrderGoods.Add(temp); _context.SaveChanges(); } foreach (var item in CartaccountGoods) { item.Type = "bought"; _context.SaveChanges(); Goods good = _context.Goodses.Where(i => i.goods_id == item.Goods_ID).FirstOrDefault(); good.goods_quantity -= item.Quantity; good.sold_quantity += item.Quantity; _context.SaveChanges(); } cookieHelper.Remove("totalPrice"); cookieHelper.Remove("totalPieces"); }
public JsonResult PaySuccess([FromBody] IPN ipn) { try { _context.IPNs.Add(ipn); _context.SaveChanges(); } catch (Exception ex) { return(Json(ex.Message)); } return(Json(ipn)); }
public JsonResult PaySuccess([FromBody] IPN ipn) { try { _context.IPNs.Add(ipn); _context.SaveChanges(); new TransactionRepo(_context).AddTransaction(ipn, um.GetUserId(HttpContext.User)); new UserRepo(_context).AddUserCredit(Decimal.Parse(ipn.custom), um.GetUserId(HttpContext.User)); } catch (Exception ex) { return(Json(ex.Message)); } return(Json(ipn)); }
protected void BindPatientName(PatientClinicalInformation patientinfo, IPN Name, Factory hl7factory) { if (patientinfo.ptDemographicDetail.FirstName != "") { var Given = hl7factory.Createengiven(); Given = hl7factory.Createengiven(); Given.Init(patientinfo.ptDemographicDetail.FirstName); Name.Items.Add(Given); } if (patientinfo.ptDemographicDetail.LastName != "") { var Family = hl7factory.Createenfamily(); Family = hl7factory.Createenfamily(); Family.Init(patientinfo.ptDemographicDetail.LastName); Name.Items.Add(Family); } }
public void AddTransaction(IPN ipn, string userID) { decimal currentCredit = db.UserGroups.Where(i => i.UserId == userID).Select(c => c.Credit).FirstOrDefault(); Transaction transaction = new Transaction() { UserID = userID, Value = Decimal.Parse(ipn.custom), InitialCredit = currentCredit, RemainingCredit = currentCredit + Decimal.Parse(ipn.custom), TransactionDate = ipn.create_time, TransactionType = "Credit Added by Paypall" }; db.Transactions.Add(transaction); db.SaveChanges(); }
public string FillRecipientInfo(ClinicalDocument clinicalDoc, Factory hl7factory, III hl7III, PatientClinicalInformation patientinfo) { string recipientInfodetais = string.Empty; var informationRecipient = clinicalDoc.InformationRecipient.Append(); IPN AsName = hl7factory.CreatePN(); AsName = informationRecipient.IntendedRecipient.InformationRecipient.Name.Append();///Manage Clinic Name addressphno = new GenerateAddressPhNo(); nameinfo = new NameModel(); nameinfo.Createengiven = patientinfo.ptClinicInformation.ClinicName; addressphno.FillName(nameinfo, AsName, hl7factory);///FIll Clinic Name var CName = hl7factory.CreateON(); CName.Text = patientinfo.ptClinicInformation.ClinicName; informationRecipient.IntendedRecipient.ReceivedOrganization.Name.Add(CName); recipientInfodetais = clinicalDoc.Xml; return(recipientInfodetais); }
public string FillAuthorInfo(ClinicalDocument clinicalDoc, Factory hl7factory, III hl7III, PatientClinicalInformation patientinfo) { string authordetais = string.Empty; //var targetrole = clinicalDoc.RecordTarget.Append(); var authors = clinicalDoc.Author.Append(); authors.Time.AsDateTime = DateTime.Now; var assignedAuthor = authors.AssignedAuthor; hl7III = assignedAuthor.Id.Append(); hl7III.Init("2.16.840.1.113883.4.6", "999999"); assignedAuthor.Code.Code = "200000000X"; assignedAuthor.Code.CodeSystem = "2.16.840.1.113883.6.101"; assignedAuthor.Code.CodeSystemName = "NUCC"; assignedAuthor.Code.DisplayName = "Allopathic & Osteopathic Physicians"; IPN AsName = hl7factory.CreatePN(); IENXP Ienxn = hl7factory.CreateENXP(); addressphno = new GenerateAddressPhNo(); addressinfo = new AddressModel();///Fill Clinic Address addressinfo.street = patientinfo.ptClinicInformation.ClinicStreeet; addressinfo.city = patientinfo.ptClinicInformation.ClinicCity; addressinfo.state = patientinfo.ptClinicInformation.ClinicState; addressinfo.country = patientinfo.ptClinicInformation.ClinicCountry; addressinfo.pinCode = patientinfo.ptClinicInformation.ClinicZip.ToString(); assignedAuthor.Addr.Add(addressphno.GenerateAddress(addressinfo, hl7factory)); ///END contactinfo = new PhNoModel(); ///FIll Clinic Contact Number contactinfo.telcomUse = "WP"; contactinfo.telcomValue = patientinfo.ptClinicInformation.ClinicPhoneNumber; contactinfo.nullFlavor = "UNK"; assignedAuthor.Telecom.Add(addressphno.GeneratePhNo(contactinfo, hl7factory)); ///END AsName = assignedAuthor.AsPerson.Name.Append(); ///Manage Clinic Name nameinfo = new NameModel(); nameinfo.Createengiven = patientinfo.ptClinicInformation.ClinicName; //nameinfo.Createenfamily = patientinfo.LastName; addressphno.FillName(nameinfo, AsName, hl7factory);///FIll Clinic Name authordetais = clinicalDoc.Xml; return(authordetais); }
public void FillName(NameModel nameinfo, IPN Name, Factory hl7factory) { if (nameinfo.Createengiven != "" && nameinfo.Createengiven != null) { var Given = hl7factory.Createengiven(); Given.Init(nameinfo.Createengiven); Name.Items.Add(Given); } if (nameinfo.Createenfamily != "" && nameinfo.Createenfamily != null) { var Family = hl7factory.Createenfamily(); Family.Init(nameinfo.Createenfamily); Name.Items.Add(Family); } if (nameinfo.CreateenSuffix != "" && nameinfo.CreateenSuffix != null) { var Family = hl7factory.Createenprefix(); Family.Init(nameinfo.CreateenSuffix); Name.Items.Add(Family); } }
public string FillLegalAuthenticatorInfo(ClinicalDocument clinicalDoc, Factory hl7factory, III hl7III, PatientClinicalInformation patientinfo) { string legalAuthenticatordetais = string.Empty; var assignedEntity = clinicalDoc.LegalAuthenticator.AssignedEntity; clinicalDoc.LegalAuthenticator.Time.Init(DateTime.Now); clinicalDoc.LegalAuthenticator.SignatureCode.Init("S"); hl7III = assignedEntity.Id.Append(); hl7III.Init("2.16.840.1.113883.4.6", "KP00017"); assignedEntity.Code.Code = "207QA0505X"; assignedEntity.Code.CodeSystem = "2.16.840.1.113883.6.101"; assignedEntity.Code.CodeSystemName = "NUCC"; assignedEntity.Code.DisplayName = "Adult Medicine"; IPN AsName = hl7factory.CreatePN(); addressphno = new GenerateAddressPhNo(); addressinfo = new AddressModel();///Fill Clinic Address addressinfo.street = patientinfo.ptClinicInformation.ClinicStreeet; addressinfo.city = patientinfo.ptClinicInformation.ClinicCity; addressinfo.state = patientinfo.ptClinicInformation.ClinicState; addressinfo.country = patientinfo.ptClinicInformation.ClinicCountry; addressinfo.pinCode = patientinfo.ptClinicInformation.ClinicZip.ToString(); assignedEntity.Addr.Add(addressphno.GenerateAddress(addressinfo, hl7factory)); ///END contactinfo = new PhNoModel(); ///FIll Clinic Contact Number contactinfo.telcomUse = "WP"; contactinfo.telcomValue = patientinfo.ptClinicInformation.ClinicPhoneNumber; contactinfo.nullFlavor = "UNK"; assignedEntity.Telecom.Add(addressphno.GeneratePhNo(contactinfo, hl7factory)); ///END AsName = assignedEntity.AssignedPerson.Name.Append(); ///Manage Clinic Name nameinfo = new NameModel(); nameinfo.Createengiven = patientinfo.ptClinicInformation.ClinicName; addressphno.FillName(nameinfo, AsName, hl7factory);///FIll Clinic Name legalAuthenticatordetais = clinicalDoc.Xml; return(legalAuthenticatordetais); }
public string FillParticipantInfo(ClinicalDocument clinicalDoc, Factory hl7factory, III hl7III, PatientClinicalInformation patientinfo) { string participantdetais = string.Empty; var participant = clinicalDoc.Participant.Append(); var times = hl7factory.CreateIVXB_TS(); times.Init(DateTime.Now); IPN AsName = hl7factory.CreatePN(); participant.TypeCode = "IND"; participant.Time.Init(null, times, times); participant.AssociatedEntity.ClassCode = "CAREGIVER"; participant.AssociatedEntity.Code.Code = "MTH"; participant.AssociatedEntity.Code.CodeSystem = "2.16.840.1.113883.5.111"; addressphno = new GenerateAddressPhNo(); addressinfo = new AddressModel();///Fill Clinic Address addressinfo.street = patientinfo.ptClinicInformation.ClinicStreeet; addressinfo.city = patientinfo.ptClinicInformation.ClinicCity; addressinfo.state = patientinfo.ptClinicInformation.ClinicState; addressinfo.country = patientinfo.ptClinicInformation.ClinicCountry; addressinfo.pinCode = patientinfo.ptClinicInformation.ClinicZip.ToString(); participant.AssociatedEntity.Addr.Add(addressphno.GenerateAddress(addressinfo, hl7factory)); ///END contactinfo = new PhNoModel(); ///FIll Clinic Contact Number contactinfo.telcomUse = "WP"; contactinfo.telcomValue = patientinfo.ptClinicInformation.ClinicPhoneNumber; contactinfo.nullFlavor = "UNK"; participant.AssociatedEntity.Telecom.Add(addressphno.GeneratePhNo(contactinfo, hl7factory)); ///END AsName = participant.AssociatedEntity.AssociatedPerson.Name.Append(); ///Manage Clinic Name nameinfo = new NameModel(); nameinfo.Createengiven = patientinfo.ptClinicInformation.ClinicName; addressphno.FillName(nameinfo, AsName, hl7factory);///FIll Clinic Name participantdetais = clinicalDoc.Xml; return(participantdetais); }
public async Task <ActionResult> CompleteTransaction(IFormCollection keyValues, IPN ipn) { try { if (!keyValues.ContainsKey("value_a")) { throw new Exception("Customer ID is not found"); } var customerId = keyValues["value_a"].ToString(); var session = await _customerTransactionSessionService.GetSessionByCustomerId(customerId); if (session == null) { throw new Exception("Invalid session"); } var(isValidated, message) = await _sslCommerzService.ValidateTransaction(ipn.TransactionId, session.Amount, session.Currency, keyValues); if (isValidated) { var isTransactionExist = await _customerTransactionService.IsTransactionExist(session.SessionKey, session.TransactionId); if (isTransactionExist) { await _customerTransactionSessionService.RemoveById(session.ID); return(Ok(new { isValidated, message = "Transaction already exist." })); } await _customerTransactionService.AddTransaction(session, ipn); await _customerTransactionSessionService.RemoveById(session.ID); } // TODO: save order information var parameters = new List <KeyValuePair <string, string> >(); if (isValidated) { parameters.Add(new KeyValuePair <string, string>("amount", ipn.Amount.ToString())); parameters.Add(new KeyValuePair <string, string>("transactionId", ipn.TransactionId)); return(Redirect(_config.APP.GetSuccessUrl(parameters))); } return(Ok(new { isValidated, message })); } catch (Exception exception) { return(BadRequest(exception.CreateErrorResponse())); } }
public async Task <CustomerTransaction> AddTransaction(CustomerTransactionSession session, IPN ipn) { var customerTransaction = new CustomerTransaction { Amount = ipn.Amount, BankTransactionId = ipn.BankTransactionId, CardNo = ipn.CardNo, CardType = ipn.CardType, Currency = session.Currency, CustomerRef = session.CustomerRef, SessionKey = session.SessionKey, Status = ipn.Status, // need to check StoreAmount = ipn.StoreAmount, StoreId = ipn.StoreId, TransactionDate = ipn.TransactionDate, TransactionId = ipn.TransactionId }; await Add(customerTransaction); return(customerTransaction); }
public IActionResult FinishShopping(string paymentID) { IPN transaction = _context.IPNs.Where(t => t.paymentID == paymentID).FirstOrDefault(); return(View(transaction)); }
//------------------------------------------------------------------------------------------- /* * Txn_id = "CREDITCARD"; * First_name = "John"; * Last_name = "Doe"; * Payer_email = "*****@*****.**"; * response = "VERIFIED"; * Quantity = "1"; * Payment_gross = "100.00"; * Custom = "GUID"; * Payment_status = "Completed"; */ private void HandleIPN() { Weavver.Utilities.Common.Log("PayPal Report", "Report...\r\n" + Request.Form.ToString() + "\r\n" + Request.QueryString.ToString()); IPN ipn = new IPN(); ipn.Receiver_email = Request.Params["receiver_email"]; ipn.Item_name = Request.Params["item_name"]; ipn.Item_number = Request.Params["item_number"]; ipn.Quantity = Request.Params["quantity"]; ipn.Invoice = Request.Params["invoice"]; ipn.Custom = Request.Params["custom"]; ipn.Payment_status = Request.Params["payment_status"]; ipn.Pending_reason = Request.Params["pending_reason"]; ipn.Payment_date = Request.Params["payment_date"]; ipn.Payment_fee = Request.Params["payment_fee"]; ipn.Payment_gross = Decimal.Parse(Request.Params["payment_gross"]); ipn.Txn_id = Request.Params["txn_id"]; ipn.Txn_type = Request.Params["txn_type"]; ipn.First_name = Request.Params["first_name"]; ipn.Last_name = Request.Params["last_name"]; ipn.Address_street = Request.Params["address_street"]; ipn.Address_city = Request.Params["address_city"]; ipn.Address_state = Request.Params["address_state"]; ipn.Address_zip = Request.Params["address_zip"]; ipn.Address_country = Request.Params["address_country"]; ipn.Address_status = Request.Params["address_status"]; ipn.Payer_email = Request.Params["payer_email"]; ipn.Payer_status = Request.Params["payer_status"]; ipn.Payment_type = Request.Params["payment_type"]; ipn.Notify_version = Request.Params["notify_version"]; ipn.Verify_sign = Request.Params["verify_sign"]; string postdata = "cmd = _notify-validate" + Request.Form.ToString(); string formvalues = Request.Form.ToString(); string newvalue = ""; string response = ""; HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://www.paypal.com/cgi-bin/webscr"); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; newvalue = formvalues + "&cmd=_notify-validate"; req.ContentLength = newvalue.Length; StreamWriter stout = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII); stout.Write(newvalue); stout.Close(); StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream()); response = stIn.ReadToEnd(); stIn.Close(); switch (response) { case "VERIFIED": Guid orderId = new Guid(ipn.Custom); // process data Weavver.Utilities.Common.Log("Vendors/PayPal/IPN.aspx.cs, Unhandled:", newvalue); //Sales_Order order = helper.Session.Get<Sales_Order>(orderId); //LedgerItem payment = new LedgerItem(); //payment.Id = Guid.NewGuid(); ////payment.OrganizationId = ipn.; //payment.LedgerType = LedgerType.Receivable; //payment.Code = CodeType.Payment; //payment.Memo = "PayPal #" + ipn.Txn_id; //payment.Amount = ipn.Payment_gross; //payment.EntryType = EntryType.Credit; //payment.CreatedAt = DateTime.UtcNow; //payment.CreatedBy = Guid.Empty; //payment.UpdatedAt = DateTime.UtcNow; //payment.UpdatedBy = Guid.Empty; //payment.Commit(); //helper.Link(order, payment); break; default: Weavver.Utilities.Common.Log("Vendors/PayPal/IPN.aspx.cs, Possible fraud", newvalue); break; } }
public string FillDocumentationOf(ClinicalDocument clinicalDoc, Factory hl7factory, III hl7III, PatientClinicalInformation patientinfo) { string documentationOfdetais = string.Empty; addressphno = new GenerateAddressPhNo(); addressinfo = new AddressModel();///Fill Clinic Address addressinfo.street = patientinfo.ptClinicInformation.ClinicStreeet; addressinfo.city = patientinfo.ptClinicInformation.ClinicCity; addressinfo.state = patientinfo.ptClinicInformation.ClinicState; addressinfo.country = patientinfo.ptClinicInformation.ClinicCountry; addressinfo.pinCode = patientinfo.ptClinicInformation.ClinicZip.ToString(); contactinfo = new PhNoModel();///FIll Clinic Contact Number contactinfo.telcomUse = "WP"; //contactinfo.telcomValue = patientinfo.ClinicPhoneNumber; contactinfo.nullFlavor = "UNK"; var docof = clinicalDoc.DocumentationOf.Append(); int count = 0; foreach (DocumentationOfList item in patientinfo.documentationOfInfo) { IVXB_TS low = new IVXB_TS(); docof.ServiceEvent.ClassCode = "PCPR"; docof.ServiceEvent.Code.Code = "99214"; docof.ServiceEvent.Code.CodeSystem = "2.16.840.1.113883.6.12"; docof.ServiceEvent.Code.CodeSystemName = "CPT4"; docof.ServiceEvent.Code.DisplayName = "Office Visit"; var performer = docof.ServiceEvent.Performer.Append(); performer.TypeCode = x_ServiceEventPerformer.PRF; if (count == 0) { low.Init(Convert.ToDateTime(item.date)); docof.ServiceEvent.EffectiveTime = new IVL_TS().Init(low: low); performer.FunctionCode.Code = "PP"; } else { if (Convert.ToDateTime(item.date).Date < Convert.ToDateTime(patientinfo.documentationOfInfo[count - 1].date).Date) { low.Init(Convert.ToDateTime(item.date)); docof.ServiceEvent.EffectiveTime = new IVL_TS().Init(low: low); } performer.FunctionCode.Code = "SP"; } performer.FunctionCode.DisplayName = "Care Provider"; performer.FunctionCode.CodeSystem = "2.16.840.1.113883.12.443"; performer.FunctionCode.CodeSystemName = "Provider Role"; low.Init(Convert.ToDateTime(item.date)); performer.Time = new IVL_TS().Init(low: low); var id = performer.AssignedEntity.Id.Append(); id.Init("2.16.840.1.113883.4.6", "111111111", "NPI"); performer.AssignedEntity.Addr.Add(addressphno.GenerateAddress(addressinfo, hl7factory)); contactinfo.telcomValue = "mailto: info @drummondgroup.com"; performer.AssignedEntity.Telecom.Add(addressphno.GeneratePhNo(contactinfo, hl7factory)); IPN AsName = hl7factory.CreatePN(); AsName = performer.AssignedEntity.AssignedPerson.Name.Append();///Manage Clinic Name nameinfo = new NameModel(); //nameinfo.Createengiven = patientinfo.ClinicName; nameinfo.Createenfamily = item.staffName; addressphno.FillName(nameinfo, AsName, hl7factory);///FIll Clinic Name count++; } documentationOfdetais = clinicalDoc.Xml; return(documentationOfdetais); }
public Customer(IPN ipn) { m_ipn = ipn; }
public ActionResult PayPal() { Paypal_IPN paypalResponse = new Paypal_IPN("test"); if (paypalResponse.TXN_ID != null) { DeveloCurityBaseEntities context = new DeveloCurityBaseEntities(); IPN ipn = new IPN(); ipn.transactionID = paypalResponse.TXN_ID; decimal amount = Convert.ToDecimal(paypalResponse.PaymentGross); ipn.amount = amount; ipn.buyerEmail = paypalResponse.PayerEmail; ipn.txTime = DateTime.Now; ipn.custom = paypalResponse.Custom; ipn.paymentStatus = paypalResponse.PaymentStatus; ipn.transactionID = paypalResponse.TXN_ID; ipn.firstName = paypalResponse.PayerFirstName; ipn.lastName = paypalResponse.PayerLastName; ipn.totalTickets = Convert.ToInt16(paypalResponse.Quantity); context.IPNs.Add(ipn); context.SaveChanges(); } return View(); }