{"record":{"id":"8a46ab6fd547619b","repo":"nopSolutions/nopCommerce","slug":"order-payment-info-not-found","errorCode":null,"errorMessage":"Order payment info not found","messagePattern":"Order payment info not found","errorType":"exception","errorClass":"NopException","httpStatus":null,"severity":"error","filePath":"src/Plugins/Nop.Plugin.Payments.PayPalCommerce/Services/PayPalCommerceServiceManager.cs","lineNumber":1524,"sourceCode":"\n    /// <summary>\n    /// Get the order by id\n    /// </summary>\n    /// <param name=\"settings\">Plugin settings</param>\n    /// <param name=\"orderId\">Order id</param>\n    /// <returns>\n    /// A task that represents the asynchronous operation\n    /// The task result contains the order; error message if exists\n    /// </returns>\n    public async Task<(Order Order, string Error)> GetOrderAsync(PayPalCommerceSettings settings, string orderId)\n    {\n        return await HandleFunctionAsync(async () =>\n        {\n            if (!IsConfigured(settings))\n                throw new NopException(\"Plugin not configured\");\n\n            var paymentRequest = await _orderProcessingService.GetProcessPaymentRequestAsync()\n                ?? throw new NopException(\"Order payment info not found\");\n\n            var orderIdKey = await _localizationService.GetResourceAsync(\"Plugins.Payments.PayPalCommerce.Order.Id\");\n            if (!paymentRequest.CustomValues.TryGetValue(orderIdKey, out var orderIdValue) ||\n                !string.Equals(orderIdValue.Value, orderId, StringComparison.InvariantCultureIgnoreCase))\n                throw new NopException(\"Failed to get PayPal order info\");\n\n            var placementKey = await _localizationService.GetResourceAsync(\"Plugins.Payments.PayPalCommerce.Order.Placement\");\n            if (!paymentRequest.CustomValues.TryGetValue(placementKey, out var placementValue) ||\n                !Enum.TryParse<ButtonPlacement>(placementValue.Value, out var placement))\n            {\n                throw new NopException(\"Failed to get PayPal order info\");\n            }\n\n            var order = await _httpClient.RequestAsync<GetOrderRequest, GetOrderResponse>(new GetOrderRequest { OrderId = orderId }, settings);\n\n            return order;\n        });\n    }","sourceCodeStart":1506,"sourceCodeEnd":1542,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Plugins/Nop.Plugin.Payments.PayPalCommerce/Services/PayPalCommerceServiceManager.cs#L1506-L1542","documentation":"Thrown in GetOrderAsync when _orderProcessingService.GetProcessPaymentRequestAsync() returns null. The process payment request carries the customer's checkout state across the payment flow; if it is missing, the plugin cannot correlate the PayPal order with the nopCommerce checkout session.","triggerScenarios":"GetOrderAsync calls GetProcessPaymentRequestAsync() which returns null, meaning no payment request was initialized for the current checkout session.","commonSituations":"Checkout session expired before the PayPal redirect returned; the payment request was cleared by a concurrent checkout attempt or session reset; customer opened multiple checkout tabs and one cleared the session; custom checkout flow that does not initialize the process payment request before redirecting to PayPal.","solutions":["Ensure the checkout flow initializes the process payment request before redirecting to PayPal","Check session timeout settings to ensure they are long enough for PayPal redirects","Prevent concurrent checkout sessions that may clear payment state","Redirect the customer to restart checkout if the payment session is lost"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify payment request exists before calling GetOrderAsync\nvar paymentRequest = await _orderProcessingService.GetProcessPaymentRequestAsync();\nif (paymentRequest is null)\n{\n    //session lost — restart checkout\n    return RedirectToRoute(\"Checkout\");\n}","typeGuard":"static bool HasPaymentRequest(ProcessPaymentRequest request)\n    => request is not null;","tryCatchPattern":"var (order, error) = await manager.GetOrderAsync(settings, orderId);\nif (!string.IsNullOrEmpty(error) && error == \"Order payment info not found\")\n    return RedirectToRoute(\"Checkout\"); // restart checkout flow","preventionTips":["Ensure the checkout flow initializes the process payment request before PayPal redirect","Set session timeouts long enough to accommodate PayPal redirect round-trips","Prevent concurrent checkout sessions from clearing payment state"],"tags":["checkout","payment-request","session","paypal-commerce","nopcommerce"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}