private void CafeSessionOpening([NotNull] IReceiptPrinter printer)
        {
            PluginContext.Log.Info("Cafe Session Opening.");
            const string message = "SamplePaymentPlugin: 'I can not connect to my server to open operation session. But I'll not stop openning iikoFront cafe session.'";

            PluginContext.Operations.AddNotificationMessage(message, "SamplePaymentPlugin");
        }
Exemple #2
0
 private void Print(IViewManager viewManager, IReceiptPrinter receiptPrinter, IProgressBar progressBar)
 {
     receiptPrinter.Print(new ReceiptSlip
     {
         Doc = new XElement(Tags.Doc, new XElement(Tags.Center, "Test Printer"))
     });
 }
 public CheckoutTill(PricingRules rules, IReceiptPrinter receiptPrinter)
 {
     _rules = rules;
     _specialRuleEngine = new SpecialRuleEngine(_rules);
     _receiptItems = new ReceiptItems();
     _receiptPrinter = receiptPrinter;
 }
Exemple #4
0
 private static void Print(IViewManager viewManager, IReceiptPrinter receiptPrinter)
 {
     receiptPrinter.Print(new ReceiptSlip
     {
         Doc = new XElement(Tags.Doc, new XElement(Tags.Center, "Test"))
     });
 }
Exemple #5
0
        private static void ShowKeyboardPopup(IViewManager viewManager, IReceiptPrinter receiptPrinter)
        {
            var inputResult = viewManager.ShowKeyboard("Enter Name", isMultiline: false, capitalize: true);

            ShowNotification(inputResult == null
                    ? "Nothing"
                    : $"Entered : '{inputResult}'");
        }
Exemple #6
0
 /// <summary>
 /// Вывод экранной клавиатуры для ввода номера телефона.
 /// </summary>
 /// <param name="viewManager"></param>
 /// <param name="receiptPrinter"></param>
 /// <param name="progressBar"></param>
 private IPhoneInputResult ShowKeyboardPopup(IViewManager viewManager, IReceiptPrinter receiptPrinter, IProgressBar progressBar)
 {
     return((IPhoneInputResult)viewManager.ShowExtendedNumericInputPopup("Введите номер телефона:", "Номер телефона",
                                                                         new ExtendedInputSettings()
     {
         EnablePhone = true
     }));
 }
 public void CollectData(Guid orderId, Guid paymentTypeId, IUser cashier, IReceiptPrinter printer, IViewManager viewManager, IPaymentDataContext context,
                         IProgressBar progressBar)
 {
     PluginContext.Log.Info($"=== CollectData");
     var bonusAction = viewManager.ShowChooserPopup("Logus CRM", new List <string>
     {
         $"Проверка платёжного ср-ва"
     });
 }
Exemple #8
0
        private void UnclaimDevices()
        {
            ICashDrawer drawer = _posDeviceManager.GetCashDrawer();

            drawer.Release();
            IReceiptPrinter printer = _posDeviceManager.GetReceiptPrinter();

            printer.Release();
        }
