public PaymentPayPalStandardController(IWorkContext workContext, IStoreService storeService, ISettingService settingService, IPaymentService paymentService, IOrderService orderService, IOrderProcessingService orderProcessingService, IOrderRecurringPayment orderRecurringPayment, ILocalizationService localizationService, IStoreContext storeContext, ILogger logger, IWebHelper webHelper, IPermissionService permissionService, PaymentSettings paymentSettings) { _workContext = workContext; _storeService = storeService; _settingService = settingService; _paymentService = paymentService; _orderService = orderService; _orderProcessingService = orderProcessingService; _orderRecurringPayment = orderRecurringPayment; _localizationService = localizationService; _storeContext = storeContext; _logger = logger; _webHelper = webHelper; _permissionService = permissionService; _paymentSettings = paymentSettings; }
public virtual async Task <IActionResult> CancelRecurringPayment(IFormCollection form, [FromServices] IOrderRecurringPayment orderRecurringPayment) { if (!_workContext.CurrentCustomer.IsRegistered()) { return(Challenge()); } //get recurring payment identifier string recurringPaymentId = ""; foreach (var formValue in form.Keys) { if (formValue.StartsWith("cancelRecurringPayment", StringComparison.OrdinalIgnoreCase)) { recurringPaymentId = formValue.Substring("cancelRecurringPayment".Length); } } var recurringPayment = await _orderService.GetRecurringPaymentById(recurringPaymentId); if (recurringPayment == null) { return(RedirectToRoute("CustomerOrders")); } if (await orderRecurringPayment.CanCancelRecurringPayment(_workContext.CurrentCustomer, recurringPayment)) { var errors = await orderRecurringPayment.CancelRecurringPayment(recurringPayment); var model = await _mediator.Send(new GetCustomerOrderList() { Customer = _workContext.CurrentCustomer, Language = _workContext.WorkingLanguage, Store = _storeContext.CurrentStore }); model.CancelRecurringPaymentErrors = errors; return(View(model)); } else { return(RedirectToRoute("CustomerOrders")); } }
public GetCustomerOrderListHandler( IOrderService orderService, IDateTimeHelper dateTimeHelper, ILocalizationService localizationService, IOrderRecurringPayment orderRecurringPayment, ICurrencyService currencyService, IMediator mediator, IPriceFormatter priceFormatter) { _orderService = orderService; _dateTimeHelper = dateTimeHelper; _localizationService = localizationService; _orderRecurringPayment = orderRecurringPayment; _currencyService = currencyService; _priceFormatter = priceFormatter; _mediator = mediator; }
public RecurringPaymentController(IOrderService orderService, IOrderProcessingService orderProcessingService, IOrderRecurringPayment orderRecurringPayment, ILocalizationService localizationService, IWorkContext workContext, IDateTimeHelper dateTimeHelper, IPaymentService paymentService, ICustomerService customerService) { _orderService = orderService; _orderProcessingService = orderProcessingService; _orderRecurringPayment = orderRecurringPayment; _localizationService = localizationService; _workContext = workContext; _dateTimeHelper = dateTimeHelper; _paymentService = paymentService; _customerService = customerService; }