nopSolutions/nopCommerce · error · NopException
Payment method couldn't be loaded
Error message
Payment method couldn't be loaded
What it means
Thrown inside GetProcessPaymentResultAsync when _paymentPluginManager.LoadPluginBySystemNameAsync returns null for the requested PaymentMethodSystemName. This means nopCommerce could not resolve any installed/configured payment plugin matching the system name stored on the payment request, so payment processing cannot proceed.
Source
Thrown at src/Libraries/Nop.Services/Orders/OrderProcessingService.cs:1405
/// Get process payment result
/// </summary>
/// <param name="processPaymentRequest">Process payment request</param>
/// <param name="details">Place order container</param>
/// <returns>
/// A task that represents the asynchronous operation
/// The task result contains the
/// </returns>
protected virtual async Task<ProcessPaymentResult> GetProcessPaymentResultAsync(ProcessPaymentRequest processPaymentRequest, PlaceOrderContainer details)
{
//process payment
ProcessPaymentResult processPaymentResult;
//check if is payment workflow required
if (await IsPaymentWorkflowRequiredAsync(details.Cart))
{
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
View on GitHub (pinned to 64bdf2ff08)
Solutions
- Verify the payment method is installed and marked active in Admin > Configuration > Payment methods for the relevant store.
- Check processPaymentRequest.PaymentMethodSystemName is non-empty and matches the plugin's exact system name (case-sensitive).
- Redeploy the plugin assembly to the Plugins directory if it was removed during deployment.
- Clear stale customer sessions/checkout state that reference an uninstalled method.
Example fix
// before
var pm = await _paymentPluginManager.LoadPluginBySystemNameAsync(processPaymentRequest.PaymentMethodSystemName, customer, storeId);
// after
if (string.IsNullOrWhiteSpace(processPaymentRequest.PaymentMethodSystemName))
return Error("No payment method selected.");
var pm = await _paymentPluginManager.LoadPluginBySystemNameAsync(processPaymentRequest.PaymentMethodSystemName, customer, storeId);
if (pm is null || !_paymentPluginManager.IsPluginActive(pm))
return Error($"Payment method '{processPaymentRequest.PaymentMethodSystemName}' is unavailable."); Defensive patterns
Strategy: validation
Validate before calling
if (string.IsNullOrWhiteSpace(processPaymentRequest.PaymentMethodSystemName))
return Error("Select a payment method.");
var pm = await _paymentPluginManager
.LoadPluginBySystemNameAsync(processPaymentRequest.PaymentMethodSystemName, customer, storeId);
if (pm is null)
return Error($"Payment method '{processPaymentRequest.PaymentMethodSystemName}' is unavailable.");
await _orderProcessingService.PlaceOrderAsync(processPaymentRequest, details); Type guard
async Task<bool> PaymentMethodResolvesAsync(string systemName, Customer customer, int storeId)
{
if (string.IsNullOrWhiteSpace(systemName)) return false;
var pm = await _paymentPluginManager.LoadPluginBySystemNameAsync(systemName, customer, storeId);
return pm is not null;
} Try / catch
try
{
await _orderProcessingService.PlaceOrderAsync(processPaymentRequest, details);
}
catch (NopException ex) when (ex.Message == "Payment method couldn't be loaded")
{
return BadRequest("The selected payment method is no longer available. Please choose another.");
} Prevention
- Render only active, resolvable payment methods at checkout via LoadActivePluginsAsync so customers cannot select a dead one.
- Persist PaymentMethodSystemName only from the validated active set, never trust a stale session value.
- After deploying/uninstalling a plugin, clear checkout sessions that reference it.
When it happens
Trigger: PlaceOrderAsync with processPaymentRequest.PaymentMethodSystemName that is empty, mistyped, or refers to an uninstalled/disabled plugin. Also triggered when the plugin assembly is missing from /Plugins or the plugin record was deleted from the DB while the customer's session still references it.
Common situations: Plugin was uninstalled but customers have stale checkout sessions pointing at it; configuration moved between environments without deploying plugins; a payment provider was renamed across versions; multi-store setup where the plugin is not enabled for the current store.
Related errors
- Payment method is not active
- Payment method couldn't be loaded
- Selected payment method can't be parsed
- Recurring payments are not supported by selected payment met
- Not supported recurring payment type
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/bc977ab13db6dc72.
Report an issue: GitHub.