Exemple #9
0
        private static void ShowInputDialog(IViewManager viewManager, IReceiptPrinter receiptPrinter)
        {
            var magicNumber = (NumberInputDialogResult)viewManager.ShowInputDialog("Enter your favourite number", InputDialogTypes.Number);

            if (magicNumber != null)
            {
                ShowNotification($"0x{magicNumber.Number:x}{Environment.NewLine}Did you know, how your favorite number looks in hex?");
                return;
            }

            var settings = new ExtendedInputDialogSettings
            {
                EnableBarcode   = true,
                TabTitleBarcode = "Barcode",

                EnableCardSlider = true, // card sliding doesn't have UI, so it doesn't need a separate tab, so here is no title for that input type

                EnableNumericString   = true,
                TabTitleNumericString = "Nasty number", // if user doesn't have a favourite number, probably, there is some number which he hates more than others?

                EnablePhone   = true,
                TabTitlePhone = "Your mobile phone number"
            };
            var dialogResult = viewManager.ShowExtendedInputDialog("Opinion survey, step 2", "Try to enter something or scan barcode or swipe magnetic card or whatever.", settings);

            switch (dialogResult)
            {
            case null:     // user cancelled the dialog
                ShowNotification("Bye-bye!");
                break;

            case BarcodeInputDialogResult barcode:
                ShowNotification($"Barcode is: {barcode.Barcode}");
                break;

            case CardInputDialogResult card:
                ShowNotification($"Card number is: {card.Track2}");
                break;

            case NumericStringInputDialogResult numericString:
                // the entered number is string, it may be very long, parsing to int may cause an overflow, use ShowInputDialog+InputDialogTypes.Number for integer
                ShowNotification(numericString.NumericString.Length == 1
                        ? "Hey, why not to try to enter a long number?"
                        : $"{new string(numericString.NumericString.Reverse().ToArray())}");
                break;

            case PhoneInputDialogResult phone:
                ShowNotification($"Now plugin could call to {phone.PhoneNumber}");
                break;

            default:
                throw new NotSupportedException(nameof(dialogResult.GetType));
            }
        }
Exemple #10
0
 private static void OpenIikoSite(IViewManager viewManager, IReceiptPrinter receiptPrinter)
 {
     using (var process = new Process
     {
         EnableRaisingEvents = false,
         StartInfo = { FileName = @"http://api.iiko.ru/" }
     })
     {
         process.Start();
     }
 }
Exemple #11
0
 public IReceiptPrinter GetReceiptPrinter()
 {
     if (_printer == null)
     {
         DeviceInfo printerDeviceInfo = _exp.GetDevice("PosPrinter");
         PosPrinter printer           = (PosPrinter)_exp.CreateInstance(printerDeviceInfo);
         _printer = new ReceiptPrinterWrapper(printer);
         printer.Open();
     }
     return(_printer);
 }
Exemple #12
0
        private void ShowKeyboardPopup(IViewManager viewManager, IReceiptPrinter receiptPrinter, IProgressBar progressBar)
        {
            var inputResult = viewManager.ShowKeyboard("Enter Name", isMultiline: false, capitalize: true);

            PluginContext.Operations.AddNotificationMessage(
                inputResult == null
                    ? "Nothing"
                    : string.Format("Entered : '{0}'", inputResult),
                "SamplePlugin",
                TimeSpan.FromSeconds(15));
        }
Exemple #13
0
        /// <summary>
        /// Вывод меню плагина.
        /// </summary>
        /// <param name="viewManager"></param>
        /// <param name="receiptPrinter"></param>
        /// <param name="progressBar"></param>
        private void ShowListPopup(IViewManager viewManager, IReceiptPrinter receiptPrinter, IProgressBar progressBar)
        {
            var list = new List <string> {
                "Узнать баланс.", "Начислить бонусы.", "Списать бонусы"
            };

            var selectedItem = list[2];
            var inputResult  = viewManager.ShowChooserPopup("Yagoda", list, i => i, selectedItem, ButtonWidth.Narrower);

            DisplayBonus(ShowKeyboardPopup(viewManager, receiptPrinter, progressBar));
        }
Exemple #14
0
 private void OpenIikoSite(IViewManager viewManager, IReceiptPrinter receiptPrinter, IProgressBar progressBar)
 {
     using (var process = new Process
     {
         EnableRaisingEvents = false,
         StartInfo = { FileName = @"https://iiko.github.io/front.api.doc/" }
     })
     {
         process.Start();
     }
 }
        private void CafeSessionClosing([NotNull] IReceiptPrinter printer)
        {
            PluginContext.Log.Info("Cafe Session Closing.");
            var slip = new ReceiptSlip
            {
                Doc = new XElement(Tags.Doc,
                                   new XElement(Tags.Center, PaymentSystemKey),
                                   new XElement(Tags.Center, "Cafe session closed."))
            };

            printer.Print(slip);
        }
