Area: Optimizely Commerce
Applies to versions: 10.5-13
Other versions:
ARCHIVED This content is retired and no longer maintained. See the version selector for other versions of this topic.

DataCash installation and configuration [Legacy]

Recommended reading 

This topic describes how to install and use the DataCash payment provider, one of several Episerver Commerce payment solutions.

In this topic


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

    Note: To avoid assembly conflicts, install the Episerver 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):
    requestDoc.set("Request.Transaction.TxnDetails.The3rdMan.Realtime.real_time_sha1", HashCode(merchantReference));

    Important! 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.
    payment.Properties["NextAction"] as Action).Invoke();
  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.

Commerce Manager

  1. Find the Commerce Manager Apps folder, located under the Episerver 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:

    1. In your solution's front-end site project, add references to the deployed .dlls.
    2. Open the CheckoutPage page type in Features/Checkout/Pages.
    3. Add DataCashPage type to AvailableContentTypes attribute.
      [AvailableContentTypes(Include = new [] { typeof(OrderConfirmationPage), typeof(MultiShipmentPage), typeof(DataCashPage) }, IncludeOn = new [] {typeof(StartPage)})]
    4. Rebuild the Quicksilver project.

DataCash configuration

Setting up the DataCash payment provider in Commerce Manager

Prerequisite: You have a DataCash account registered at DataCash website.

After deploying all necessary files, open the Episerver 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.
  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.
  6. Open the Markets tab and add the expected markets for this payment.
  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.

Note: 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.)

Setting up 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. Navigate 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.
    3. Navigate 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.

Configuring 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 Episerver 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).

Note: 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.

Do you find this information helpful? Please log in to provide feedback.

Last updated: Mar 29, 2021

Recommended reading