HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback

## Install DataCash

Follow these steps to deploy the DataCash payment provider.

### Build a DataCash project

  1. [Download the DataCash payment provider file package](🔗), which provides an **EPiServer.Business.Commerce.Payment.DataCash** project.

  2. Open the **DataCash** project and and save the solution.

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


    To avoid assembly conflicts, install the Optimizely Commerce Core version that your site is using. Also, apply no database transforms.

  4. If you are using a live account, uncomment the following line to activate the real-time fraud checking (in the DataCashPaymentGateway class, CreateDocumentForPreAuthenticateRequest method):



    If you are using Commerce 11 or higher, ignore step 5. That code was removed from Commerce 11.

  5. If you are using workflow, uncomment the following line in **DataCashPaymentGateway.cs**.

  6. Rebuild the DataCash project. Now, you have the files EPiServer.Business.Commerce.Payment.DataCash.dll and Transaction.dll.

The project package includes these files.

DataCashPayment.csrepresents payment class for DataCash
_For Commerce versions 10.5 and 11_<br><br>DataCashPaymentOption<br><br>_For Commerce 12 versions and up_<br><br>DataCashPaymentMethod.csrepresents a payment method for DataCash
Transaction.dll library file
DataCashPaymentGateway.csmain payment gateway business
DataCashPaymentMetaClass.xmlcontains payment meta class
DataCashPaymentController.csthe page controller
XML files in lang folderlanguage files
CountriesCodes.txtresource files
ConfigurePayment.ascx, <br>EditTab.ascx and its ascx.cs, ascx.designer.csCommerce Manager payment editor
PaymentMethod.ascx <br>and its ascx.cs, ascx.designer.csfront-end webform view
_For Commerce versions 10.5 and 11_<br><br>\_DataCashPaymentMethod.cshtml, \_DataCashConfirmation.cshtml<br><br>_For Commerce 12 versions and up_<br><br>\_DataCash.cshtml, <br>\_DataCashConfirmation.cshtmlfront-end mvc view
DataCashConfiguration.cs, <br>DocumentHelpers.cs, <br>RequestDocumentCreation.cs, <br>CountryCodes.cshelper classes
DataCashPage.csthe page type
DataCash-logo.jpglogo, in images folder

### Commerce Manager

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

  2. Deploy the **ConfigurePayment.ascx** file to the _Apps\\Order\\Payments\\Plugins\\DataCash_ folder. Create the DataCash folder if it does not exist.

  3. Deploy the **EditTab.ascx** file to the _Apps\\Order\\Payments\\MetaData\\DataCash_ folder. Create the DataCash folder if it does not exist.

  4. Deploy **Transaction.dll** and **EPiServer.Business.Commerce.Payment.DataCash.dll** to your Commerce Manager site's bin folder.

### Front-end site Webform (Sample site)

  1. Deploy **PaymentMethod.ascx** to the website's _Templates\\Sample\\Units\\CartCheckout\\DataCash_ folder.

  2. Deploy **DataCash-logo.jpg** to your website's _styles\\images_ folder.

  3. Deploy all files in lang folder to the Commerce Sample site's lang folder.

  4. Deploy **Transaction.dll** and **EPiServer.Business.Commerce.Payment.DataCash.dll** to the Commerce Sample site's bin folder.

### Front-end site MVC (Quicksilver)

  1. Deploy **DataCash-logo.jpg** to your website's _styles\\images_ folder.

  2. Deploy all files in lang folder to the Quicksilver site's lang folder.

  3. Deploy **Transaction.dll**, **EPiServer.Business.Commerce.Payment.DataCash.dll** to your Quicksilver site's bin folder.

  4. Deploy **\_DataCashConfirmation.cshtml** and **\_DataCash.cshtml** to your website's \*Views\\Shared**\* **folder.

    **(Optional)** The following steps allow the creation of a DataCashPage under a Checkout page:

    a. In your solution's front-end site project, add references to the deployed .dlls. b. Open the **CheckoutPage** page type in _Features/Checkout/Pages_. c. Add **DataCashPage** type to **AvailableContentTypes** attribute. `[AvailableContentTypes(Include = new [] { typeof(OrderConfirmationPage), typeof(MultiShipmentPage), typeof(DataCashPage) }, IncludeOn = new [] {typeof(StartPage)})]`

  5. Rebuild the Quicksilver project.

