nopSolutions/nopCommerce · error · NopException
Not supported recurring payment type
Error message
Not supported recurring payment type
What it means
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.
Source
Thrown at src/Libraries/Nop.Services/Orders/OrderProcessingService.cs:1419
{
var customer = await _customerService.GetCustomerByIdAsync(processPaymentRequest.CustomerId);
var paymentMethod = await _paymentPluginManager
.LoadPluginBySystemNameAsync(processPaymentRequest.PaymentMethodSystemName, customer, processPaymentRequest.StoreId)
?? throw new NopException("Payment method couldn't be loaded");
//ensure that payment method is active
if (!_paymentPluginManager.IsPluginActive(paymentMethod))
throw new NopException("Payment method is not active");
if (details.IsRecurringShoppingCart)
{
//recurring cart
processPaymentResult = (await _paymentService.GetRecurringPaymentTypeAsync(processPaymentRequest.PaymentMethodSystemName)) switch
{
RecurringPaymentType.NotSupported => throw new NopException("Recurring payments are not supported by selected payment method"),
RecurringPaymentType.Manual or
RecurringPaymentType.Automatic => await _paymentService.ProcessRecurringPaymentAsync(processPaymentRequest),
_ => throw new NopException("Not supported recurring payment type"),
};
}
else
//standard cart
processPaymentResult = await _paymentService.ProcessPaymentAsync(processPaymentRequest);
}
else
//payment is not required
processPaymentResult = new ProcessPaymentResult { NewPaymentStatus = PaymentStatus.Paid };
return processPaymentResult;
}
/// <summary>
/// Save gift card usage history
/// </summary>
/// <param name="details">Place order container</param>
/// <param name="order">Order</param>
/// <returns>A task that represents the asynchronous operation</returns>
View on GitHub (pinned to 64bdf2ff08)
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.
Defensive patterns
Strategy: try-catch
Type guard
bool IsKnownRecurringType(RecurringPaymentType t)
=> t == RecurringPaymentType.NotSupported
|| t == RecurringPaymentType.Manual
|| t == RecurringPaymentType.Automatic; Try / catch
try
{
await _orderProcessingService.PlaceOrderAsync(processPaymentRequest, details);
}
catch (NopException ex) when (ex.Message == "Not supported recurring payment type")
{
_logger.LogError(ex, "Plugin {Plugin} returned an unknown RecurringPaymentType",
processPaymentRequest.PaymentMethodSystemName);
return BadRequest("Payment plugin is incompatible with this nopCommerce version.");
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Recurring payments are not supported by selected payment met
- processPaymentResult is not available
- Payment method couldn't be loaded
- Payment method is not active
- Selected payment method can't be parsed
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/f7a8ebc323726cd7.
Report an issue: GitHub.