C# How to get all available Payment methods

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 year ago
Hi. How can I in C# obtain the list of all payment methods installed (or enabled)?
1 year ago
See nopCommerce_4.50.2\src\Presentation\Nop.Web\Controllers\CheckoutController.cs

            //all payment methods (do not filter by country here as it could be not specified yet)
            var paymentMethods = await (await _paymentPluginManager
                .LoadActivePluginsAsync(await _workContext.GetCurrentCustomerAsync(), (await _storeContext.GetCurrentStoreAsync()).Id))
                .WhereAwait(async pm => !await pm.HidePaymentMethodAsync(cart)).ToListAsync();

or See nopCommerce_4.50.2\src\Presentation\Nop.Web\Factories\CheckoutModelFactory.cs
where it is filtered by country

What version - strangley v4.4 calls it LoadActivePluginsAsyncAsync
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.