{"record":{"id":"162cf78482e5ab82","repo":"nopSolutions/nopCommerce","slug":"recurring-payments-are-not-supported-by-selected-p","errorCode":null,"errorMessage":"Recurring payments are not supported by selected payment method","messagePattern":"Recurring payments are not supported by selected payment method","errorType":"validation","errorClass":"NopException","httpStatus":null,"severity":"error","filePath":"src/Libraries/Nop.Services/Orders/OrderProcessingService.cs","lineNumber":1416,"sourceCode":"        ProcessPaymentResult processPaymentResult;\r\n        //check if is payment workflow required\r\n        if (await IsPaymentWorkflowRequiredAsync(details.Cart))\r\n        {\r\n            var customer = await _customerService.GetCustomerByIdAsync(processPaymentRequest.CustomerId);\r\n            var paymentMethod = await _paymentPluginManager\r\n                                    .LoadPluginBySystemNameAsync(processPaymentRequest.PaymentMethodSystemName, customer, processPaymentRequest.StoreId)\r\n                                ?? throw new NopException(\"Payment method couldn't be loaded\");\r\n\r\n            //ensure that payment method is active\r\n            if (!_paymentPluginManager.IsPluginActive(paymentMethod))\r\n                throw new NopException(\"Payment method is not active\");\r\n\r\n            if (details.IsRecurringShoppingCart)\r\n            {\r\n                //recurring cart\r\n                processPaymentResult = (await _paymentService.GetRecurringPaymentTypeAsync(processPaymentRequest.PaymentMethodSystemName)) switch\r\n                {\r\n                    RecurringPaymentType.NotSupported => throw new NopException(\"Recurring payments are not supported by selected payment method\"),\r\n                    RecurringPaymentType.Manual or\r\n                        RecurringPaymentType.Automatic => await _paymentService.ProcessRecurringPaymentAsync(processPaymentRequest),\r\n                    _ => throw new NopException(\"Not supported recurring payment type\"),\r\n                };\r\n            }\r\n            else\r\n                //standard cart\r\n                processPaymentResult = await _paymentService.ProcessPaymentAsync(processPaymentRequest);\r\n        }\r\n        else\r\n            //payment is not required\r\n            processPaymentResult = new ProcessPaymentResult { NewPaymentStatus = PaymentStatus.Paid };\r\n        return processPaymentResult;\r\n    }\r\n\r\n    /// <summary>\r\n    /// Save gift card usage history\r\n    /// </summary>\r","sourceCodeStart":1398,"sourceCodeEnd":1434,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Libraries/Nop.Services/Orders/OrderProcessingService.cs#L1398-L1434","documentation":"Thrown in the recurring-cart branch of GetProcessPaymentResultAsync when the selected payment method reports RecurringPaymentType.NotSupported. nopCommerce supports recurring billing only for plugins that explicitly declare Manual or Automatic recurring capability; a standard one-shot gateway cannot service a recurring cart.","triggerScenarios":"Customer builds a cart containing a product with IsRecurring=true (recurring product attribute) and selects a payment method (e.g. CashOnDelivery, PayPal Standard without recurring) that returns RecurringPaymentType.NotSupported from GetRecurringPaymentTypeAsync.","commonSituations":"Store sells subscription products but only standard payment gateways are installed; admin enabled a recurring product without enabling a recurring-capable gateway; switching the default payment method broke existing subscription checkouts.","solutions":["Install and enable a payment plugin that supports recurring payments (e.g. a gateway implementing GetRecurringPaymentType returning Manual or Automatic).","Restrict payment method selection at checkout to recurring-capable plugins when the cart contains recurring products.","If subscriptions are unintended, mark the product as non-recurring (IsRecurring=false)."],"exampleFix":"// before\nvar methods = await _paymentPluginManager.LoadActivePluginsAsync(customer, storeId);\n\n// after\nvar methods = await _paymentPluginManager.LoadActivePluginsAsync(customer, storeId);\nif (cart.Any(item => item.Product.IsRecurring))\n{\n    methods = methods.Where(async p =>\n        await _paymentService.GetRecurringPaymentTypeAsync(p.PluginDescriptor.SystemName) != RecurringPaymentType.NotSupported);\n}\nif (!methods.Any())\n    return Error(\"No recurring-capable payment method available.\");","handlingStrategy":"validation","validationCode":"var isRecurringCart = cart.Any(i => i.Product.IsRecurring);\nif (isRecurringCart)\n{\n    var rpt = await _paymentService.GetRecurringPaymentTypeAsync(processPaymentRequest.PaymentMethodSystemName);\n    if (rpt == RecurringPaymentType.NotSupported)\n        return Error(\"Selected payment method does not support recurring billing.\");\n}\n\nawait _orderProcessingService.PlaceOrderAsync(processPaymentRequest, details);","typeGuard":"async Task<bool> SupportsRecurringAsync(string systemName)\n    => await _paymentService.GetRecurringPaymentTypeAsync(systemName) != RecurringPaymentType.NotSupported;","tryCatchPattern":"try\n{\n    await _orderProcessingService.PlaceOrderAsync(processPaymentRequest, details);\n}\ncatch (NopException ex) when (ex.Message.Contains(\"Recurring payments are not supported\"))\n{\n    ModelState.AddModelError(string.Empty, \"Please choose a recurring-capable payment method.\");\n    return View(model);\n}","preventionTips":["When a cart contains recurring products, restrict the displayed payment methods to those returning Manual/Automatic.","Document which installed gateways support recurring so admins configure subscription products correctly.","Validate recurring compatibility in PlaceOrderDetails preparation, before reaching the payment switch."],"tags":["payment","recurring","subscription","plugin","nopcommerce"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}