Skip to content
18 changes: 18 additions & 0 deletions 16/umbraco-commerce/key-concepts/payment-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,28 @@ public class MyPaymentProviderSettings

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`.

### Payment Provider Settings
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.

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

{% hint style="info" %}
The **Validate Payment Provider Settings** feature has been available since Umbraco Commerce 16.4.0.
{% endhint %}

Umbraco Commerce supports validating payment provider settings by using `System.ComponentModel.DataAnnotations.ValidationAttribute`.

```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:
Expand Down
17 changes: 17 additions & 0 deletions 16/umbraco-commerce/key-concepts/shipping-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,27 @@ public class MyShippingProviderSettings

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`.

### Shipping Provider Settings
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.

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

{% hint style="info" %}
The **Validate Shipping Provider Settings** feature has been available since Umbraco Commerce 16.4.0.
{% endhint %}

Umbraco Commerce supports validating shipping provider settings by using `System.ComponentModel.DataAnnotations.ValidationAttribute`.

```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:
Expand Down