Пример #1
0
        public RefundResponse HandleRefund(string invoiceNumber, List <ICartItem> cartItems)
        {
            var result = new RefundResponse();

            try
            {
                var api = new Api(CurrentConfiguration);

                foreach (var cartItem in cartItems)
                {
                    api.AddArticleNumber(cartItem.Quantity, cartItem.Reference);
                }
                result.InvoiceNumber = api.CreditPart(invoiceNumber);
                result.IsSuccess     = true;
                return(result);
            }
            catch (Exception ex)
            {
                SetError(result, ex);
            }
            return(result);
        }