FILTER BY TAG

Installing and Testing the Client

Minimum System Requirements

  • Microsoft Windows 2000 or later
  • .NET Framework 4.0 or later
  • Microsoft Visual Studio 2010
    Failure to configure your client API host to a unique, public IP address will cause inconsistent transaction results.
The client API request ID algorithm uses a combination of IP address and system time, along with other values. In some architectures this combination might not yield unique identifiers.

Transaction Security Keys

The first thing you must do is create your security key. The client uses the security key to add a digital signature to every request that you send. This signature helps ensure that no one else can use your Cybersource account to process orders. You specify the location of your key when you configure the client.
You must generate two transaction security keys—one for the Cybersource production environment and one for the test environment. For information about generating and using security keys, see
Creating and Using Security Keys
(PDF | HTML).
You must protect your security key to ensure that your Cybersource account is not compromised.

Installing the Client

The .NET SDK is available to install from GitHub: https://github.com/CyberSource/cybersource-sdk-dotnet

Using the NuGet Package Manager

We recommend using the NuGet Package Manager to install the .NET SDK.
Run the following command in the NuGet Package Manager console:
PM> Install-Package CyberSource

Installing Individual Files

The .NET SDK files are available to download independently from GitHub: https://github.com/CyberSource/cybersource-sdk-dotnet/releases

Install the Files Individually

  1. Download the latest zip file. The current version is
    cybersource-sdk-dotnet-1.0.0.zip
    .
  2. Extract the contents of the zip file to an appropriate location.
  3. Add CyberSource.Base.dll and CyberSource.Clients.dll to your project references.

Upgrading from a Previous Version

The .NET 4.0 or later Simple Order API client is a pure .NET client without dependencies outside of the .NET 4.0 or later Framework. It is simplified in comparison to previous Simple Order API .NET clients because it does not require the Microsoft Web Services Enhancements (WSE) and it does not use the Cybersource security libraries.
Previous versions of the Cybersource.Clients.dll required that you register CybsWSSecurity.dll as a COM object. The CybsWSSecurity.dll had dependencies on many other dynamic-link libraries (DLLs). Because the .NET 4.0 or later Simple Order API client does not use the Cybersource security libraries, you can remove or unregister the following DLLs:
  • CybsWSSecurity.dll (unregister)
  • CybsWSSecurityIOP.dll
  • CyberSource.WSSecurity.dll
  • domsupport_1_4_0.dll
  • Msvcp60.dll
  • platformsupport_1_4_0.dll
  • spapache.dll
  • xalandom_1_4_0.dll
  • xalansourcetree_1_4_0.dll
  • xerces-c_2_1_0.dll
  • xercesparserliaison_1_4_0.dll
  • xmlsupport_1_4_0.dll
  • xpath_1_4_0.dll

Migrate from a .NET Framework 1.x Client

  1. Replace the old DLLs with the ones from this package.
  2. In your project, remove references to the previous
    Cybersource
    DLLs.
  3. Add a reference to
    CyberSource.Clients.dll
    .
  4. In your request code, make the following changes:

    ADDITIONAL INFORMATION

    Replace the referenced
    Cybersource
    namespaces with this one:
    CyberSource.Clients
    If you use the SOAP client, add the following namespace:
    CyberSource.Clients.SoapWebReference
    Example
    : In C#, with the SOAP client, you now have:
    using CyberSource.Clients.
    using CyberSource.Clients.SoapWebReference; /*
    for SOAP client only
    */
  5. Follow the instructions for migrating from .NET Framework 2.X.

Migrate from a .NET Framework 2.x Client

  1. Follow the installation instructions in Installing the Client.
  2. Open your project in Visual Studio 2010. If necessary, use the conversion wizard to update your project from Visual Studio 2005 to Visual Studio 2010.
  3. In your project properties, set the target framework to
    .NET Framework 4
    .
  4. Make sure that your reference to CyberSource.Clients points to the new .NET 4.0 or later version of the DLL. You must use the DLLs that you installed in Step 1.
  5. Remove references to System.Web.Services and remove the following namespace from your code:

    ADDITIONAL INFORMATION

    using System.Web.Services.Protocols
  6. If your code contains catch statements that use
    SignException
    , change them to use
    CryptographicException
    instead. Making this change requires that you add a reference to System.Security and add the following namespace to your code:

    ADDITIONAL INFORMATION

    using System.Security.Cryptography
    • For SOAP and name-value pair (NVP) clients only:
      Remove any catch statements that use
      SoapHeaderException
      or
      SoapBodyException
      .
    • For SOAP clients only:
      Consider replacing these exceptions with appropriate Windows Communication Foundation (WCF) services exceptions such as
      MessageSecurityException
      ,
      EndpointNotFoundException
      , or
      ChannelTerminatedException
      depending on your requirements. Then you must add a reference to
      System.ServiceModel
      and add the following namespaces to your code:
      using System.ServiceModel;
      using System.ServiceModel.Security;
    You have successfully upgraded your client to the new version.