Exemple #16
0
        private void ClaimPOSDevices()
        {
            //  open (if not already opened), claim and enable the cash drawer and receipt printer.
            ICashDrawer drawer = _posDeviceManager.GetCashDrawer();

            drawer.Claim();
            drawer.Enable();
            IReceiptPrinter printer = _posDeviceManager.GetReceiptPrinter();

            printer.Claim();
            printer.Enable();
        }
Exemple #17
0
        private static void ShowListPopup(IViewManager viewManager, IReceiptPrinter receiptPrinter)
        {
            var list = new List <string> {
                "Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"
            };

            var selectedItem = list[2];
            var inputResult  = viewManager.ShowChooserPopup("Select color", list, i => i, selectedItem, ButtonWidth.Narrower);

            ShowNotification(inputResult == null
                    ? "Nothing"
                    : $"Selected : {inputResult}");
        }
Exemple #18
0
        /// <summary>
        /// Runs the console application
        /// </summary>
        /// <param name="serviceProvider">the service provider</param>
        private static void RunApp(ServiceProvider serviceProvider)
        {
            ShoppingCart taxItemManager = new ShoppingCart();

            bool finishedEnteringInput = false;

            while (!finishedEnteringInput)
            {
                string name = ReadTaxItemName();

                Taxable taxSelection = ReadTaxSelection(serviceProvider);

                decimal priceWithoutTax = ReadPriceWithoutTax();

                ITaxCalculator taxCalculator = serviceProvider.GetService <ITaxCalculator> ();

                IShoppingItem existingItem = taxItemManager.CheckIfItemExistsInCart(name);
                if (existingItem != null)
                {
                    Console.WriteLine();
                    Console.WriteLine($"Item with name {existingItem.ItemName} already exists, using prexisiting item price {existingItem.PriceWithoutTax}");
                    priceWithoutTax = existingItem.PriceWithoutTax;
                    taxSelection    = existingItem.Taxable;
                }

                ShoppingItem taxableItem = new ShoppingItem(
                    taxSelection,
                    priceWithoutTax,
                    name,
                    taxCalculator
                    );

                taxItemManager.Add(taxableItem);

                Console.WriteLine();
                Console.Write("Add another item? y/n: ");

                ConsoleKeyInfo key = Console.ReadKey();
                if (key.KeyChar == 'n')
                {
                    finishedEnteringInput = true;
                }

                Console.WriteLine();
            }
            IReceiptPrinter receiptPrinter = serviceProvider.GetService <IReceiptPrinter> ();

            receiptPrinter.PrintReceipt(taxItemManager.TaxableItems);
        }
