{"record":{"id":"1d7fdbc941b0f728","repo":"nopSolutions/nopCommerce","slug":"payment-source-paymentsource-toupper-not-sup","errorCode":null,"errorMessage":"Payment source '{paymentSource.ToUpper()}' not supported","messagePattern":"Payment source '(.+?)' not supported","errorType":"exception","errorClass":"NopException","httpStatus":null,"severity":"error","filePath":"src/Plugins/Nop.Plugin.Payments.PayPalCommerce/Services/PayPalCommerceServiceManager.cs","lineNumber":1673,"sourceCode":"                    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\n            if (order is null || isRecurring)\n            {\n                var isCard = string.Equals(paymentSource, nameof(PaymentSource.Card), StringComparison.InvariantCultureIgnoreCase);\n                var isVenmo = string.Equals(paymentSource, nameof(PaymentSource.Venmo), StringComparison.InvariantCultureIgnoreCase);\n                var isApplepay = string.Equals(paymentSource, nameof(PaymentSource.ApplePay), StringComparison.InvariantCultureIgnoreCase);\n                if (isRecurring && (isVenmo || isApplepay))\n                    throw new NopException($\"Payment source '{paymentSource.ToUpper()}' not supported\");\n\n                var context = PrepareOrderContext(settings, details, paymentRequest.OrderGuid.ToString(), isApplepay);\n                var payer = await PrepareBillingDetailsAsync(settings, details);\n\n                //only registered customers can save payment tokens\n                var vault = !settings.UseVault || isGuest ? null : new VaultInstruction\n                {\n                    UsageType = VaultUsageType.MERCHANT.ToString().ToUpper(),\n                    CustomerType = VaultUsageType.CONSUMER.ToString().ToUpper(),\n                    StoreInVault = VaultInstructionType.ON_SUCCESS.ToString().ToUpper(),\n                    PermitMultiplePaymentTokens = false,\n                    UsagePattern = isRecurring ? UsagePatternType.INSTALLMENT_PREPAID.ToString().ToUpper() : null\n                };\n\n                //set payment source\n                var paymentSourceDetails = new PaymentSource();\n                if (isCard)\n                {","sourceCodeStart":1655,"sourceCodeEnd":1691,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Plugins/Nop.Plugin.Payments.PayPalCommerce/Services/PayPalCommerceServiceManager.cs#L1655-L1691","documentation":"Thrown in CreateOrderAsync when the cart has recurring items and the selected payment source is Venmo or Apple Pay. PayPal Commerce only supports card-based payments for recurring/subscription billing because Vault tokenization for recurring charges requires a card payment source; Venmo and Apple Pay do not support the required Vault tokenization pattern.","triggerScenarios":"isRecurring is true, and the paymentSource matches 'Venmo' or 'ApplePay' (case-insensitive), triggering the NopException with the payment source name uppercased in the message.","commonSituations":"Customer with recurring items in cart selected Venmo or Apple Pay as the payment method; the payment method selector did not filter out Venmo/Apple Pay for carts containing recurring products; a UI customization exposed all payment methods regardless of cart contents.","solutions":["Filter the payment method selector to only show Card for carts containing recurring items","Add a client-side check that hides or disables Venmo and Apple Pay buttons when recurring products are in the cart","Inform the customer that recurring purchases require a card payment method","Verify the PayPal button funding source configuration excludes Venmo and Apple Pay for recurring carts"],"exampleFix":"// before\nif (isRecurring && (isVenmo || isApplepay))\n    throw new NopException($\"Payment source '{paymentSource.ToUpper()}' not supported\");\n\n// after (client-side prevention)\n// In the PayPal button configuration, restrict funding for recurring carts:\n// funding: { disallowed: [paypal.FUNDING.VENMO, paypal.FUNDING.APPLEPAY] }\n// Only Card funding is allowed when cart has recurring items","handlingStrategy":"validation","validationCode":"// Restrict payment source for recurring carts before order creation\nvar isRecurring = await _shoppingCartService.ShoppingCartIsRecurringAsync(cart);\nif (isRecurring)\n{\n    var isVenmo = string.Equals(paymentSource, nameof(PaymentSource.Venmo), StringComparison.InvariantCultureIgnoreCase);\n    var isApplepay = string.Equals(paymentSource, nameof(PaymentSource.ApplePay), StringComparison.InvariantCultureIgnoreCase);\n    if (isVenmo || isApplepay)\n        paymentSource = nameof(PaymentSource.Card); // force card for recurring\n}","typeGuard":"static bool IsPaymentSourceSupportedForRecurring(string paymentSource, bool isRecurring)\n    => !isRecurring\n       || (!string.Equals(paymentSource, \"Venmo\", StringComparison.InvariantCultureIgnoreCase)\n           && !string.Equals(paymentSource, \"ApplePay\", StringComparison.InvariantCultureIgnoreCase));","tryCatchPattern":"var (order, error) = await manager.CreateOrderAsync(settings, placement, paymentSource, cardId, saveCard);\nif (!string.IsNullOrEmpty(error) && error.Contains(\"not supported\"))\n    return BadRequest($\"{error}. Please use a card for recurring payments.\");","preventionTips":["Configure PayPal button funding sources to exclude Venmo and Apple Pay for recurring carts","Add client-side logic to filter payment methods based on cart contents","Display clear messaging that recurring purchases require card payment"],"tags":["recurring","payment-source","venmo","apple-pay","vault","paypal-commerce","nopcommerce"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}