## Configure DataCash

### Configure the DataCash payment provider in Commerce Manager


You have a DataCash account registered at [DataCash website](🔗).

After deploying all necessary files, open the Optimizely Commerce Manager back-end site. Then, 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 DataCash payment available.

  2. Select **Create new payment method**

    • For **System keyword**, enter **DataCash**, the name of the folder created during deployment.

    • For** Class Name**, select **EPiServer.Business.Commerce.Payment.DataCash.DataCashPaymentGateway**.

    • For** Payment Class**, select **EPiServer.Business.Commerce.Payment.DataCash.Orders.DataCashPayment**.

    **Overview tab** 

  3. Click **OK** to save the DataCash payment method.

  4. Open the **DataCash** payment method for additional editing.

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

    • **Host address** – The URL of the DataCash server to which to send transactions _(required)_.

    • **vTID** – DataCash account number _(required)_.

    • **Password** – Password for vTID _(required)_.

    • **Log file** – The log file to which the API writes the output log. The folder that contains the log file should be available. Make sure that the IUSR and IIS\_IUSRS have modify permission for this file. If you do not set the log file, no logging occurs.

    • **Time out** – Number of seconds for transaction time out. If you do not set a time out, the default is 60 seconds.

    • **Logging level** – The level that should be logged.

    • **Payment page Id** – The ID of the payment page (configured by DataCash) that you want to display.

    • **Proxy**. The URL of a proxy to connect through. If you do not set a proxy, the server's default proxy is used.

    \*_Parameters tab_ 

  6. Open the **Markets** tab and add the expected markets for this payment.

    **Markets tab** 

  7. In **Commerce Manager**, navigate to **Administration** > **Order System** > **Meta Classes**.

  8. Click **Import MetaData** to populate the MetaData import screen.

  9. Select the DataCash/DataCashPaymentMetaClass.xml file to import.


    For testing purposes, manually request DataCash to activate HPS and the 3rd Man service. (These services are not configured by default. Also, the 3rd Man service is available for live accounts only.)

### Configure DataCash payment provider in the front-end site

To set up the DataCash payment provider, browse to the front-end Commerce site and follow these steps.

  1. Go to the **CMS > Admin > Content Type** tab.

  2. Add two properties, **DataCashPaymentPage**, **DataCashPaymentLandingPage** of the type Page, to the Start page (or Home page) page type.

    **Common settings tab** 

  3. Go to **CMS > Edit**.

  4. Create a page using a **DataCash Payment Page** under a **Checkout** page, then publish it.


  5. Open the site's home page, click the **Site Structure** tab and define two new properties:

    • Set the **DataCashPaymentPage** property to the DataCash page that was just created.

    • Set the **DataCashPaymentLandingPage** property to Order confirmation page.

    **Site Structure tab**


### Configure the DataCash hash key (optional)

DataCash uses a \_private hash key_to ensure security in communications. This private hash key is used to create secure hash keys, which are appended to an accept URL and a cancel URL.

The information about accept URL and cancel URL is sent to DataCash using HTTPS, so these keys are not exposed. When DataCash redirects a user to those URLs, the keys verify that the request comes from DataCash only, since only DataCash knows about the keys. You can configure this hash key in the application settings configuration section under **DataCashHashKey**.

### DataCash user experience

After you deploy the files and configure the DataCash Payment module on your Optimizely Commerce website, a **DataCash** option should appear in your checkout page. This section explains how a user interacts with PayPal.

  1. During checkout, on the checkout page, select **DataCash** as the payment method.


  2. When you click **Place order**, you are redirected to DataCash.com to confirm the payment. 

  3. When you finalize the approval process, you are redirected to the **Order confirmation** page (previously configured). 


DataCash.com checks billing and shipping addresses very carefully. If you test with a US address, use a correct and complete one with ZIP code, state, and city. Otherwise, the DataCash API precheck fails, and you cannot complete the payment.