Exemple #19
0
        private void ShowListPopup(IViewManager viewManager, IReceiptPrinter receiptPrinter, IProgressBar progressBar)
        {
            var list = new List <string> {
                "Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"
            };

            var selectedItem = list[2];
            var inputResult  = viewManager.ShowChooserPopup("Select color", list, i => i, selectedItem, ButtonWidth.Narrower);

            PluginContext.Operations.AddNotificationMessage(
                inputResult == null
                    ? "Nothing"
                    : string.Format("Selected : {0}", inputResult),
                "SamplePlugin",
                TimeSpan.FromSeconds(15));
        }
        // Implementation of collect data method. Executes after plug-in payment item is added to the order on payment page or on preliminary payments page.
        // To do operations with order that is currently edited by operator, we need special operationService. Do NOT use it after method returns.
        public void OnPaymentAdded(IOrder order, IPaymentItem paymentItem, [NotNull] IUser cashier, [NotNull] IOperationService operations, IReceiptPrinter printer, IViewManager viewManager,
                                   IPaymentDataContext context)
        {
            switch (order.Status)
            {
            case OrderStatus.New:
                // let's add a gift product to the first guest
                var credentials = operations.GetCredentials();

                var guest   = order.Guests.First();                  // lucky guest
                var product = operations.GetActiveProducts().Last(); // gift product
                operations.AddOrderProductItem(3m, product, order, guest, null, credentials);
                var orderWithGift = operations.GetOrderById(order.Id);

                //we assume our gift product is payed by our payment, so automatically add its price to payment sum.
                var giftSum = orderWithGift.ResultSum - order.ResultSum;
                paymentItem = orderWithGift.Payments.Single(p => p.Id == paymentItem.Id);
                operations.ChangePaymentItemSum(paymentItem.Sum + giftSum, giftSum, null, paymentItem, orderWithGift, credentials);
                return;

            case OrderStatus.Bill:
                // we cannot edit order widely after bill, but at least we can set possible sum range and provide initial sum value
                operations.ChangePaymentItemSum(42m, 0m, 100500m, paymentItem, order, operations.GetCredentials());
                return;

            default:
                // we don't expect payment item to be added in statuses other than new and bill
                throw new ArgumentOutOfRangeException();
            }
        }
        // Implementation of collect data method. Executes when plug-in payment item is going to be added to the order.
        public void CollectData(Guid orderId, Guid paymentTypeId, [NotNull] IUser cashier, IReceiptPrinter printer,
                                IViewManager viewManager, IPaymentDataContext context)
        {
            PluginContext.Log.InfoFormat("Collect data for order ({0})", orderId);

            // Show dialog window with magnet card slide listener and number input keyboard.
            var defaultRoomNumber = 42;
            var input             = viewManager.ShowInputDialog("Enter room number or slide card", InputDialogTypes.Card | InputDialogTypes.Number, defaultRoomNumber);

            //Cancel button pressed, cancel operation silently.
            if (input == null)
            {
                throw new PaymentActionCancelledException();
            }

            var data = string.Empty;

            // If number was typed input result is INumberInputResult
            if (input is NumberInputDialogResult roomNum)
            {
                data = roomNum.Number.ToString();
            }

            // If card was slided input result is ICardInputResult
            var card = input as CardInputDialogResult;

            if (card != null)
            {
                data = card.FullCardTrack;
            }

            //Required data is not collected, cancel operation with message box.
            if (string.IsNullOrEmpty(data))
            {
                throw new PaymentActionFailedException("Fail to collect data. This text will be shown in dialog window and storning operation will be aborted.");
            }

            // Changing the text displayed on progress bar
            viewManager.ChangeProgressBarMessage("Long action. Information for user");
            Thread.Sleep(5000);

            PluginContext.Log.InfoFormat("Data  {0}, Order id  {1}", data, orderId);

            var d = new CollectedDataDemoClass {
                Data = data, IsCard = card != null
            };

            context.SetRollbackData(d);
        }
 // Implementation of preliminary payment editing method. Executes when plug-in preliminary payment item is going to be edited on preliminary payments page,
 // immediately after user presses the edit button.
 public bool OnPreliminaryPaymentEditing(IOrder order, IPaymentItem paymentItem, IUser cashier, IOperationService operationService,
                                         IReceiptPrinter printer, IViewManager viewManager, IPaymentDataContext context)
 {
     //enabled standard numpad editing.
     return(true);
 }
        // Implementation of return payment method. Executes when order contains processed plug-in payment item and order is storning.
        public void ReturnPayment(decimal sum, Guid?orderId, Guid paymentTypeId, Guid transactionId, [NotNull] IPointOfSale pointOfSale, [NotNull] IUser cashier, IReceiptPrinter printer,
                                  IViewManager viewManager, IPaymentDataContext context)
        {
            PluginContext.Log.InfoFormat("Order id  {0}", orderId);
            var data = context.GetRollbackData <CollectedDataDemoClass>();
            var slip = new ReceiptSlip
            {
                Doc = new XElement(Tags.Doc,
                                   new XElement(Tags.Pair,
                                                new XAttribute(Data.Cheques.Attributes.Left, "Return"),
                                                new XAttribute(Data.Cheques.Attributes.Right, PaymentSystemKey),
                                                new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                   new XElement(Tags.Pair,
                                                new XAttribute(Data.Cheques.Attributes.Left, "Transaction ID"),
                                                new XAttribute(Data.Cheques.Attributes.Right, transactionId.ToString()),
                                                new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                   new XElement(Tags.Pair,
                                                new XAttribute(Data.Cheques.Attributes.Left, "was card"),
                                                new XAttribute(Data.Cheques.Attributes.Right, data != null && data.IsCard ? "YES" : "NO"),
                                                new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)))
            };

            printer.Print(slip);

            // To abort any not successful payment action PaymentActionFailedException should be used.
            var success = true;

            if (!success)
            {
                throw new PaymentActionFailedException("Fail to storno payment. This text will be shown in dialog window and storning operation will be aborted.");
            }
        }
 public void EmergencyCancelPaymentSilently(decimal sum, Guid?orderId, Guid paymentTypeId, Guid transactionId, IPointOfSale pointOfSale, IUser cashier, IReceiptPrinter printer, IPaymentDataContext context)
 {
     PluginContext.Log.InfoFormat("Silent cancel {0}", sum);
     //there are no instances of viewManager and progressBar
     ReturnPayment(sum, orderId, paymentTypeId, transactionId, pointOfSale, cashier, printer, null, context);
 }
        public void PaySilently(decimal sum, Guid orderId, Guid paymentTypeId, Guid transactionId, IPointOfSale pointOfSale, IUser cashier, IReceiptPrinter printer, IPaymentDataContext context)
        {
            PluginContext.Log.Info("SilentPay");

            var data = context.GetCustomData();

            // You can get order from api by id via operationService.
            var order = GetOrderSafe(orderId);

            // You can't change the text displayed on progress bar while on silent pay operation
            //progressBar.ChangeMessage("Printing slip");

            // Slip to print. Slip consists of XElement children from Resto.CashServer.Agent.Print.Tags.Xml (Resto.Framework.dll)
            var slip = new ReceiptSlip
            {
                Doc =
                    new XElement(Tags.Doc,
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Payment System"),
                                              new XAttribute(Data.Cheques.Attributes.Right, PaymentSystemKey),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Transaction ID"),
                                              new XAttribute(Data.Cheques.Attributes.Right, transactionId.ToString()),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Data"),
                                              new XAttribute(Data.Cheques.Attributes.Right, data ?? "unknown"),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Order #"),
                                              new XAttribute(Data.Cheques.Attributes.Right, order?.Number.ToString() ?? "unknown"),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Full sum"),
                                              new XAttribute(Data.Cheques.Attributes.Right, order?.FullSum.ToString() ?? "unknown"),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Sum to pay"),
                                              new XAttribute(Data.Cheques.Attributes.Right, order?.ResultSum.ToString() ?? "unknown"),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Sum to process"),
                                              new XAttribute(Data.Cheques.Attributes.Right, sum.ToString()),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)))
            };

            printer.Print(slip);
            context.SetInfoForReports(data, "Custom data");
        }
 // Implementation of emergency cancel payment method. Executes when already processed plug-in payment item is removing from order.
 // May be the same method with ReturnPayment() if there is no difference in payment system guidelines.
 public void EmergencyCancelPayment(decimal sum, Guid?orderId, Guid paymentTypeId, Guid transactionId, [NotNull] IPointOfSale pointOfSale, [NotNull] IUser cashier, IReceiptPrinter printer,
                                    IViewManager viewManager, IPaymentDataContext context)
 {
     PluginContext.Log.InfoFormat("Cancel {0}", sum);
     ReturnPayment(sum, orderId, paymentTypeId, transactionId, pointOfSale, cashier, printer, viewManager, context);
 }
        // Implementation of payment method. Executes when order contains plug-in payment item type and order payment process begins.
        public void Pay(decimal sum, [NotNull] IOrder order, Guid paymentTypeId, Guid transactionId, [NotNull] IPointOfSale pointOfSale, [NotNull] IUser cashier,
                        [NotNull] IOperationService operations, IReceiptPrinter printer, IViewManager viewManager, IPaymentDataContext context)
        {
            PluginContext.Log.InfoFormat("Pay {0}", sum);

            var data = context.GetRollbackData <CollectedDataDemoClass>();

            // Changing the text displayed on progress bar on pay operation
            viewManager.ChangeProgressBarMessage("Printing slip");

            // Slip to print. Slip consists of XElement children from Resto.CashServer.Agent.Print.Tags.Xml (Resto.Framework.dll)
            var slip = new ReceiptSlip
            {
                Doc =
                    new XElement(Tags.Doc,
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Payment System"),
                                              new XAttribute(Data.Cheques.Attributes.Right, PaymentSystemKey),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Transaction ID"),
                                              new XAttribute(Data.Cheques.Attributes.Right, transactionId.ToString()),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Data"),
                                              new XAttribute(Data.Cheques.Attributes.Right, data != null ? data.Data : "unknown"),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "was card"),
                                              new XAttribute(Data.Cheques.Attributes.Right, data != null && data.IsCard ? "YES" : "NO"),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Order #"),
                                              new XAttribute(Data.Cheques.Attributes.Right, order.Number.ToString()),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Full sum"),
                                              new XAttribute(Data.Cheques.Attributes.Right, order.FullSum.ToString()),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Sum to pay"),
                                              new XAttribute(Data.Cheques.Attributes.Right, order.ResultSum.ToString()),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)),
                                 new XElement(Tags.Pair,
                                              new XAttribute(Data.Cheques.Attributes.Left, "Sum to process"),
                                              new XAttribute(Data.Cheques.Attributes.Right, sum.ToString()),
                                              new XAttribute(Data.Cheques.Attributes.Fit, Data.Cheques.Attributes.Right)))
            };

            printer.Print(slip);
            context.SetInfoForReports(data?.Data, "Test Card Type");

            var donationType = operations.GetDonationTypesCompatibleWith(order).FirstOrDefault(dt => dt.PaymentTypes.Any(pt => pt.Kind == PaymentTypeKind.External));

            if (donationType != null)
            {
                var paymentType    = donationType.PaymentTypes.First(x => x.Kind == PaymentTypeKind.External && x.Name == "SampleApiPayment");
                var additionalData = new ExternalPaymentItemAdditionalData {
                    CustomData = Serializer.Serialize(new PaymentAdditionalData {
                        SilentPay = true
                    })
                };
                var credentials = operations.GetCredentials();

                operations.AddDonation(credentials, order, donationType, paymentType, additionalData, false, order.ResultSum / 2);
            }
        }
 public bool OnPreliminaryPaymentEditing(IOrder order, IPaymentItem paymentItem, IUser cashier, IOperationService operationService,
                                         IReceiptPrinter printer, IViewManager viewManager, IPaymentDataContext context, IProgressBar progressBar)
 {
     PluginContext.Log.Info($"=== OnPreliminaryPaymentEditing");
     return(true);
 }
 public void OnPaymentAdded(IOrder order, IPaymentItem paymentItem, IUser cashier, IOperationService operations, IReceiptPrinter printer,
                            IViewManager viewManager, IPaymentDataContext context, IProgressBar progressBar)
 {
     PluginContext.Log.Info($"=== OnPaymentAdded");
 }
 public void ReturnPaymentWithoutOrder(decimal sum, Guid paymentTypeId, IPointOfSale pointOfSale,
                                       IUser cashier, IReceiptPrinter printer, IViewManager viewManager)
 {
     // if you need to implement return payment without iiko order, you should register your IExternalPaymentProcessor as 'canProcessPaymentReturnWithoutOrder = true'
     throw new PaymentActionFailedException("Not supported action");
 }
 public void ReturnPayment(decimal sum, Guid?orderId, Guid paymentTypeId, Guid transactionId, IPointOfSale pointOfSale, IUser cashier,
                           IReceiptPrinter printer, IViewManager viewManager, IPaymentDataContext context, IProgressBar progressBar)
 {
     PluginContext.Log.Info($"=== ReturnPayment {sum}");
 }