{"record":{"id":"b4274b6c5f4bf379","repo":"nopSolutions/nopCommerce","slug":"vault-disabled","errorCode":null,"errorMessage":"Vault disabled","messagePattern":"Vault disabled","errorType":"exception","errorClass":"NopException","httpStatus":null,"severity":"error","filePath":"src/Plugins/Nop.Plugin.Payments.PayPalCommerce/Services/PayPalCommerceServiceManager.cs","lineNumber":1648,"sourceCode":"        {\n            if (!IsConfigured(settings))\n                throw new NopException(\"Plugin not configured\");\n\n            if (string.IsNullOrEmpty(settings.MerchantId))\n                throw new NopException(\"Merchant PayPal ID not set\");\n\n            var details = await PrepareCartDetailsAsync(placement);\n\n            var savedPaymentToken = await _tokenService.GetByIdAsync(cardId ?? 0);\n            if (savedPaymentToken is not null && savedPaymentToken.CustomerId != details.Customer.Id)\n                throw new NopException(\"Card details not found\");\n\n            var isGuest = await _customerService.IsGuestAsync(details.Customer);\n            var isRecurring = await _shoppingCartService.ShoppingCartIsRecurringAsync(details.Cart);\n            if (isRecurring)\n            {\n                if (!settings.UseVault)\n                    throw new NopException(\"Vault disabled\");\n\n                if (isGuest)\n                    throw new NopException(\"Anonymous checkout disabled for recurring items\");\n\n                var (error, cycleLength, cyclePeriod, totalCycles) = await _shoppingCartService.GetRecurringCycleInfoAsync(details.Cart);\n                if (!string.IsNullOrEmpty(error))\n                    throw new NopException(error);\n            }\n\n            var paymentRequest = await _orderProcessingService.GetProcessPaymentRequestAsync();\n            var (order, _) = await GetCreatedOrderAsync(settings, paymentRequest, placement, details.ShippingIsRequired, paymentSource);\n            if (paymentRequest is null || order is null)\n                paymentRequest = new();\n\n            //prepare purchase unit\n            var purchaseUnit = await PreparePurchaseUnitAsync(settings, details, paymentRequest.OrderGuid.ToString());\n\n            //whether we should create a new order","sourceCodeStart":1630,"sourceCodeEnd":1666,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Plugins/Nop.Plugin.Payments.PayPalCommerce/Services/PayPalCommerceServiceManager.cs#L1630-L1666","documentation":"Thrown in CreateOrderAsync when the cart contains recurring items but the Vault feature is disabled in plugin settings. Recurring (subscription) payments require PayPal Vault to store and reuse payment tokens across billing cycles; without Vault, recurring billing cannot be processed.","triggerScenarios":"ShoppingCartIsRecurringAsync returns true for the cart, and settings.UseVault is false.","commonSituations":"Store sells subscription or recurring products but Vault was not enabled in plugin configuration; Vault was disabled after recurring products were added; the admin was unaware that Vault is a prerequisite for recurring billing with PayPal Commerce.","solutions":["Enable Vault in PayPal Commerce plugin settings (UseVault = true)","Ensure the PayPal account is approved for Vault usage (may require additional PayPal account verification)","If Vault cannot be enabled, remove recurring products or use a different payment processor for subscriptions","Document that Vault must be enabled before adding recurring products to the catalog"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check if cart is recurring and Vault is enabled before order creation\nvar isRecurring = await _shoppingCartService.ShoppingCartIsRecurringAsync(cart);\nif (isRecurring && !settings.UseVault)\n{\n    return Error(\"Vault must be enabled for recurring payments\");\n}","typeGuard":"static bool CanProcessRecurring(PayPalCommerceSettings settings, bool isRecurring)\n    => !isRecurring || settings.UseVault;","tryCatchPattern":"var (order, error) = await manager.CreateOrderAsync(settings, placement, paymentSource, cardId, saveCard);\nif (!string.IsNullOrEmpty(error) && error == \"Vault disabled\")\n    return BadRequest(\"Recurring payments require Vault to be enabled\");","preventionTips":["Enable Vault when adding recurring products to the catalog","Add a configuration check in admin when recurring products exist but Vault is off","Document Vault as a prerequisite for subscription products"],"tags":["recurring","vault","subscriptions","configuration","paypal-commerce","nopcommerce"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}