HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket


## Deployment

Note

The AuthorizationTokenEx payment provider is not yet available for subscriptions (payment plans).

Follow the steps below to install and deploy the [AuthorizeTokenEx payment provider](🔗).

### Download file packages

[Download or clone the Commerce Payment Providers repository from Github](🔗). This contains open-sourced payment gateways for Optimizely Commerce, including the AuthorizeTokenEx payment provider projects described below.

Note

The AuthorizeTokenEx payment provider requires Optimizely Commerce version 13.29.0 or higher.

The repository contains the following AuthorizeTokenEx projects:

  • **EPiServer.Commerce.Payment.AuthorizeTokenEx**. Contains _AuthorizeTokenEx payment_ and _AuthorizeTokenEx gateway_ and will be deployed to both Commerce Manager and the front-end site.

  • **EPiServer.Commerce.Payment.AuthorizeTokenEx.CSR**. Contains API controller and React components, and will be deployed to the front-end site.

Follow the steps below to add the projects to your solution.

### Build the the AuthorizeTokenEx project

  1. Open the **AuthorizeTokenEx** project and save the solution.

  2. Rebuild the solution and make sure the packages **AuthorizeNet** and **EPiServer.Commerce.Core**are installed successfully from NuGet. You can also install the packages manually as follows:

    • Install the **AuthorizeNet** NuGet package by executing this command in the Package Manager Console: `Install-Package AuthorizeNet -version 1.9.4`

    • Install the **EPiServer.Commerce.Core** NuGet package by executing this command in the Package Manager Console: `Install-Package EPiServer.Commerce.Core`

  3. Rebuild the **AuthorizeTokenEx project**. You should now have the **EPiServer.Commerce.Payment.AuthorizeTokenEx.dll** and **AuthorizeNet.dll** assemblies.

#### Project structure

The project package contains the files and folders described in the following.



FileDescription
AuthorizeTokenExService.csContains all the functions needed to perform operations of Authorize integrated with TokenEx.
AuthorizeNetTokenExCimBasedManager.csContains all the functions needed to perform operations for AuthorizeTokenExGateway.
AuthorizeTokenExGateway.csMain business payment gateway.
ConfigurePayment.ascxCommerce Manager payment editor.

### Build the AuthorizeTokenEx.CSR project

  1. Open the **AuthorizeTokenEx.CSR** project and save the solution.

  2. Rebuild solution and make sure the packages **AuthorizeNet** and **EPiServer.Commerce.Core**are installed successfully from NuGet. These should be installed automactically after rebuilding, if not you can install them manually as follows:

    • Install the **AuthorizeNet** NuGet package by executing this command in the Package Manager Console: `Install-Package AuthorizeNet -version 1.9.4`

    • Install the **EPiServer.Commerce.Core** package by executing this command in the Package Manager Console: `Install-Package EPiServer.Commerce.Core`

  3. Rebuild the **EPiServer.Commerce.Payment.AuthorizeTokenEx.CSR** project. You should now have the _EPiServer.Commerce.Payment.AuthorizeTokenEx.CSR.dll_.

The important file in _CSRExtensibility\\react-app\\dist\\tokenExPayment.min.js_, which is deployed to the front-end site. It contains the TokenEx payment method component for the Order Management (CSR) user interface, and the TokenExConfiguration. 



**Project structure**

The project package contains the files and folders described in the following.



FileDescription
Controllers\\ TokenExApiController.csController for generating TokenEx configuration, see [TokenEx configuration object](🔗).
Controllers\\ TokenExPaymentsControllerBase.csController base for handling the payment.
Controllers\\ OrderTokenExPaymentsController.csController for handling payment for an _order_. **Note** that currently TokenEx is not supported for subscriptions. 
CSRExtensibility folderContains a React application for the TokenEx component, based on the [CSR/Order Management extensibility feature](🔗).
Models\\ TokenExIframeConfigModel.csTokenEx configuration model.
Models\\ TokenizationPaymentModel.csTokenization payment model.
TokenExConfiguration.csContains configuration for TokenEx for the CSR/Order Management user interface.

## Commerce Manager setup

  1. Find the **Commerce Manager Apps** folder, located in the **Optimizely Commerce Manager** project folder.

  2. Deploy the _ConfigurePayment.ascx_ file to the **Apps\\Order\\Payments\\Plugins\\ AuthorizeTokenEx** folder. If the AuthorizeTokenEx folder does not exist, create it.

  3. Deploy **AuthorizeNet.dll** and **EPiServer.Business.Commerce.Payment.Authorize.dll**  to the **bin** folder of your Commerce Manager site.

  4. In your solution's Commerce Manager project, add references to the deployed .dll's and rebuild.

### Configure AuthorizeTokenEx

After deploying all necessary files, open the Commerce Manager back-end site and follow these steps.

  1. Go to **Administration > Order System > Payments > English (United States)**. The last option is the language in which you want to make the AuthorizeTokenEx payment available.

  2. Click **New**to create a new payment method.

    • For **System Keyword**, select **AuthorizeTokenEx**, the name of the folder created during deployment.

    • For **Class Name**, select **EPiServer.Business.Commerce.Payment.Authorize.AuthorizeTokenizationGateway**.

    • For **Payment Class**, select **EPiServer.Commerce.Order.Payments.Internal.TokenizationPayment**.



  1. Click **OK** to save the AuthorizeTokenEx payment method.

  2. Open the AuthorizeTokenEx payment method for additional editing.

  3. Go to the **Parameters**tab and enter the following:

    • **API UserId** - the API **user name** Authorize.Net provides when you register to use Authorize.Net’s API calls.

    • **Transaction Key** - your Authorize.Net API **user password**.

### Configure AuthorizeTokenEx on the front-end site

  1. Go to the front-end site.

  2. Deploy **AuthorizeNet.dll**, **EPiServer.Commerce.Payment.Authorize.dll**, and **EPiServer.Commerce.Payment.AuthorizeTokenEx.CSR.dll** to the **bin** folder of your front-end site.

  3. In your front-end site project of your solution, add references to the deployed .dll's and rebuild.

  4. In the _root folder_ of the front-end site project, create a folder with the path \*CSRExtensibility\\react-app\\dist\* and copy the file **tokenExPayment.min.js** to this folder. **Note:** You can change the location for tokenExPayment.min.js, but remember to update the TokenExConfiguration.cs correspondingly.

  5. Edit the **appSettings** section in web.config as follows:

#NameDescription
1episerver:tokenization.TokenizationIdYour TokenEx account ID.
2episerver:tokenization.ClientSecretKeyTokenEx client secret key.
3episerver:tokenization.ApiKeyTokenEx API key.
4episerver:tokenization.TestModeSpecific production or test environment. Value: true/false.

Note

The front-end site must run on HTTPS to use the AuthorizeTokenEx payment provider.