Migrating payment configuration forms



I'm migrating project to Commerce 14 and I'm stuck on payment configuration forms (Web Form's ascx files, implementing IGatewayControl interface). In new Commerce not only Web Forms are abandoned (ASP.NET Core requirement) but also whole Commerce Manager. How should I migrate this custom payment configuration views?

Edited, Jul 01, 2022 12:37

Hi Szymon

You can either create your own form views in edit mode using a standard mvc and an implementation of the MenuProvider.

Or you can move all your payment configuration to code and have it pull from a config json file, keyvault or on webserver itself as an app setting.

Jul 01, 2022 13:54


I need to have configuration close to provider definition (similar to "parameters" tab in Commerce Manager). Both options presented by you makes configuration more hidden and complicated for user (especially when I need diferent configuration for every language and provider).
Could you suggest different approach?  

Jul 01, 2022 14:24

What about creating a new Payment type inside Global / Commerce / Administrator / Payments

Then select your custom gateway as the class name and a custom payment object as your payment class. Then you should be able to add custom parameters via the same interface.

Edited, Jul 01, 2022 14:35


I was able to define custom classes and select them in new payment, but still don't know how to pre-define via code parameters in "Parameters" tab. Could you provide some simple code for me to better understand this solution?

Jul 07, 2022 10:44
private static void AddPaymentMethod(Guid id, string name, string systemKeyword, string description, string implementationClass, string gatewayClass,
            bool isDefault, int orderIndex, IEnumerable<IMarket> markets, CultureInfo language, PaymentMethodDto paymentMethodDto)
            var row = paymentMethodDto.PaymentMethod.AddPaymentMethodRow(id, name, description, language.TwoLetterISOLanguageName,
                            systemKeyword, true, isDefault, gatewayClass,
                            implementationClass, false, orderIndex, DateTime.Now, DateTime.Now);
            paymentMethodDto.PaymentMethodParameter.AddPaymentMethodParameterRow(row, "Parameter Name", "Parameter Value");
            var paymentMethod = new PaymentMethod(row);
            paymentMethod.MarketId.AddRange(markets.Where(x => x.IsEnabled && x.Languages.Contains(language)).Select(x => x.MarketId));
Jul 11, 2022 4:45
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.