Example #1
0
        public virtual Task <HttpWebResponse> RemoveRecurringOrderTemplateLineItem(RemoveRecurringOrderTemplateLineItemParam param)
        {
            if (param == null)
            {
                throw new ArgumentNullException(nameof(param));
            }

            var request = new DeleteRecurringOrderLineItemsRequest()
            {
                CustomerId = param.CustomerId,
                ScopeId    = param.ScopeId,
                RecurringOrderLineItemIds = new List <Guid>()
                {
                    param.LineItemId.ToGuid()
                }
            };

            return(OvertureClient.SendAsync(request));
        }
Example #2
0
        public virtual async Task <RecurringOrderTemplatesViewModel> RemoveRecurringOrderTemplateLineItemAsync(RemoveRecurringOrderTemplateLineItemParam param)
        {
            if (!RecurringOrdersSettings.Enabled)
            {
                return(new RecurringOrderTemplatesViewModel());
            }

            if (param == null)
            {
                throw new ArgumentNullException(nameof(param), ArgumentNullMessageFormatter.FormatErrorMessage(nameof(param)));
            }

            await RecurringOrderRepository.RemoveRecurringOrderTemplateLineItem(param).ConfigureAwait(false);

            return(await GetRecurringOrderTemplatesViewModelAsync(new GetRecurringOrderTemplatesParam {
                Scope = param.ScopeId,
                CustomerId = param.CustomerId,
                CultureInfo = param.Culture,
                BaseUrl = param.BaseUrl
            }));
        }