diff --git a/16/umbraco-commerce/key-concepts/payment-providers.md b/16/umbraco-commerce/key-concepts/payment-providers.md index bb69586fb96..f05f6eafb82 100644 --- a/16/umbraco-commerce/key-concepts/payment-providers.md +++ b/16/umbraco-commerce/key-concepts/payment-providers.md @@ -35,10 +35,28 @@ public class MyPaymentProviderSettings All Payment Providers inherit from a base class `AsyncPaymentProviderBase`. `TSettings` is the type of a Plain Old Class Object (POCO) model class representing the Payment Provider's settings. The class must be decorated with `PaymentProviderAttribute` which defines the Payment Providers `alias`. -The settings class consists of a series of properties, each decorated with a `PaymentProviderSettingAttribute`. These will all be used to dynamically build an editor interface for the given settings in the backoffice. +### Payment Provider Settings +The settings class consists of a series of properties, each decorated with a `PaymentProviderSettingAttribute`. These attributes are used to dynamically build an editor interface for the settings in the backoffice. Labels and descriptions for providers and their settings are controlled through [Localization](#localization) entries. +{% hint style="info" %} +The **Validate Payment Provider Settings** feature is available in Umbraco Commerce 16.4.0 and later. +{% endhint %} + +Umbraco Commerce supports validating payment provider settings using the `System.ComponentModel.DataAnnotations.ValidationAttribute` class. + +```csharp +public class MyPaymentProviderSettings +{ + [System.ComponentModel.DataAnnotations.Required] // Validation Attribute + [System.ComponentModel.DataAnnotations.StringLength(100)] // Validation Attribute + [PaymentProviderSetting(SortOrder = 100)] + public string ContinueUrl { get; set; } + ... +} +``` + ## Payment Provider Responsibilities There are two main responsibilities of a Payment Provider, and those are: diff --git a/16/umbraco-commerce/key-concepts/shipping-providers.md b/16/umbraco-commerce/key-concepts/shipping-providers.md index 6230d22fcf9..14d7a8b0c6b 100644 --- a/16/umbraco-commerce/key-concepts/shipping-providers.md +++ b/16/umbraco-commerce/key-concepts/shipping-providers.md @@ -35,10 +35,27 @@ public class MyShippingProviderSettings All Shipping Providers inherit from a base class `ShippingProviderBase`. `TSettings` is the type of a Plain Old Class Object (POCO) model class representing the Shipping Provider's settings. The class must be decorated with `ShippingProviderAttribute` which defines the Shipping Providers `alias`. -The settings class consists of a series of properties, each decorated with a `ShippingProviderSettingAttribute`. These will all be used to dynamically build an editor interface for the given settings in the backoffice. +### Shipping Provider Settings +The settings class consists of a series of properties, each decorated with a `ShippingProviderSettingAttribute`. These attributes are used to dynamically build an editor interface for the settings in the backoffice. Labels and descriptions for providers and their settings are controlled through [Localization](#localization) entries. +{% hint style="info" %} +The **Validate Shipping Provider Settings** feature is available in Umbraco Commerce 16.4.0 and later +{% endhint %} + +Umbraco Commerce supports validating shipping provider settings using the `System.ComponentModel.DataAnnotations.ValidationAttribute` class. + +```csharp +public class MyShippingProviderSettings +{ + [System.ComponentModel.DataAnnotations.Required] // Validation Attribute + [System.ComponentModel.DataAnnotations.StringLength(100)] // Validation Attribute + [ShippingProviderSetting(SortOrder = 100)] + public string ContinueUrl { get; set; } + ... +} +``` ## Shipping Provider Responsibilities The responsibilities of a Shipping Provider are: