public static Ticket Create(Department department) { var ticket = new Ticket { DepartmentId = department.Id }; foreach (var taxServiceTemplate in department.TaxServiceTemplates) { ticket.AddTaxService(taxServiceTemplate.Id, taxServiceTemplate.CalculationMethod, taxServiceTemplate.Amount); } return(ticket); }
public static Ticket Create(Department department) { var ticket = new Ticket { DepartmentId = department.Id }; foreach (var taxServiceTemplate in department.TaxServiceTemplates) { ticket.AddTaxService(taxServiceTemplate.Id, taxServiceTemplate.CalculationMethod, taxServiceTemplate.Amount); } return ticket; }
private static decimal Preauth(SecureString swipeData, Ticket ticket, decimal tenderedAmount, decimal gratuity) { // preauthPayment if (gratuity > 0 && Settings.GratuityService != null) // add gratuity amount to ticket ticket.AddTaxService(Settings.GratuityService.Id, Settings.GratuityService.CalculationMethod, gratuity); using (var sm = new SecureStringToStringMarshaler(swipeData)) { // access swipedata as demonstrated here InteractionService.UserIntraction.GiveFeedback(string.Format("Amount:{0}\r\rPreauth:\r{1}", ticket.GetRemainingAmount(), sm.String)); // *------------------------ // Preauth Here // *------------------------ } AddPreauthData(ticket.Id, swipeData, "SAMPLE MERCHANT AUTH CODE", tenderedAmount, gratuity); return tenderedAmount + gratuity; }