Testing the Client

See the “Running the Samples” section on GitHub: https://github.com/CyberSource/cybersource-sdk-dotnet#running-the-samples
Once you have tested the client, you are ready to create your own code to request the Cybersource services. Depending on which API you are using, see:

Using the Test Applications

Each type of client variation—name-value pair, XML, and SOAP—includes a pre-compiled test application. You can use these test applications to ensure that the client was installed correctly. The applications request both credit card authorization and capture.
The test applications and their source code are installed in the
samples
directory. The
bin
subdirectory contains the pre-compiled binaries. The
src
subdirectory contains the source code and Visual Studio project files.

Configuring the Test Applications

Before you run a test application, you must edit its application settings file. The following table describes all the configuration fields that you can use in this file.
Configuration settings supported by the latest 1.x.x version are still supported. However, we recommend that you use the following new settings for this and future versions.
Fields in the Settings File
Field Name
Description
Required/Optional
cybs.connectionLimit
Maximum number of allowed concurrent connections between the client and the
Cybersource
server. For more information on this field and alternate ways to set the connection limits, see "Setting the Connection Limit," page 94.
Optional
cybs.keysDirectory
Directory that contains the pkcs12 security key file. For example:
c:\keys\
Required
cybs.merchantID
Your merchant ID. You can override this value by providing the merchantID field in the request itself. The merchant ID is case sensitive.
Optional
cybs. sendToProduction
Flag that indicates whether the transactions for this merchant should be sent to the production server. Use one of these values:
  • false
    : Do not send to the production server; send to the test server (default setting).
  • true
    : Send to the production server.
    Make sure that if your merchant ID is configured to use the test mode, you send requests to the test server.
Required
cybs.keyFilename
Name of the security key file name for the merchant in the format
<
security_key_filename
>
.
p12
.
Optional
cybs.serverURL
Alternate server URL to use. For more information, see Configuring Your Settings for Multiple Merchants. Give the complete URL because it will be used exactly as you specify.
Optional
cybs.enableLog
Flag directing the client to log transactions and errors. Use one of these values:
  • false
    : Do not enable logging (default setting).
  • true
    : Enable logging.
    Logging can cause very large log files to accumulate. Therefore, we recommend that you use logging only when troubleshooting problems. To comply with all Payment Card Industry (PCI) and Payment Application (PA) Data Security Standards regarding the storage of credit card and card verification number data, the logs that are generated contain only masked credit card and card verification number data (CVV, CVC2, CVV2, CID, CVN).
    Follow these guidelines:
  • Use debugging temporarily for diagnostic purposes only.
  • If possible, use debugging only with test credit card numbers.
  • Never store clear text card verification numbers.
  • Delete the log files as soon as you no longer need them.
  • Never send email to
    Cybersource
    containing personal and account information, such as customers' names, addresses, card or check account numbers, and card verification numbers.
    For more information about PCI and PABP requirements, see www.visa.com/cisp.
Optional
cybs.logDirectory
Directory to which to write the log file. Note that the client will not create this directory for you; you must specify an existing directory. The client includes a
logs
directory that you can use. Include the path. For example:
c:\simapi-net-2.0.0\logs
.
Required if
cybs.
enableLog

is true
cybs.logFilename
Name of the log file. The client uses
cybs.log
by default.
Optional
cybs.logMaximumSize
Maximum size in megabytes for the log file. The default value is
10
. When the log file reaches the specified size, it is archived into
cybs.log
.<yyyymmdd
T
hhmmssxxx> and a new log file is started. The xxx indicates milliseconds.
Optional
cybs.timeout
Length of time-out in seconds. The default is 130.
Optional
cybs.proxyURL
URL of a proxy server. For example:
https://proxy.example.com:4909
Optional
cybs.proxyUser
User name for the proxy server.
Optional
cybs.proxyPassword
Password for the proxy server.
Optional

Test Applications

  1. Decide which test application you want to run, such as
    SoapSample.exe
    .
  2. Using a text editor, open the settings file for the test application. The settings file has the same name as the test application, with the extension
    config
    appended to the name. For example,
    SoapSample.exe.config
    .
  3. Find the
    cybs.merchantID
    field and change its value to your Cybersource merchant ID. For example, if your merchant ID is
    widgetsinc
    , change the field to 

    <add key="cybs.merchantID" value="
    widgetsinc
    "/>
    . The merchant ID is case sensitive.
  4. Find the
    cybs.keysDirectory
    field and change its value to the directory that contains your security key. For example, if your key is in
    c:\keys\
    , change the field to 

    <add key="cybs.keysDirectory" value="
    c:\keys\
    "/>
    .
  5. Edit other fields as necessary. See Table 17, "Fields in the Settings File," for a complete list.
  6. Save and close the settings file.

