{"record":{"id":"f7a8ebc323726cd7","repo":"nopSolutions/nopCommerce","slug":"not-supported-recurring-payment-type","errorCode":null,"errorMessage":"Not supported recurring payment type","messagePattern":"Not supported recurring payment type","errorType":"validation","errorClass":"NopException","httpStatus":null,"severity":"error","filePath":"src/Libraries/Nop.Services/Orders/OrderProcessingService.cs","lineNumber":1419,"sourceCode":"        {\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\n    /// <param name=\"details\">Place order container</param>\r\n    /// <param name=\"order\">Order</param>\r\n    /// <returns>A task that represents the asynchronous operation</returns>\r","sourceCodeStart":1401,"sourceCodeEnd":1437,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Libraries/Nop.Services/Orders/OrderProcessingService.cs#L1401-L1437","documentation":"Default (_ =>) arm of the switch on RecurringPaymentType in GetProcessPaymentResultAsync. It guards against a future/unknown enum value returned by GetRecurringPaymentTypeAsync that is neither NotSupported, Manual, nor Automatic - a defensive exhaustiveness check.","triggerScenarios":"A custom payment plugin returns a RecurringPaymentType value outside the three known cases (e.g. a plugin compiled against a newer nopCommerce version that added a new enum member). Practically unreachable with the stock enum but thrown if a plugin misbehaves.","commonSituations":"Version mismatch between the payment plugin DLL and the nopCommerce core; a third-party plugin overriding GetRecurringPaymentTypeAsync to return an invalid cast; corrupt plugin build.","solutions":["Ensure the payment plugin is built against the same nopCommerce version as the running site.","Update or replace the plugin returning an unexpected recurring type.","Audit custom plugin overrides of GetRecurringPaymentTypeAsync to return only NotSupported/Manual/Automatic."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"bool IsKnownRecurringType(RecurringPaymentType t)\n    => t == RecurringPaymentType.NotSupported\n       || t == RecurringPaymentType.Manual\n       || t == RecurringPaymentType.Automatic;","tryCatchPattern":"try\n{\n    await _orderProcessingService.PlaceOrderAsync(processPaymentRequest, details);\n}\ncatch (NopException ex) when (ex.Message == \"Not supported recurring payment type\")\n{\n    _logger.LogError(ex, \"Plugin {Plugin} returned an unknown RecurringPaymentType\",\n        processPaymentRequest.PaymentMethodSystemName);\n    return BadRequest(\"Payment plugin is incompatible with this nopCommerce version.\");\n}","preventionTips":["Keep payment plugin assemblies version-aligned with the nopCommerce core.","Audit custom plugin overrides of GetRecurringPaymentTypeAsync to return only the documented enum values.","Run plugin compatibility checks during deployment."],"tags":["payment","recurring","plugin","version-mismatch","defensive","nopcommerce"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}