Skip to content

Commit dcb9cce

Browse files
authored
Merge pull request #7475 from umbraco/feature/validate-payment-provider-settings
Add docs about Umbraco Commerce payment/shipping provider settings validation
2 parents e742478 + 9b102d5 commit dcb9cce

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

16/umbraco-commerce/key-concepts/payment-providers.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,28 @@ public class MyPaymentProviderSettings
3535

3636
All Payment Providers inherit from a base class `AsyncPaymentProviderBase<TSettings>`. `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`.
3737

38-
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.
38+
### Payment Provider Settings
39+
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.
3940

4041
Labels and descriptions for providers and their settings are controlled through [Localization](#localization) entries.
4142

43+
{% hint style="info" %}
44+
The **Validate Payment Provider Settings** feature is available in Umbraco Commerce 16.4.0 and later.
45+
{% endhint %}
46+
47+
Umbraco Commerce supports validating payment provider settings using the `System.ComponentModel.DataAnnotations.ValidationAttribute` class.
48+
49+
```csharp
50+
public class MyPaymentProviderSettings
51+
{
52+
[System.ComponentModel.DataAnnotations.Required] // Validation Attribute
53+
[System.ComponentModel.DataAnnotations.StringLength(100)] // Validation Attribute
54+
[PaymentProviderSetting(SortOrder = 100)]
55+
public string ContinueUrl { get; set; }
56+
...
57+
}
58+
```
59+
4260
## Payment Provider Responsibilities
4361

4462
There are two main responsibilities of a Payment Provider, and those are:

16/umbraco-commerce/key-concepts/shipping-providers.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,27 @@ public class MyShippingProviderSettings
3535

3636
All Shipping Providers inherit from a base class `ShippingProviderBase<TSettings>`. `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`.
3737

38-
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.
38+
### Shipping Provider Settings
39+
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.
3940

4041
Labels and descriptions for providers and their settings are controlled through [Localization](#localization) entries.
4142

43+
{% hint style="info" %}
44+
The **Validate Shipping Provider Settings** feature is available in Umbraco Commerce 16.4.0 and later
45+
{% endhint %}
46+
47+
Umbraco Commerce supports validating shipping provider settings using the `System.ComponentModel.DataAnnotations.ValidationAttribute` class.
48+
49+
```csharp
50+
public class MyShippingProviderSettings
51+
{
52+
[System.ComponentModel.DataAnnotations.Required] // Validation Attribute
53+
[System.ComponentModel.DataAnnotations.StringLength(100)] // Validation Attribute
54+
[ShippingProviderSetting(SortOrder = 100)]
55+
public string ContinueUrl { get; set; }
56+
...
57+
}
58+
```
4259
## Shipping Provider Responsibilities
4360

4461
The responsibilities of a Shipping Provider are:

0 commit comments

Comments
 (0)