Hide menu Last updated: Apr 13 2017
Area: Episerver Commerce Applies to versions: 10.5 and higher
Other versions:

DataCash installation and configuration

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

Deployment

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.CoreNuGet 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, PreAuthenticateRequest method):
    requestDoc.set("Request.Transaction.TxnDetails.The3rdMan.Realtime.real_time_sha1", HashCode(merchantReference));
  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:

File Description
DataCashPaymentGateway.cs main payment gateway business
DataCashPaymentMetaClass.xml contains payment meta class
DataCashPaymentController.cs the page controller
XML files in lang folder language files
CountriesCodes.txt resource files
ConfigurePayment.ascx,
EditTab.ascx and its ascx.cs, ascx.designer.cs
Commerce Manager payment editor
PaymentMethod.ascx
and its ascx.cs, ascx.designer.cs
front-end webform view
_DataCashPaymentMethod.cshtml, _DataCashConfirmation.cshtml front-end mvc view
DataCashConfiguration.cs,
DocumentHelpers.cs,
RequestDocumentCreation.cs,
CountryCodes.cs
helper classes
DataCashPage.cs the page type
DataCash-logo.jpg logo, in images folder

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 DataCash-logo.jpg to your website's styles\images folder.
  2. Deploy all files in lang folder to the Commerce Sample site's lang folder.
  3. 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 _DataCashPaymentMethod.cshtml to your website's Views\Sharedfolder.

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

    1. Open the CheckoutPage page type in Features/Checkout/Pages.
    2. Add DataCashPage type to AvailableContentTypesattribute.
      [AvailableContentTypes(Include = new [] { typeof(OrderConfirmationPage), typeof(MultiShipmentPage), typeof(DataCashPage) }, IncludeOn = new [] {typeof(StartPage)})]
    3. 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 keyto 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.

Comments