/// <summary>
        /// Prepare recurring payment model
        /// </summary>
        /// <param name="model">Recurring payment model</param>
        /// <param name="recurringPayment">Recurring payment</param>
        /// <param name="excludeProperties">Whether to exclude populating of some properties of model</param>
        /// <returns>Recurring payment model</returns>
        public virtual RecurringPaymentModel PrepareRecurringPaymentModel(RecurringPaymentModel model,
                                                                          RecurringPayment recurringPayment, bool excludeProperties = false)
        {
            if (recurringPayment == null)
            {
                return(model);
            }

            //fill in model values from the entity
            if (model == null)
            {
                model = recurringPayment.ToModel <RecurringPaymentModel>();
            }

            //convert dates to the user time
            if (recurringPayment.NextPaymentDate.HasValue)
            {
                model.NextPaymentDate = _dateTimeHelper.ConvertToUserTime(recurringPayment.NextPaymentDate.Value, DateTimeKind.Utc).ToString(CultureInfo.InvariantCulture);
            }
            model.StartDate = _dateTimeHelper.ConvertToUserTime(recurringPayment.StartDateUtc, DateTimeKind.Utc).ToString(CultureInfo.InvariantCulture);

            model.CustomerId     = recurringPayment.InitialOrder.CustomerId;
            model.InitialOrderId = recurringPayment.InitialOrder.Id;
            model.CustomerEmail  = recurringPayment.InitialOrder.Customer.IsRegistered()
                ? recurringPayment.InitialOrder.Customer.Email : _localizationService.GetResource("Admin.Customers.Guest");
            model.PaymentType = _localizationService.GetLocalizedEnum(_paymentService
                                                                      .GetRecurringPaymentType(recurringPayment.InitialOrder.PaymentMethodSystemName));
            model.CanCancelRecurringPayment = _orderProcessingService.CanCancelRecurringPayment(_workContext.CurrentCustomer, recurringPayment);

            //prepare nested search model
            PrepareRecurringPaymentHistorySearchModel(model.RecurringPaymentHistorySearchModel, recurringPayment);

            return(model);
        }