{"record":{"id":"482feb844fe51795","repo":"nopSolutions/nopCommerce","slug":"no-recurring-payment-found-with-the-specified-id","errorCode":null,"errorMessage":"No recurring payment found with the specified id","messagePattern":"No recurring payment found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/RecurringPaymentController.cs","lineNumber":138,"sourceCode":"        //try to get a recurring payment with the specified id\n        var payment = await _orderService.GetRecurringPaymentByIdAsync(id);\n        if (payment == null)\n            return RedirectToAction(\"List\");\n\n        await _orderService.DeleteRecurringPaymentAsync(payment);\n\n        _notificationService.SuccessNotification(await _localizationService.GetResourceAsync(\"Admin.RecurringPayments.Deleted\"));\n\n        return RedirectToAction(\"List\");\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Orders.RECURRING_PAYMENTS_VIEW)]\n    public virtual async Task<IActionResult> HistoryList(RecurringPaymentHistorySearchModel searchModel)\n    {\n        //try to get a recurring payment with the specified id\n        var payment = await _orderService.GetRecurringPaymentByIdAsync(searchModel.RecurringPaymentId)\n                      ?? throw new ArgumentException(\"No recurring payment found with the specified id\");\n\n        //prepare model\n        var model = await _recurringPaymentModelFactory.PrepareRecurringPaymentHistoryListModelAsync(searchModel, payment);\n\n        return Json(model);\n    }\n\n    [HttpPost, ActionName(\"Edit\")]\n    [FormValueRequired(\"processnextpayment\")]\n    [CheckPermission(StandardPermission.Orders.RECURRING_PAYMENTS_CREATE_EDIT_DELETE)]\n    public virtual async Task<IActionResult> ProcessNextPayment(int id)\n    {\n        //try to get a recurring payment with the specified id\n        var payment = await _orderService.GetRecurringPaymentByIdAsync(id);\n        if (payment == null)\n            return RedirectToAction(\"List\");\n\n        try","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/RecurringPaymentController.cs#L120-L156","documentation":"Thrown by HistoryList (POST, RECURRING_PAYMENTS_VIEW) on RecurringPaymentController when GetRecurringPaymentByIdAsync(searchModel.RecurringPaymentId) returns null. The action assembles the recurring-payment history list, which requires the parent payment, so a missing record aborts before the model factory.","triggerScenarios":"The history sub-grid for a recurring payment whose id is stale, deleted, or forged; payment removed by a cancellation/cleanup job between page load and sub-grid load; tampered RecurringPaymentId.","commonSituations":"Recurring payment deleted/expired while the detail page is open; restored DBs; fixtures; URLs from cached pages.","solutions":["Reopen the recurring-payments list and select a current payment to view history.","Return an empty grid when the payment is missing rather than 500.","Validate searchModel.RecurringPaymentId > 0 before requesting.","Avoid cancelling/deleting payments while their history tab is loading."],"exampleFix":"// before\nvar payment = await _orderService.GetRecurringPaymentByIdAsync(searchModel.RecurringPaymentId)\n              ?? throw new ArgumentException(\"No recurring payment found with the specified id\");\n\n// after\nvar payment = await _orderService.GetRecurringPaymentByIdAsync(searchModel.RecurringPaymentId);\nif (payment == null)\n    return Json(new { Data = Enumerable.Empty<object>(), Total = 0 });","handlingStrategy":"validation","validationCode":"if (searchModel.RecurringPaymentId <= 0) return Json(empty);\nvar payment = await _orderService.GetRecurringPaymentByIdAsync(searchModel.RecurringPaymentId);\nif (payment == null) return Json(empty);","typeGuard":"// N/A","tryCatchPattern":"catch (ArgumentException ex) when (ex.Message.Contains(\"No recurring payment\"))\n{ return Json(new { Data = Array.Empty<object>(), Total = 0 }); }","preventionTips":["Validate RecurringPaymentId before loading history.","Refresh the recurring-payments list after cancellations.","Return empty payloads instead of throwing."],"tags":["nopcommerce","admin-controller","not-found","recurring-payment","order","list-endpoint"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}