# UmbCheckout Documentation

{% hint style="danger" %}
The planned support for Umbraco 17 has been paused at this time.\
\
We do not have a timeframe when or if this will happen.
{% endhint %}

{% hint style="warning" %}
There are license and subscription changes planned for V2.0.\
\
[Take a read in the GitHub Issue here](https://github.com/UmbHost/UmbCheckout/issues/97)\
\
[Discuss the change in the GitHub Discussion here](https://github.com/UmbHost/UmbCheckout/discussions/98)
{% endhint %}

UmbCheckout is an eCommerce solution for Umbraco v10 or v13 integrated with [Stripe Checkout](https://stripe.com/docs/payments/checkout).

If you need a lightweight eCommerce solution for a site powered by Umbraco V10 or V13 then UmbCheckout will allow you to make use of the Stripe Checkout service with minimal coding required.

Once the nuget package is installed it's completely possible to integrate it using the Views area of the Umbraco backoffice!

### Who These Docs Are For

**The documentation is aimed at developers** who have a basic understanding of Umbraco and at least an understanding of the Razor syntax.

The best place to start is the [Getting Started](https://docs.umbcheckout.net/) section for details how to install and carry out the initial configuration.

**Before you can use this package you will need a** [**Stripe account**](https://dashboard.stripe.com/register)**.**

### Where To Get Help

If you require further assistance please take a look at the [issue tracker](https://github.com/UmbHost/UmbCheckout/issues).

If you have a license with an active support subscription and require further assistance please [open a ticket here](https://my.umbhost.net/submitticket.php?step=2\&deptid=2).


# Overview

Getting Started with UmbCheckout

In this section you can follow the steps required to install and configure UmbCheckout.

{% hint style="success" %}
[Support for Umbraco 17 is planned for V2.1](https://github.com/UmbHost/UmbCheckout/issues/90)
{% endhint %}

Before you begin you will need to have installed Umbraco V10 or 13 and be ready to configure the checkout flow.

You can see the UmbCheckout demo here:

<https://demo.umbcheckout.net>

### System Requirements

The minimum requirements for using UmbCheckout are:

* Umbraco V10+
* SQL or SQLite Database
* Stripe Account


# License Comparison

{% hint style="warning" %}
There are license and subscription changes planned for V2.0.\
\
[Take a read in the GitHub Issue here](https://github.com/UmbHost/UmbCheckout/issues/97)\
\
[Discuss the change in the GitHub Discussion here](https://github.com/UmbHost/UmbCheckout/discussions/98)
{% endhint %}

The UmbCheckout core is opensource and usable under the GNU GPLv3 license during the development phase, this will change to the [Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/) license once the first stable release is out, the table below outlines what the differences are between the free version and the paid for version.\
\
The paid license is included with any shared hosting package purchased through [UmbHost Limited](https://umbhost.net)

You can purchase a license from the link below:

<https://my.umbhost.net/store/umbraco-packages>

|                              |    Free Version   | Paid & Hosted Version           |
| :--------------------------: | :---------------: | ------------------------------- |
|       Access to source       |         ✅         | <p>Core: ✅<br>Addons: ❌</p>     |
|  Includes Developer License  | Valid for 60 Days | ✅\*\*                           |
|   Access to Shipping Rates   |         ✅         | ✅                               |
|      Access to Tax Rates     |         ❌         | ✅                               |
| Store Basket in .NET Session |         ✅         | ✅                               |
|   Store Basket in a Cookie   |         ❌         | ✅                               |
| Store Basket in the Database |         ❌         | ✅                               |
|     Stripe Subscriptions     |         ❌         | \*✅                             |
|     GitHub Issue Tracker     |         ✅         | <p>Core: ✅<br>Addons: ❌</p>     |
|        Support Tickets       |         ❌         | ✅                               |
|       Payment Providers      |       Stripe      | Stripe                          |
|          Annual Fee          |         ❌         | <p>Updates: ❌<br>Support: ✅</p> |

{% hint style="info" %}
\*When the feature is released\
\*\*Hosted licenses are only valid for the lifetime of the subscription
{% endhint %}

[*If you require a developer license, please see this linked page*](/getting-started/developer-license)


# Installation

Installing UmbCheckout

{% hint style="success" %}
[Support for Umbraco 17 is planned for V2.1](https://github.com/UmbHost/UmbCheckout/issues/90)
{% endhint %}

**UmbCheckout currently only supports Umbraco v10 or v13.**

UmbCheckout is installed using the NuGet package manager using the below command:

```
dotnet add package UmbCheckout
```

Next, you need to enable .NET sessions, if not already enabled.\
To do this add the `app.UseSession();` line to your startup.cs before `app.UseUmbraco()`\
It should look similar to the below:

```csharp
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
    }

    app.UseSession();

    app.UseUmbraco()
        .WithMiddleware(u =>
        {
            u.UseBackOffice();
            u.UseWebsite();
        })
        .WithEndpoints(u =>
        {
            u.UseInstallerEndpoints();
            u.UseBackOfficeEndpoints();
            u.UseWebsiteEndpoints();
        });
}
```

You will also need to install a [payment provider](/payment-providers/payment-providers).

Alternatively, you can install using the NuGet package manager GUI within Visual Studio.

### Upgrades

UmbCheckout uses Umbraco Migrations to install all of the tables required to function, this means that upgrades follow the same process as installation, you can either run the command found above or upgrade using the NuGet package manager GUI.

### Installing a License

If you have purchased a license to enable more features, you simply need to add the following to your `appsettings.json` file:

```json
  "UmbCheckout": {
    "LicenseKey": "YOUR LICENSE KEY HERE"
  }
```

*Replacing* `YOUR LICENSE KEY HERE` *with the key found in your* [*account here*](https://my.umbhost.net)*.*

You are also required to configure the [UmbracoApplicationUrl](https://docs.umbraco.com/umbraco-cms/reference/configuration/webroutingsettings#umbraco-application-url) within the [Web routing settings](https://docs.umbraco.com/umbraco-cms/reference/configuration/webroutingsettings) within your appsettings.json file

```json
"Umbraco": {
  "CMS": {
    "WebRouting": {
      "UmbracoApplicationUrl": "http://www.mysite.com/"
    }
  }
}
```

{% hint style="info" %}
**When do I need a license?**

UmbCheckout requires a license to use any of the Addon packages.

Using UmbCheckout without a license will disable the Tax Rates and disables being able to store the Basket in a Cookie or the Database.

Licensed sites will also be able to make use of the support ticketing system.

If you require a development license, [please see this linked page](/getting-started/developer-license).

*(These restrictions may change in the future)*

{% endhint %}


# Configuration

Configuring UmbCheckout

There is no additional coding required to make use of UmbCheckout after being installed.

After the package is installed head to Settings -> UmbCheckout -> Configuration to set the Checkout **Success** and **Cancel** pages / URLs.

**UmbCheckout relies on IPublishedContent and does not work with IContent**

### Required Product Properties

Your product needs to have the following required properties added

| Alias            | Property Type |
| ---------------- | ------------- |
| umbCheckoutPrice | Decimal       |

Your product can have the following optional properties

| Alias                  | Property Type |
| ---------------------- | ------------- |
| umbCheckoutDescription | Text Area     |


# Starter Kits

Information about our Umbraco Starter Kit


# Stripe

Information about our Starter Kit configured for Stripe

Our UmbCheckout Stripe Starter Kit comes fully configured and can be installed ready for the content population in 2 minutes!

The source code for the Starter Kit can be found on the [GitHub repository here](https://github.com/UmbHost/UmbCheckout.StarterKit.Stripe).

The starter kit has been built using the [InMemoryAuto Models builder mode](https://docs.umbraco.com/umbraco-cms/reference/configuration/modelsbuildersettings#models-mode).

The video below is an example of how to install the ready-to-go starter kit in under 2 minutes.

{% embed url="<https://www.youtube.com/watch?v=zmZfQlfcjuM>" %}

#### UI

The front-end UI makes use of Bootstrap 5.3 as an out-of-the-box configuration, to override any Bootstrap styles simply edit the custom.css file from within the backoffice.

You can find the custom.css file on disk in the following path: wwwroot -> css -> custom.css Alternatively, you can edit the file directly from within the Umbraco backoffice at the following path Settings -> Stylesheets -> custom.css

You can find the custom.js file on disk in the following path: wwwroot -> scripts -> custom.js\
Alternatively, you can edit the file directly from within the Umbraco backoffice at the following path\
Settings -> Scripts -> custom.js

If you require a more in-depth customisation you are free to replace the Bootstrap implementation as you see fit.

#### Pre-Installed Packages

The UmbCheckout Starter Kit for Stripe is licensed under the MIT license, any installed packages may use different licenses, be sure to check and use accordingly.

We highly enjoy working with what the community creates, so we have made use of many open-source packages within the starter kit, you can see the list below along with links to the source code and licenses.

| Package Name                  | GitHub Repository                                              | Marketplace URL                                                             | License                                                                                               |
| ----------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| Nesting Contently             | <https://github.com/nathanwoulfe/NestingContently/tree/v4/dev> | <https://marketplace.umbraco.com/package/nestingcontently.umbraco>          | Unknown / Contact Author                                                                              |
| Contentment                   | <https://github.com/leekelleher/umbraco-contentment>           | <https://marketplace.umbraco.com/package/umbraco.community.contentment>     | [Mozilla Public License 2.0](https://github.com/leekelleher/umbraco-contentment/blob/develop/LICENSE) |
| The Dashboard                 | <https://github.com/enkelmedia/TheDashboard>                   | <https://marketplace.umbraco.com/package/our.umbraco.thedashboard>          | [MIT](https://github.com/enkelmedia/TheDashboard/blob/v11/dev/LICENSE)                                |
| ourHtagEditor                 | <https://github.com/mastrup/ourHtagEditor>                     | <https://marketplace.umbraco.com/package/ourhtageditor>                     | [MIT](https://github.com/mastrup/ourHtagEditor/blob/main/LICENSE)                                     |
| Skybrud Redirects             | <https://github.com/skybrud/Skybrud.Umbraco.Redirects>         | <https://marketplace.umbraco.com/package/skybrud.umbraco.redirects>         | [MIT](https://github.com/skybrud/Skybrud.Umbraco.Redirects/blob/v4/main/LICENSE.md)                   |
| uSync                         | <https://github.com/KevinJump/uSync>                           | <https://marketplace.umbraco.com/package/usync>                             | [Mozilla Public License 2.0](https://github.com/KevinJump/uSync/blob/v12/main/LICENSE)                |
| Bergmania.OpenStreetMap       | <https://github.com/bergmania/Bergmania.OpenStreetMap>         | <https://marketplace.umbraco.com/package/bergmania.openstreetmap>           | [MIT](https://github.com/bergmania/Bergmania.OpenStreetMap/blob/main/LICENSE)                         |
| MetaMomentum                  | <https://github.com/DigitalMomentum/MetaMomentum>              | <https://marketplace.umbraco.com/package/metamomentum>                      | Unknown / Contact Author                                                                              |
| Conditional Displayers        | <https://github.com/skartknet/ConditionalDisplayers>           | <https://marketplace.umbraco.com/package/our.umbraco.conditionaldisplayers> | [MIT](https://github.com/skartknet/ConditionalDisplayers/blob/master/LICENSE)                         |
| Our.Umbraco.TagHelpers        | <https://github.com/umbraco-community/Our-Umbraco-TagHelpers>  | <https://marketplace.umbraco.com/package/our.umbraco.taghelpers>            | [MIT](https://github.com/umbraco-community/Our-Umbraco-TagHelpers/blob/main/LICENSE)                  |
| UmbNav                        | <https://github.com/AaronSadlerUK/Our.Umbraco.UmbNav>          | <https://marketplace.umbraco.com/package/our.umbraco.umbnav.web>            | [MIT](https://github.com/AaronSadlerUK/Our.Umbraco.UmbNav/blob/develop/LICENSE)                       |
| NWebsec.AspNetCore.Middleware | <https://github.com/NWebsec/NWebsec>                           |                                                                             | [BSD-3-Clause license](https://github.com/NWebsec/NWebsec/blob/dev/LICENSE)                           |
| LazZiya.TagHelpers            | <https://github.com/LazZiya/TagHelpers>                        |                                                                             | [MIT](https://github.com/LazZiya/TagHelpers/blob/master/LICENSE)                                      |
| UmbCheckout                   | <https://github.com/UmbHost/UmbCheckout>                       |                                                                             | [Apache License 2.0](https://github.com/UmbHost/UmbCheckout/blob/develop/LICENSE)                     |


# Installation

Installing the UmbCheckout Stripe Starter Kit

The UmbCheckout Stripe Starter Kit makes use of [dotnet templates](https://learn.microsoft.com/en-us/dotnet/core/tools/custom-templates) and is installed using the NuGet package manager using the below command:

```
dotnet new install UmbCheckout.StarterKit.Stripe
```

Once installed you will need to create a new folder on your machine, within this folder you will need to open a command prompt, terminal, or PowerShell and run the following:

```
dotnet new umbcheckout.starterkit.stripe
```

Once installed you need to run the following command to build and run the site:

```
dotnet run
```

Next is to install Umbraco in the normal way following the prompts within the installer.

On the first run of the site after the installer has completed uSync will import all of the demo content, images, and configurations.

Next, you are required to configure the [UmbracoApplicationUrl](https://docs.umbraco.com/umbraco-cms/reference/configuration/webroutingsettings#umbraco-application-url) within the [Web routing settings](https://docs.umbraco.com/umbraco-cms/reference/configuration/webroutingsettings) within your appsettings.json file

```json
"Umbraco": {
  "CMS": {
    "WebRouting": {
      "UmbracoApplicationUrl": "http://www.mysite.com/"
    }
  }
}
```

The final step is to add your [Stripe API keys](/payment-providers/payment-providers/stripe/configuration) to the appsettings.json

```json
  "UmbCheckout": {
    "Stripe": {
      "WebHookSecret": "",
      "ApiKey": ""
    }
  }
```


# Anonymous Telemetry

What data do we collect and why?

By default, anonymous telemetry is sent to us every time you save the UmbCheckout configuration and after a remote license check has been completed.

#### Why do we collect this data?

It is so that we concentrate our development in the most used areas, it also lets us have a rough idea on how many sites are using our package

**What data is collected?**

We collect the following data:

| Key                  | Value                                                                         |
| -------------------- | ----------------------------------------------------------------------------- |
| umbracoId            | The Umbraco Guid for the site                                                 |
| umbracoVersion       | The Umbraco version                                                           |
| umbCheckoutVersion   | The UmbCheckout version                                                       |
| installedPackages    | The UmbCheckout sub packages which are installed                              |
| isLicensed           | Whether the site is running on a paid license                                 |
| isDevelopmentLicense | Whether the site is running on a development license                          |
| environmentName      | The sites hosting environment name (Development, Staging, Production, etc...) |

*There is a unique constraint on `umbracoId` and `environmentName`*

#### Can I disable the telemetry?

Yes, you can disable the telemetry service by setting the following configuration in your appsettings.json file

```json
{
  "UmbCheckout": {
    "DisableTelemetry": true
  }
}
```


# Developer License

Where to get a developer license

Upon purchasing a paid license or hosting package, you can request a developer license which can be used on localhost, \*.local or \*.mypc domains, otherwise it's valid for 60 days.

If your license is part of a hosting package, it will only remain valid for the life of the subscription.

To request a developer license please [create an account](https://my.umbhost.net/register.php) and then [open a support ticket here](https://my.umbhost.net/submitticket.php?step=2\&deptid=2).

**Please include the domains to be added to the license in the request.**

It is only possible to request 1 license and 1 development license per domain.

Production and Staging licenses are available on request for every domain hosted on an active UmbHost hosting package.


# Affiliate Scheme

Earn commission on each license or hosting referral

You can earn 20% from each successful [purchase of either UmbCheckout](https://my.umbhost.net/store/umbraco-packages) or any one of the [services offered by UmbHost](https://umbhost.net/affiliate-scheme).

Our scheme is free to join and we haven’t put any limits on how much you can earn.

Once you've [joined](https://my.umbhost.net/register.php) you will be given a unique link to share, you will be able to track clicks and conversions right from within your [My.UmbHost](https://my.umbhost.net) account!

You can [join the Affiliate scheme here](https://my.umbhost.net/register.php) if you have already joined or have a UmbHost account you can [view the affiliate dashboard here](https://my.umbhost.net/affiliates.php).


# Configuration Options

There are a number of settings which can be configured within the backoffice on the configuration dashboard found here:

Settings -> UmbCheckout -> Configuration

The configuration options and their possible options are as below:

| Name                           | Type    | Options                                                                                                                                                                 |
| ------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success Page URL               | Picker  | Select either a content node or enter an external URL                                                                                                                   |
| Cancel Page URL                | Picker  | Select either a content node or enter an external URL                                                                                                                   |
| Enable Shipping                | Boolean | <p><strong>True:</strong> The shipping rates are passed to the payment provider<br><br><strong>False:</strong> No shipping rates are passed to the payment provider</p> |
| \*Store Basket In a Cookie     | Boolean | <p><strong>True:</strong> A cookie is set which stores the users current Basket<br><br><strong>False:</strong> No cookie is set</p>                                     |
| \*Basket Expiry (Cookie)       | Integer | The number of days in the future the cookie expires (30 by default)                                                                                                     |
| \*Store Basket In The Database | Boolean | <p><strong>True:</strong> The users current Basket is stored in the database<br><br><strong>False:</strong> The Basket is not stored</p>                                |
| \*Basket Expiry (Database)     | Integer | The maximum number of days the Basket is stored in the database                                                                                                         |

{% hint style="info" %}
Features marked with \* require a paid license
{% endhint %}


# Product Variants

How to create product variants

You can use product variants to define different variants of a product, such as giving the option to select a colour or size.

To create a variant you simply need to allow your Product Document Type to have children, the only required field on the child document type is `umbCheckoutPrice` our demo store shows how you can configure this.

Our recommendation is to configure the product variant to have no Template associated with it, however, you can integrate as you see fit or as your project requires.


# Session Service

A service to handle the Get, Update and Clearing of the Session

The session service is what creates and handles the creation, retrieval, updating and clearing of the UmbCheckout Basket within the .NET session.

You can access the session service by injecting `ISessionService` which can be found within the namespace`UmbCheckout.Core.Interfaces`

#### Create

Gets the current UmbCheckout session from the .NET session

```csharp
Task<UmbCheckoutSession> Get();
```

#### Update

Updates the current UmbCheckout session or create a new session if not found

Parameters:

| Name   | Detail                                               |
| ------ | ---------------------------------------------------- |
| basket | The [Basket](/core-services/object-reference/basket) |

```csharp
Task<UmbCheckoutSession> Update(Basket basket);
```

#### Clear

Clears the UmbCheckout session from the .NET session

```csharp
Task Clear();
```


# Database Service

A service which handles storing of the Basket in the database

The database service is what handles the retrieval of the UmbCheckout Basket within the database.

You can access the database service by injecting `IDatabaseService` which can be found within the namespace`UmbCheckout.Core.Interfaces`

#### GetBasket

The gets the stored Basket

Parameters:

| Name      | Detail                                                                           |
| --------- | -------------------------------------------------------------------------------- |
| sessionId | The session to retrieve the [Basket](/core-services/object-reference/basket) for |

```csharp
Task<Basket?> GetBasket(string sessionId);
```


# Basket Service

A service which handles all things around the basket

The basket service is what and handles all the UmbCheckout Basket operations.

You can access the basket service by injecting `IBasketService` which can be found within the namespace`UmbCheckout.Core.Interfaces`

#### Get

Gets the [Basket](/core-services/object-reference/basket)

```csharp
Task<Basket> Get();
```

#### Add

Adds an item to the [Basket](/core-services/object-reference/basket)

Parameters:

| Name | Detail                                                                     |
| ---- | -------------------------------------------------------------------------- |
| item | [Item](/core-services/object-reference/lineitem) to be added to the Basket |

```csharp
Task<Basket> Add(LineItem item);
```

#### Add Multiple

Adds multiple items to the [Basket](/core-services/object-reference/basket)

Parameters:

| Name  | Detail                                                                      |
| ----- | --------------------------------------------------------------------------- |
| items | [Items](/core-services/object-reference/lineitem) to be added to the Basket |

```csharp
Task<Basket> Add(IEnumerable<LineItem> items);
```

#### Reduce

Reduces the specified item by a count of 1 or removes from the [Basket](/core-services/object-reference/basket) if only 1

Parameters:

| Name | Detail                                                                       |
| ---- | ---------------------------------------------------------------------------- |
| key  | [Item](/core-services/object-reference/lineitem) to be reduced in the Basket |

```csharp
Task<Basket> Reduce(Guid id);
```

#### Remove

Removes the specified item from the [Basket](/core-services/object-reference/basket)

Parameters:

| Name | Detail                                                                         |
| ---- | ------------------------------------------------------------------------------ |
| key  | [Item](/core-services/object-reference/lineitem) to be removed from the Basket |

```csharp
Task<Basket> Remove(Guid id);
```

#### Remove Multiple

Removes multiple items from the [Basket](/core-services/object-reference/basket)

Parameters:

| Name | Detail                                                                          |
| ---- | ------------------------------------------------------------------------------- |
| keys | [Items](/core-services/object-reference/lineitem) to be removed from the Basket |

```csharp
Task<Basket> Remove(IEnumerable<Guid> ids);
```

#### Clear

Removes all items from the Basket and clears any set [Basket](/core-services/object-reference/basket) cookies

```csharp
Task<Basket> Clear();
```

#### TotalItems

Returns the total item quantity count

```csharp
Task<long> TotalItems();
```

#### SubTotal

Returns the [Basket](/core-services/object-reference/basket) subtotal (minus any shipping or tax)

```csharp
Task<decimal> SubTotal();
```


# Object Reference


# Basket

The Basket object contains the below properties

| Property Name       | Type                                                              | Use                                                        |
| ------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------- |
| Id                  | string                                                            | The Basket id                                              |
| SessionId           | string                                                            | The UmbCheckout Session Id                                 |
| CustomerReferenceId | string?                                                           | A unique reference which can be used to identify the order |
| Customer            | [Customer?](/core-services/object-reference/customer)             | Information relating to the customer                       |
| LineItems           | IEnumerable<[LineItem](/core-services/object-reference/lineitem)> | The line items (products) contained in the Basket          |
| ItemCount           | long                                                              | The total count of line item quantity                      |
| Total               | decimal                                                           | The sub total of the Basket, excluding Tax and Shipping    |
| MetaData            | Dictionary\<string, string>                                       | Used to store meta data against the basket                 |


# Customer

The Customer object contains the below properties

| Property Name | Type    | Use                         |
| ------------- | ------- | --------------------------- |
| FirstName     | string? | The customers first name    |
| LastName      | string? | The customers last name     |
| EmailAddress  | string? | The customers email address |


# UmbCheckoutMetaData

The UmbCheckoutMetaData object contains the below properties

| Property Name | Type   | Use                 |
| ------------- | ------ | ------------------- |
| Name          | string | Metadata name (Key) |
| Value         | string | The Metadata value  |


# UmbCheckoutSession

The UmbCheckoutSession object contains the below properties

| Property Name | Type                                             | Use        |
| ------------- | ------------------------------------------------ | ---------- |
| Basket        | [Basket](/core-services/object-reference/basket) | The Basket |


# LineItem

The LineItem object contains the below properties

| Property Name | Type                        | Use                                                                                                                   |
| ------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Key           | Guid                        | The Umbraco Node Key                                                                                                  |
| Name          | string                      | The item name which fallsback to the Umbraco Node Name                                                                |
| Description   | string?                     | The item description which fallsback to the Node property alias`umbCheckoutDescription`  and finally to `description` |
| CurrencyCode  | string                      | The Currency Symbol                                                                                                   |
| Price         | decimal                     | The price of the line item                                                                                            |
| CurrencyPrice | string                      | The price formatted as currency                                                                                       |
| Quantity      | long                        | The quantity of the line item                                                                                         |
| MetaData      | Dictionary\<string, string> | Contains meta data for the line item, the node key gets added during checkout with a key of "nodeKey"                 |


# UmbCheckoutConfiguration

The UmbCheckoutConfiguration object contains the below properties

| Property Name          | Type                                                                          | Use                                                    |
| ---------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------ |
| Id                     | int                                                                           | The internal configuration Id                          |
| Key                    | Guid                                                                          | The internal configuration Key                         |
| SuccessPageUrl         | IEnumerable<[MultiUrlPicker](/core-services/object-reference/multiurlpicker)> | The success page                                       |
| CancelPageUrl          | IEnumerable<[MultiUrlPicker](/core-services/object-reference/multiurlpicker)> | The cancel page                                        |
| StoreBasketInCookie    | Boolean                                                                       | Whether the Basket is stored in a cookie               |
| StoreBasketInDatabase  | Boolean                                                                       | Whether the Basket is stored in the database           |
| BasketInDatabaseExpiry | int                                                                           | The number of days the Basket can live in the database |
| BasketInCookieExpiry   | int                                                                           | The number of days the Basket can live in a cookie     |
| EnableShipping         | Boolean                                                                       | Whether the shipping is enabled                        |


# MultiUrlPicker

The MultiUrlPicker object contains the below properties

| Property Name | Type    |
| ------------- | ------- |
| Name          | string  |
| Udi           | string  |
| Url           | string  |
| Icon          | string  |
| Published     | Boolean |
| Trashed       | Boolean |


# Cookies

The possible cookies which can be set are outlined below with their explanations

| Name                               | Reason                                                         |
| ---------------------------------- | -------------------------------------------------------------- |
| UmbCheckoutSession                 | The .NET Session Id                                            |
| umbCheckoutBasketSessionId         | Contains the UmbCheckout Session Id                            |
| umbCheckoutBasketSessionId\_Basket | The encrypted [Basket](/core-services/object-reference/basket) |

{% hint style="info" %}
umbCheckoutBasketSessionId\_Basket requires a paid license
{% endhint %}


# Addons


# Database Service

A service which handles storing of the Basket in the database

{% hint style="info" %}
This feature requires a paid license
{% endhint %}

The database service is what handles the insertion, updating, and clearing of the UmbCheckout Basket within the database.

You can access the database service by injecting `IDatabaseService` which can be found within the namespace `UmbCheckout.Core.Addons.Interfaces`

#### UpdateBasket

Updates the stored Basket

Parameters:

| Name      | Detail                                                                           |
| --------- | -------------------------------------------------------------------------------- |
| sessionId | The session to retrieve the [Basket](/core-services/object-reference/basket) for |
| basket    | The [Basket](/core-services/object-reference/basket) to be stored                |

```csharp
Task<Basket> UpdateBasket(string sessionId, Basket basket);
```

#### DeleteBasket

Deleted the stored Basket

Parameters:

| Name      | Detail                                                                         |
| --------- | ------------------------------------------------------------------------------ |
| sessionId | The session to delete the [Basket](/core-services/object-reference/basket) for |

```csharp
Task DeleteBasket(string sessionId);
```

#### DeleteBaskets

Deleted all of the stored Baskets older than the specified days

Parameters:

| Name           | Detail                  |
| -------------- | ----------------------- |
| expiryDateTime | The days to delete from |

```csharp
Task DeleteBaskets(DateTime expiryDateTime);
```


# Property Editors


# MetaData Property Editor

The MetaData property editor allows you to add metadata to your product, this is passed over to the Payment Provider.

The returned type is: `Dictionary<string, string>`

{% hint style="info" %}
The node key gets added in the Stripe Session service in a key called "nodeKey"
{% endhint %}

<figure><img src="https://2748728690-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh5UHoyl8SSRgUKuYYLss%2Fuploads%2F2Pu8MIJhfZfA2ePZmXpW%2FMetaDataPropertyEditor.png?alt=media&amp;token=69879250-7d31-411a-9988-15394fb768ec" alt=""><figcaption></figcaption></figure>

### Programmatically add metadata

You can programmatically add metadata by creating an `IEnumerable<UmbCheckoutMetaData>()` object

{% code title="Create object example" %}

```csharp
var metaData = new List<UmbCheckoutMetaData>
{
    new()
    {
        Name = "Dictionary Key 1",
        Value = "Dictionary Value 1"
    },
    new()
    {
        Name = "Dictionary Key 2",
        Value = "Dictionary Value 2"
    }
}
```

{% endcode %}


# Support Tickets

Users with an active Support License can open support tickets to be dealt with quicker than waiting for the community via the [Issue Tracker](https://github.com/UmbHost/UmbCheckout/issues).

You can submit a ticket through your [My.UmbHost](https://umbhost.net/clients/login) account.

If you need support urgently and are not currently licensed, you can [buy a license here](https://my.umbhost.net/store/umbraco-packages).


# Payment Providers


# Stripe

You will need to signup for a Stripe account to use this payment provider.\
You can [signup for Stripe here](https://stripe.com).


# Installation

Installing Stripe Payment Provider

The Stripe Payment Provider is installed using the NuGet package manager using the below command:

```
dotnet add package UmbCheckout.Stripe
```

Alternatively, you can install using the NuGet package manager GUI within Visual Studio.


# Configuration

Configuring Stripe Payment Provider

You will need to add your Stripe Secret API key into your `appsettings.json` below the `LicenseKey` as below:

```json
  "UmbCheckout": {
    "Stripe": {
      "Test": {
        "ApiKey": "TEST STRIPE SECRET API KEY"
      },
      "Live": {
        "ApiKey": "LIVE STRIPE SECRET API KEY"
      }
    }
  }
```

You can find your Stripe Secret API key [within your account](https://dashboard.stripe.com/apikeys) by heading to `Developers -> API keys`

If you are going to use the [Stripe Webhook](/payment-providers/payment-providers/stripe/services/stripe-webhook-api) (Recommended) then you will need to add the following secret into your `appsettings.json`

```json
  "UmbCheckout": {
    "Stripe": {
      "Test": {
        "WebHookSecret": "STRIPE TEST WEBHOOK SECRET"
      },
      "Live": {
        "WebHookSecret": "LIVE STRIPE WEBHOOK SECRET"
      }
    }
  }
```

You can create your WebHook Secret [within your account](https://dashboard.stripe.com/webhooks) by heading to `Developers -> Webhooks`

You will also need to ensure your Webhooks are configured for [Stripe API ](https://dashboard.stripe.com/developers)version:

```
2023-08-16
```

Your product can have the following optional properties

| Alias               | Property Type                                                                                              |
| ------------------- | ---------------------------------------------------------------------------------------------------------- |
| umbCheckoutMetaData | [Meta Data](/core-services/property-editors/metadata-property-editor)                                      |
| umbCheckoutTaxRates | [Tax Rates](/payment-providers/payment-providers/stripe/addons/property-editors/tax-rates-property-editor) |


# Payment Flow / Lifecycle

Learn how the payment flow / lifecycle works with Stripe

When you use the Stripe payment provider it makes use of the [Stripe Checkout](https://stripe.com/docs/payments/checkout) features.

The flow / lifecycle works like this:

1. The customer browses the website and adds a product to the [Basket](/core-services/object-reference/basket)
2. Customer views their basket and initiates the Checkout process
3. UmbCheckout converts the [Basket](/core-services/object-reference/basket) for Stripe and sends this over via the Stripe API
4. The Stripe API returns a unique payment URL
5. The customer is redirected to the Hosted Stripe payment page
6. On payment success, the Customer is returned to the payment success page, or on payment failure / cancel the Customer is returned to the payment canceled page
7. After the transaction, a [webhook](/payment-providers/payment-providers/stripe/services/stripe-webhook-api) sends the response and triggers a [Notification](/payment-providers/payment-providers/stripe/notifications)

<figure><img src="https://2748728690-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh5UHoyl8SSRgUKuYYLss%2Fuploads%2F4FN7oGe4aMarGdK3eovZ%2FScreenshot%202023-08-18%20130555.png?alt=media&amp;token=c328e639-e22b-4b6c-8e35-cddc9f32ea22" alt=""><figcaption></figcaption></figure>


# Stripe Email Notifications

You can set up email notifications in your Stripe account for various events, such as successful payments, disputes and elevated risk payments.

Stripe can notify you of account activity via email, including when:

* A payment is successfully made to your Stripe account
* A payment is disputed by a cardholder
* A payment is marked as elevated risk by Stripe or by a custom rule in Stripe Radar
* An application fee is collected from a connected account (if you are a Stripe Connect platform that collects application fees from connected accounts)

{% embed url="<https://dashboard.stripe.com/settings/communication-preferences>" %}


# Payment Methods

Multiple payment methods within your Stripe account

You can find out more about payment methods on the Stripe website here:

{% embed url="<https://stripe.com/docs/payments/payment-methods/overview>" %}

{% embed url="<https://stripe.com/docs/payments/payment-methods/integration-options>" %}


# Receipts

Send payment or refund receipts automatically.

To enable automated receipts, in your Customer emails settings, under **Email customers about**, select **Successful payments**. You can also customise receipts. Receipts are only sent when a successful payment has been made – no receipt is sent if the payment fails or is declined.

Learn more about receipts in the Stripe documentation here:

{% embed url="<https://stripe.com/docs/receipts>" %}


# Shipping Rates

Shipping Rates allow you to charge various shipping options - such as standard, express next day etc...

The Shipping Rates are created within the Stripe Dashboard, you can then enter them into the UmbCheckout configuration area to make them available during the Checkout process.

### Stripe Dashboard

You can create Shipping Rates in the following section of the Stripe Dashboard:

Dashboard -> Products -> Shipping rates -> Create shipping rate

### UmbCheckout Backoffice

You can enter Shipping Rates into your Umbraco site by going to the following area:

Settings -> UmbCheckout -> Stripe Shipping Rates -> Create Shipping Rate

The shipping rate settings are as follows:

| Name               | Value                                                            |
| ------------------ | ---------------------------------------------------------------- |
| Shipping Rate Name | The name of the shipping rate as shown in the Umbraco Backoffice |
| Shipping Rate ID   | The ID of the shipping rate as found in Stripe                   |

{% hint style="info" %}
Currently only fixed rate shipping rates are supported
{% endhint %}


# Services


# Stripe Shipping Rate ApiService

A service which handles getting the Stripe Shipping Rates from the Stripe API

The Stripe Shipping Rate API service is what handles the retrieval of the Shipping Rates from the Stripe API.

You can access the API service by injecting `IStripeShippingRateApiService` which can be found within the namespace `UmbCheckout.Stripe.Interfaces`

#### GetShippingRates

Gets the Shipping Rates from the Stripe API

```csharp
Task<StripeList<ShippingRate>> GetShippingRates();
```

#### GetShippingRate

Gets a Shipping Rate from the Stripe API

Parameters:

| Name | Detail                         |
| ---- | ------------------------------ |
| id   | Id of the Stripe Shipping Rate |

```csharp
Task<ShippingRate> GetShippingRate(string id);
```


# Stripe Shipping Rate Database Service

A service which handles getting the Stripe Shipping Rates from the database

The Stripe Shipping Rate database service is what handles the insertion, retrieval, updating, and deletion of the Shipping Rates within the database.

You can access the database service by injecting `IStripeShippingRateDatabaseService` which can be found within the namespace `UmbCheckout.Stripe.Interfaces`

#### GetShippingRates

Gets the Shipping Rates

```csharp
Task<IEnumerable<ShippingRate>> GetShippingRates();
```

#### GetShippingRate

Gets a specified Shipping Rate

Parameters:

| Name | Detail                                                                                                       |
| ---- | ------------------------------------------------------------------------------------------------------------ |
| key  | Key of the Stripe [Shipping Rate](/payment-providers/payment-providers/stripe/object-reference/shippingrate) |

```csharp
Task<ShippingRate?> GetShippingRate(Guid key);
```

#### GetShippingRate

Gets a specified Shipping Rate

Parameters:

| Name  | Detail                                                                                                            |
| ----- | ----------------------------------------------------------------------------------------------------------------- |
| value | StripeId of the Stripe [Shipping Rate](/payment-providers/payment-providers/stripe/object-reference/shippingrate) |

```csharp
Task<ShippingRate?> GetShippingRate(string value);
```

#### UpdateShippingRate

Creates a Shipping Rate

Parameters:

| Name         | Detail                                                                                                |
| ------------ | ----------------------------------------------------------------------------------------------------- |
| shippingRate | The Stripe [Shipping Rate](/payment-providers/payment-providers/stripe/object-reference/shippingrate) |

```csharp
Task<ShippingRate?> CreateShippingRate(ShippingRate shippingRate);
```

#### UpdateShippingRate

Updates a specified Shipping Rate

Parameters:

| Name         | Detail                                                                                                |
| ------------ | ----------------------------------------------------------------------------------------------------- |
| shippingRate | The Stripe [Shipping Rate](/payment-providers/payment-providers/stripe/object-reference/shippingrate) |

```csharp
Task<ShippingRate?> UpdateShippingRate(ShippingRate shippingRate);
```

#### DeleteShippingRate

Deletes a specified Shipping Rate

Parameters:

| Name | Detail                                                                                                       |
| ---- | ------------------------------------------------------------------------------------------------------------ |
| key  | Key of the Stripe [Shipping Rate](/payment-providers/payment-providers/stripe/object-reference/shippingrate) |

```csharp
Task<bool> DeleteShippingRate(Guid key);
```


# Stripe Session Service

A service which handles all things around the Stripe Session

The Stripe session service is what creates and handles the creation, updating and clearing of the Stripe session.

You can access the Stripe session service by injecting `ISessionService` which can be found within the namespace `UmbCheckout.Stripe.Interfaces`

#### GetSession

Gets a Stripe session

Parameters:

| Name | Detail                   |
| ---- | ------------------------ |
| id   | Id of the Stripe Session |

```csharp
Session GetSession(string id);
```

#### GetSessionAsync

Gets a Stripe session asynchronously

Parameters:

| Name | Detail                   |
| ---- | ------------------------ |
| id   | Id of the Stripe Session |

```csharp
Task<Session> GetSessionAsync(string id);
```

#### CreateSession

Creates a Stripe session

Parameters:

| Name   | Detail                                        |
| ------ | --------------------------------------------- |
| basket | The basket to be stored in the Stripe Session |

```csharp
Session CreateSession(Basket basket);
```

#### CreateSessionAsync

Creates a Stripe session asynchronously

Parameters:

| Name   | Detail                                        |
| ------ | --------------------------------------------- |
| basket | The basket to be stored in the Stripe Session |

```csharp
Task<Session> CreateSessionAsync(Basket basket);
```

#### ClearSession

Clears the Stripe session

Parameters:

| Name | Detail                   |
| ---- | ------------------------ |
| id   | Id of the Stripe Session |

```csharp
void ClearSession(string id);
```

#### ClearSessionAsync

Clears the Stripe session asynchronously

Parameters:

| Name | Detail                   |
| ---- | ------------------------ |
| id   | Id of the Stripe Session |

```csharp
Task ClearSessionAsync(string id);
```


# Stripe Basket Controller

The `StripeBasketController` is a preconfigured Umbraco Surface Controller which interacts with the [BasketService](/core-services/basket-service).

It can be found within the namespace `UmbCheckout.Stripe.Controllers.Surface`

It has a number of methods available as a starting point to allow UmbCheckout to be consumed without the need to write C# code.

#### Add

Adds an item to the Basket, the example below would typically be used on the Product page

{% code title="Example add form" %}

```cshtml
@using (Html.BeginUmbracoForm<StripeBasketController>(nameof(StripeBasketController.Add), FormMethod.Post))
{
    <label for="quantity">Quantity:</label>
    <input type="number" name="quantity" value="1" min="1" /> <br />
    <input type="hidden" name="key" value="@Model.Key" />
    <input type="hidden" name="currencyCode" value="GBP" />
    <button type="submit">Buy</button>
}
```

{% endcode %}

This method sets the following TempData

| Key                            | Value                                                                                                                         |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| UmbCheckout\_Added\_To\_Basket | Key of the [LineItem](/core-services/object-reference/lineitem) added to the [Basket](/core-services/object-reference/basket) |

#### Increase

Increases the specified item quantity, the example below would typically be used on the Basket page

```csharp
@using (Html.BeginUmbracoForm<StripeBasketController>(nameof(StripeBasketController.Add), FormMethod.Post))
{
    <input type="hidden" name="key" value="@lineItem.Key" />
    <button type="submit">+</button>
}
```

This method sets the following TempData

| Key                            | Value                                                                                                                             |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| UmbCheckout\_Added\_To\_Basket | Key of the [LineItem](/core-services/object-reference/lineitem) increased in the [Basket](/core-services/object-reference/basket) |

#### Reduce

Reduces the specified item quantity, the example below would typically be used on the Basket page

{% code title="Example reduce item" %}

```cshtml
@using (Html.BeginUmbracoForm<StripeBasketController>(nameof(StripeBasketController.Reduce), FormMethod.Post))
{
    <input type="hidden" name="key" value="@lineItem.Key" />
    <button type="submit">-</button>
}
```

{% endcode %}

This method sets the following TempData

| Key                          | Value                                                                                                                           |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| UmbCheckout\_Basket\_Reduced | Key of the [LineItem](/core-services/object-reference/lineitem) reduced in the [Basket](/core-services/object-reference/basket) |

#### Remove

Removes the specified item, the example below would typically be used on the Basket page

{% code title="Example remove item" %}

```cshtml
@using (Html.BeginUmbracoForm<StripeBasketController>(nameof(StripeBasketController.Remove), FormMethod.Post))
{
    <input type="hidden" name="key" value="@lineItem.Id" />
    <button type="submit">Remove</button>
}
```

{% endcode %}

This method sets the following TempData

| Key                          | Value                                                                                                                             |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| UmbCheckout\_Basket\_Removed | Key of the [LineItem](/core-services/object-reference/lineitem) removed from the [Basket](/core-services/object-reference/basket) |

#### Checkout

Starts the Stripe Checkout process, the example below would typically be used on the Basket page

```cshtml
@using (Html.BeginUmbracoForm<StripeBasketController>(nameof(StripeBasketController.Checkout), FormMethod.Post))
{
    <button type="submit">Checkout</button>
}
```

This method sets the following TempData

| Key                      | Value                                                                                                                                     |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| UmbCheckout\_EmptyBasket | Returns true if there are 0 [LineItem](/core-services/object-reference/lineitem)s in the [Basket](/core-services/object-reference/basket) |

#### Change return page

If you would like to change the page which the user is redirected to after carrying out one of the above actions you simply need to pass in the page Guid

```html
<input type="hidden" name="redirectGuid" value="4a1f4198-e143-48ba-a0f5-1a7ef2df23aa" />
```

The example below shows how to do this with the Add method

```csharp
@using (Html.BeginUmbracoForm<StripeBasketController>(nameof(StripeBasketController.Add), FormMethod.Post))
{
    <label for="quantity">Quantity:</label>
    <input type="number" name="quantity" value="1" min="1" /> <br />
    <input type="hidden" name="key" value="@Model.Key" />
    <input type="hidden" name="currencyCode" value="GBP" />
    <input type="hidden" name="redirectGuid" value="4a1f4198-e143-48ba-a0f5-1a7ef2df23aa" />
    <button type="submit">Buy</button>
}
```


# Stripe Webhook Api

Please ensure you have added the webhook secret as per the [configuration](/payment-providers/payment-providers/stripe/configuration).

{% hint style="info" %}
The minimum [Stripe API version](https://dashboard.stripe.com/developers) is `2024-11-20`

If you cannot use this version, please install a newer version of the [Stripe.net NuGet package](https://www.nuget.org/packages/Stripe.net), which matches the Stripe API versions available in your account.\
Use the [Stripe.net changelog](https://github.com/stripe/stripe-dotnet/blob/master/CHANGELOG.md) to find which version of the NuGet package you need.

**NOTE:** When upgrading between major versions of the Stripe.net NuGet package, there may be breaking changes, if you encounter these and have a paid license, open a [support ticket](/support/support-tickets); otherwise, open an issue on [the tracker](https://github.com/UmbHost/UmbCheckout/issues)
{% endhint %}

You can configure Stripe to send the webhook request to the below api:

`/umbraco/api/StripeWebhookApi/CheckoutEvents`

This will trigger the following notifications

| Event                                | Notification                                                                                                                               |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| CheckoutSessionAsyncPaymentFailed    | [OnPaymentFailedNotification](/payment-providers/payment-providers/stripe/notifications/onpaymentfailednotification)                       |
| CheckoutSessionAsyncPaymentSucceeded | [OnPaymentSuccessNotification](/payment-providers/payment-providers/stripe/notifications/onpaymentsuccessnotification)                     |
| CheckoutSessionCompleted             | [OnCheckoutSessionCompletedNotification](/payment-providers/payment-providers/stripe/notifications/oncheckoutsessioncompletednotification) |
| CheckoutSessionExpired               | [OnCheckoutSessionExpiredNotification](/payment-providers/payment-providers/stripe/notifications/oncheckoutsessionexpirednotification)     |

{% hint style="info" %}
To be able to test the Webhook on localhost you need to install the [Stripe CLI](https://github.com/stripe/stripe-cli) you can find the instructions on how to configure the CLI to test the Webhook on the Stripe website using the link below, look for step 3 entitled "**Test the webhook**":

<https://stripe.com/docs/webhooks/quickstart?lang=dotnet#run>
{% endhint %}


# How to test the Stripe Webhook on localhost

To be able to test the Webhook on localhost you need to install the [Stripe CLI](https://github.com/stripe/stripe-cli) you can find the instructions on how to configure the CLI to test the Webhook on the Stripe website using the link below, look for step 3 entitled "**Test the webhook**":

<https://stripe.com/docs/webhooks/quickstart?lang=dotnet#run>


# Notification Handlers


# StripeResponseNotificationHandler

Notification which is triggered on a successful return from Stripe Checkout

This notification handler handles the clearing of the Basket on a successful return from Stripe Checkout

This notification handler is only run when the Stripe return redirect contains both `session_id` and `success` parameters.

The `session_id` must return a `complete` result from Stripe

The `success` parameters must be `true`


# Notifications


# OnCheckoutSessionCompletedNotification

Notification which is triggered on the Stripe CheckoutSessionCompleted Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# OnCheckoutSessionExpiredNotification

Notification which is triggered on the Stripe CheckoutSessionExpired Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# OnPaymentFailedNotification

Notification which is triggered on the Stripe CheckoutSessionAsyncPaymentFailed Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# OnChargeFailedNotification

Notification which is triggered on the Stripe OnChargeFailedNotification Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# OnPaymentIntentSucceededNotification

Notification which is triggered on the Stripe OnPaymentIntentSucceededNotification Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# OnPaymentIntentPaymentFailedNotification

Notification which is triggered on the Stripe OnPaymentIntentPaymentFailedNotification Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# OnPaymentIntentCreatedNotification

Notification which is triggered on the Stripe OnPaymentIntentCreatedNotification Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# OnPaymentIntentCancelledNotification

Notification which is triggered on the Stripe OnPaymentIntentCancelledNotification Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# OnChargeSucceededNotification

Notification which is triggered on the Stripe OnChargeSucceededNotification Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# OnShippingRateSavedNotification

Notification which is triggered a Stripe Shipping Rate is saved

The following properties are available within the notification

| Property Name | Type                                                                                      |
| ------------- | ----------------------------------------------------------------------------------------- |
| ShippingRate  | [ShippingRate](/payment-providers/payment-providers/stripe/object-reference/shippingrate) |


# OnShippingRateDeletedNotification

Notification which is triggered a Stripe Shipping Rate is deleted

The following properties are available within the notification

| Property Name | Type                                                                                      |
| ------------- | ----------------------------------------------------------------------------------------- |
| ShippingRate  | [ShippingRate](/payment-providers/payment-providers/stripe/object-reference/shippingrate) |


# OnPaymentSuccessNotification

Notification which is triggered on the Stripe CheckoutSessionAsyncPaymentSucceeded Webhook response

The following properties are available within the notification

| Property Name | Type  |
| ------------- | ----- |
| StripeEvent   | Event |


# Webhooks

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}

You can make use of the Umbraco Webhooks, you can read more about the Webhooks here:\
<https://docs.umbraco.com/umbraco-cms/reference/webhooks>


# OnChargeFailedWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnChargeSucceededWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnCheckoutSessionCompletedWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnCheckoutSessionExpiredWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnPaymentFailedWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnPaymentIntentCancelledWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnPaymentIntentCreatedWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnPaymentIntentPaymentFailedWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnPaymentIntentSucceededWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnPaymentSuccessWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnShippingRateDeletedWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnShippingRateSavedWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# Object Reference


# TaxRate

{% hint style="info" %}
This feature requires a paid license
{% endhint %}

The TaxRate object contains the below properties

| Property Name | Type   | Use                              |
| ------------- | ------ | -------------------------------- |
| Id            | long   | The internal Tax Rate id         |
| Key           | Guid   | The internal Tax Rate Key        |
| Name          | string | The Tax Rate Name                |
| Value         | string | The Tax Rate ID as set in Stripe |


# Property

The editable properties as shown in the backoffice

The Property object contains the below properties

| Property Name | Type                                                                                  | Use                              |
| ------------- | ------------------------------------------------------------------------------------- | -------------------------------- |
| Alias         | long                                                                                  | The Property alias               |
| Description   | Guid                                                                                  | The Property description         |
| Label         | string                                                                                | The Property label               |
| Value         | string                                                                                | The Property value               |
| View          | string                                                                                | The Property view name           |
| Validation    | [Validation](/payment-providers/payment-providers/stripe/object-reference/validation) | The Property validation settings |
| Config        | [Config](/payment-providers/payment-providers/stripe/object-reference/config)         | The Property configuration       |


# Validation

The validation settings for a property used in the backoffice

The Validation object contains the below properties

| Property Name    | Type   | Use                              |
| ---------------- | ------ | -------------------------------- |
| Mandatory        | bool   | True if the property is required |
| MandatoryMessage | string | Error message displayed          |
| Pattern          | string | RegEx to validate value against  |
| PatternMessage   | string | Error message displayed          |


# Config

The configuration settings for a property used in the backoffice

The Config object contains the below properties

| Property Name        | Type   | Use |
| -------------------- | ------ | --- |
| MinNumber            | int    |     |
| MaxNumber            | int    |     |
| OverlaySize          | string |     |
| HideAnchor           | bool   |     |
| IgnoreUserStartNodes | bool   |     |


# TaxRateResponse

{% hint style="info" %}
This feature requires a paid license
{% endhint %}

The TaxRate object contains the below properties

| Property Name | Type                   | Use                       |
| ------------- | ---------------------- | ------------------------- |
| Key           | Guid                   | The internal Tax Rate Key |
| Properties    | IEnumerable\<Property> | The backoffice properties |


# ShippingRateResponse

{% hint style="info" %}
This feature requires a paid license
{% endhint %}

The TaxRate object contains the below properties

| Property Name | Type                   | Use                            |
| ------------- | ---------------------- | ------------------------------ |
| Key           | Guid                   | The internal Shipping Rate Key |
| Properties    | IEnumerable\<Property> | The backoffice properties      |


# ShippingRate

The ShippingRate object contains the below properties

| Property Name | Type   | Use                                   |
| ------------- | ------ | ------------------------------------- |
| Id            | long   | The internal Shipping Rate id         |
| Key           | Guid   | The internal Shipping Rate Key        |
| Name          | string | The Shipping Rate Name                |
| Value         | string | The Shipping Rate ID as set in Stripe |


# uSync

Documentation for the uSync Stripe Addon package

The uSync Stripe package allows for the import and export of the Stripe Shipping Rates between environments


# Installation

Installing uSync Stripe

The uSync Stripe package is installed using the NuGet package manager using the below command:

```
dotnet add package UmbCheckout.Stripe.uSync
```

Alternatively, you can install using the NuGet package manager GUI within Visual Studio.


# Addons


# Tax Rates

{% hint style="info" %}
This feature requires a paid license
{% endhint %}

Tax Rates allow you to define any number of tax rates and assign them to products.

The Tax Rates are created within the Stripe Dashboard, you can then enter them into the UmbCheckout configuration area to make them available to the property editor which can be added to the product node.

### Stripe Dashboard

You can create Shipping Rates in the following section of the Stripe Dashboard:

Dashboard -> Products -> Tax rates -> New

### UmbCheckout Backoffice

You can enter Tax Rates into your Umbraco site by going to the following area:

Settings -> UmbCheckout -> Stripe Tax Rates -> Create Tax Rate

The tax rate settings are as follows:

| Name          | Value                                     |
| ------------- | ----------------------------------------- |
| Tax Rate Name | The name of the tax rate                  |
| Tax Rate ID   | The ID of the tax rate as found in Stripe |


# Services


# Stripe Tax Rate ApiService

A service which handles getting the Stripe Shipping Rates from the Stripe API

{% hint style="info" %}
This feature requires a paid license
{% endhint %}

The Stripe Tax Rate API service is what handles the retrieval of the Tax Rates from the Stripe API.

You can access the API service by injecting `IStripeTaxRateApiService` which can be found within the namespace `UmbCheckout.Stripe.Addons.Interfaces`

#### GetTaxRates

Gets the Tax Rates from the Stripe API

```csharp
Task<StripeList<TaxRate>> GetTaxRates();
```

#### GetTaxRate

Gets a Tax Rate from the Stripe API

Parameters:

| Name | Detail                    |
| ---- | ------------------------- |
| id   | Id of the Stripe Tax Rate |

```csharp
Task<TaxRate> GetTaxRate(string id);
```


# Stripe Tax Rate Database Service

A service which handles getting the Stripe Tax Rates from the database

{% hint style="info" %}
This feature requires a paid license
{% endhint %}

The Stripe database service is what handles the insertion, retrieval, updating, and deletion of the Tax Rates within the database.

You can access the database service by injecting `IStripeTaxRateDatabaseService` which can be found within the namespace `UmbCheckout.Stripe.Addons.Interfaces`

#### GetTaxRates

Gets the Tax Rates

```csharp
Task<IEnumerable<TaxRate>> GetTaxRates();
```

#### GetTaxRate

Gets a specified Tax Rate

Parameters:

| Name | Detail                                                                                             |
| ---- | -------------------------------------------------------------------------------------------------- |
| key  | Key of the Stripe [Tax Rate](/payment-providers/payment-providers/stripe/object-reference/taxrate) |

```csharp
Task<TaxRate?> GetTaxRate(Guid key);
```

#### GetTaxRate

Gets a specified Tax Rate

Parameters:

| Name  | Detail                                                                                                  |
| ----- | ------------------------------------------------------------------------------------------------------- |
| value | StripeId of the Stripe [Tax Rate](/payment-providers/payment-providers/stripe/object-reference/taxrate) |

```csharp
Task<TaxRate?> GetTaxRate(string value);
```

#### CreateTaxRate

Creates a Tax Rate

Parameters:

| Name    | Detail                                                                                      |
| ------- | ------------------------------------------------------------------------------------------- |
| taxRate | The Stripe [Tax Rate](/payment-providers/payment-providers/stripe/object-reference/taxrate) |

```csharp
Task<TaxRate?> CreateTaxRate(TaxRate taxRate);
```

#### UpdateTaxRate

Updates a specified Tax Rate

Parameters:

| Name    | Detail                                                                                      |
| ------- | ------------------------------------------------------------------------------------------- |
| taxRate | The Stripe [Tax Rate](/payment-providers/payment-providers/stripe/object-reference/taxrate) |

```csharp
Task<TaxRate?> UpdateTaxRate(TaxRate taxRate);
```

DeleteTaxRate

Deletes a specified Tax Rate

Parameters:

| Name | Detail                                                                                             |
| ---- | -------------------------------------------------------------------------------------------------- |
| key  | Key of the Stripe [Tax Rate](/payment-providers/payment-providers/stripe/object-reference/taxrate) |

```csharp
Task<bool> DeleteTaxRate(Guid key);
```


# Notifications


# OnStripeTaxRateSavedNotification

Notification which is triggered a Stripe Tax Rate is saved

The following properties are available within the notification

| Property Name | Type                                                                            |
| ------------- | ------------------------------------------------------------------------------- |
| TaxRate       | [TaxRate](/payment-providers/payment-providers/stripe/object-reference/taxrate) |


# OnStripeTaxRateDeletedNotification

Notification which is triggered a Stripe Tax Rate is deleted

The following properties are available within the notification

| Property Name | Type                                                                            |
| ------------- | ------------------------------------------------------------------------------- |
| TaxRate       | [TaxRate](/payment-providers/payment-providers/stripe/object-reference/taxrate) |


# Webhooks

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}

You can make use of the Umbraco Webhooks, you can read more about the Webhooks here:\
<https://docs.umbraco.com/umbraco-cms/reference/webhooks>


# OnStripeTaxRateDeletedWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# OnStripeTaxRateSavedWebhook

{% hint style="info" %}
Webhooks require Umbraco V13+ and UmbCheckout V1.4+
{% endhint %}


# Property Editors


# Tax Rates Property Editor

The Tax Rates property editor allows you to assign a [TaxRate](/payment-providers/payment-providers/stripe/object-reference/taxrate) to a product which is used to calculate owed tax during the checkout

<figure><img src="https://2748728690-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh5UHoyl8SSRgUKuYYLss%2Fuploads%2FOdJlc74sLWlnCMuxitZd%2FTaxRatePropertyEditor.png?alt=media&amp;token=e29f1d0a-d331-4d2b-bd37-5ed488c79c1d" alt=""><figcaption></figcaption></figure>


# uSync

Documentation for the uSync Stripe Addon package

The uSync Stripe package allows for the import and export of the Stripe Tax Rates between environments


# Installation

Installing uSync Stripe

The uSync Stripe package is installed using the NuGet package manager using the below command:

```
dotnet add package UmbCheckout.Stripe.Addons.uSync
```

Alternatively, you can install using the NuGet package manager GUI within Visual Studio.


# View Components




---

[Next Page](/llms-full.txt/1)