Configuring Your Settings for Multiple Merchants

If you have multiple merchant IDs, or if you are a reseller handling multiple merchants, you can configure the settings to allow different configurations for different merchant IDs.
To specify the settings for a specific merchant, prefix all settings, except for
cybs.merchantID
and the
cybs.proxy
*, with
<merchantID>.
The
cybs.proxy*
wildcard refers to the
proxyURL
,
proxyUser
,
proxyPassword
settings.
You have a new merchant with merchant ID of
NewMerchant
. To send only test transactions for this merchant, you can set all requests for
NewMerchant
to go to the test server:
<add key="cybs.NewMerchant.sendToProduction" value="false"/> <add key="cybs.sendToProduction" value="true"/>
With the second line of the example, the client will send all other requests to the production server.

Running the Test Applications

Run Test Applications

  1. Open a Windows command-line shell.
  2. Change to the directory where the test application is located.
  3. Type the name of the test application, then press Enter. The test application requests an Cybersource service, interprets the reply, and prints information about the result. If you receive a .NET exception, use the error message to debug the problem.

Deploying the Client to Another Computer

To deploy the client to another computer without running the installer provided by
Cybersource
, you must include all the files from the
lib
directory in your custom installer and then run it. Then the client is ready to be used on the computer.

Going Live

When you complete all of your system testing and are ready to accept real transactions from consumers, your deployment is ready to
go live
.
After your deployment goes live, use real card numbers and other data to test every card type you support. Because these are real transactions in which you are buying from yourself, use small monetary amounts to do the tests. Process an authorization, then capture the authorization, and later refund the money. Use your bank statements to verify that money is deposited into and withdrawn from your merchant bank account as expected. If you have more than one merchant ID, test each one separately.

Cybersource
Essentials Merchants

If you use
Cybersource
Essentials services, you can use the
Business Center
site to go live. For a description of the process of going live, see Getting Started with Cybersource Essentials.
You must also configure your client so that it sends transactions to the production server and not the test server. See the description of the configuration setting
cybs. sendToProduction
.

Cybersource
Advanced Merchants

If you use
Cybersource
Advanced services, see Getting Started with Cybersource Advanced for information about going live.
When your deployment goes live, your
Cybersource
account is updated so that you can send transactions to the
Cybersource
production server. If you have not already done so, you must provide your banking information to
Cybersource
so that your processor can deposit funds to your merchant bank account.
After
Cybersource
confirms that your account is live, make sure that you update your system so that it can send requests to the production server (
ics2wsa.ic3.com
or
ics2ws.in.ic3.com
in India) using your security key for the production environment. The test server (
ics2wstesta.ic3.com
) cannot be used for real transactions. For more information about sending transactions to the production server, see the description of the configuration setting
cybs. sendToProduction
.

Updating the Client to Use a Later API Version

Cybersource
periodically updates the Simple Order API. You can update your existing client to work with the new API version. For a list of the available API versions, go to: https://ics2wsa.ic3.com/commerce/1.x/transactionProcessor
Alternately, if a new client is available that works with the later API version, you can download that new client.
The new client may have new functionality unrelated to the changes in the API. Read the release notes in the
CHANGES
file to determine if the new client contains new functionality that you want to use.

Update a Name-Value Pair Client

  1. Load
    src\CyberSource.Clients.sln
    in Visual Studio 2010.
  2. In the Solution Explorer, locate the Service References folder.
  3. Right-click
    NVPWebReference
    and choose
    Configure Service Reference
    .
  4. Update the Address field with the New WSDL URL. Typically, only the version number at the end of the URL needs to be updated.
  5. Build the Release configuration.
  6. Save a copy of the original
    CyberSource.Clients.dll
    and then replace it with the newly built
    CyberSource.Clients.dll
    .

Update a SOAP Client

  1. Load
    src\CyberSource.Clients.sln
    in Visual Studio 2010.
  2. In the Solution Explorer, locate the Service References folder.
  3. Right-click
    SoapWebReference
    and choose
    Configure Service Reference
    .
  4. Update the Address field with the New WSDL URL. Typically, only the version number at the end of the URL needs to be updated.
  5. Build the Release configuration.
  6. Save a copy of the original
    CyberSource.Clients.dll
    and then replace it with the newly built
    CyberSource.Clients.dll
    .

Update an XML Client

Updating the client is unnecessary. Start using the new namespace URI in your input XML documents. The client automatically uses the specified version.