Umbraco.Commerce.Issues
Umbraco.Commerce.Issues copied to clipboard
Support env/app setting overrides of payment provider settings
Maybe payment provider settings require API credentials for third parties which quite often you don't want to store in the back office for everyone to see.
After speaking with Lars-erik he suggested a nice solution and suggested adding support for allow settings to be overridden by app settings / environment variables if they are present.
As an example, say a payment provider exposes a setting with the alias clientSecret then we could support a convention based lookup in app settings / env variables for something along the lines of Vendr:PaymentMethod:Alias:ClientSecret or VENDR_PAYMENTMETHOD_ALIAS_CLIENTSERET and if it exists force override whatever setting is in the back office. In the examples here the Alias part of the key would need to be the alias of the given payment provider configuration.
With this, people could easily then use environment variables on their hosting solutions to store those values securely and just have them be automatically picked up.
Only thing that would be a problem at the moment is that we would also need a store key in the attribute to identify which store the provider belongs to, so maybe something like Vendr:PaymentMethod:StoreAlias-ProviderAlias:ClientSecret or something?
Have a look at these config builders for ASPNET Framework.
https://docs.microsoft.com/en-us/aspnet/config-builder
Brings the NET core things to FW and should help making it compatible between 8 and 9.