{"record":{"id":"5c859ad070227ec8","repo":"nopSolutions/nopCommerce","slug":"plugin-not-configured-5c859a","errorCode":null,"errorMessage":"Plugin not configured","messagePattern":"Plugin not configured","errorType":"exception","errorClass":"NopException","httpStatus":null,"severity":"critical","filePath":"src/Plugins/Nop.Plugin.Payments.PayPalCommerce/Services/PayPalCommerceServiceManager.cs","lineNumber":1521,"sourceCode":"    #endregion\n\n    #region Orders\n\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","sourceCodeStart":1503,"sourceCodeEnd":1539,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Plugins/Nop.Plugin.Payments.PayPalCommerce/Services/PayPalCommerceServiceManager.cs#L1503-L1539","documentation":"Thrown in GetOrderAsync when IsConfigured(settings) returns false, meaning the PayPal Commerce plugin lacks the required ClientId and SecretKey. Without these credentials, no API call to PayPal can be made to retrieve order information.","triggerScenarios":"GetOrderAsync is called and IsConfigured(settings) returns false because settings.ClientId or settings.SecretKey (or both) are null or empty.","commonSituations":"Plugin was installed but never configured with PayPal API credentials; credentials were cleared during a settings reset; environment-specific configuration (dev/staging/prod) has missing credentials; onboarding was incomplete and credentials were never persisted.","solutions":["Complete plugin configuration by entering ClientId and SecretKey in the PayPal Commerce plugin settings","Run the PayPal onboarding flow to obtain and store credentials automatically","Verify credentials are persisted correctly by checking the plugin settings in the database","Ensure configuration is not environment-specific and missing in the current deployment"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify plugin configuration before order operations\nif (!PayPalCommerceServiceManager.IsConfigured(settings))\n{\n    _logger.Warning(\"PayPal Commerce plugin not configured\");\n    return Error(\"Payment method not available\");\n}","typeGuard":"static bool IsPluginReady(PayPalCommerceSettings settings)\n    => !string.IsNullOrEmpty(settings?.ClientId)\n       && !string.IsNullOrEmpty(settings.SecretKey);","tryCatchPattern":"var (order, error) = await manager.GetOrderAsync(settings, orderId);\nif (!string.IsNullOrEmpty(error) && error == \"Plugin not configured\")\n    return View(\"PluginConfigurationRequired\");","preventionTips":["Complete PayPal onboarding before activating the payment method on the storefront","Hide PayPal Commerce from customers until IsConfigured returns true","Include credential validation in deployment verification"],"tags":["configuration","credentials","paypal-commerce","nopcommerce","onboarding"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}