Getting Started

Download the SDK

Download the Paysafe C# SDK from GitHub

Before You Begin

Before you use an SDK, you’ll need the API credentials (API Key) that it uses to make JSON requests to our server via the Paysafe REST API.

  • Your Paysafe API Key Username
  • Your Paysafe API Key Password
  • Your Paysafe Account Number

To get your test account, if you intend to use the Direct Debit SDK, contact Paysafe support, otherwise click Sign Up above. Once logged in to the Back Office you can retrieve your Account Number (choose Accounts and copy it from the Account column) and your API Key User name and Password (choose Settings > API Key). See More about Authentication for more information.

Installation

In order to install the C# SDK, you must have Microsoft Visual Studio 2013 Professional installed. Once Microsoft Visual Studio is installed you can run the Sample Application to view how the C# SDK functions.

Configure Your Setup

Once you have installed the SDK, modify your configuration file with your Paysafe credentials.

  1. Open the configuration file:

    c-sharp_SDK\SampleApp\web.config

  2. Update the following details:

    Key Value
    AccountNumber

    your-account-number;

    ApiKey

    'your-key-username’;

    ApiSecret

    'your-key-password';

    CurrencyBaseUnitsMultiplier

    Transactions are actually measured in fractions of the currency specified in the CurrencyCode; for example, USD transactions are measured in cents. This multiplier is how many of these smaller units make up one of the specified currency. For example, with the CurrencyCode USD the value is 100 but for Japanese YEN the multiplier would be 1 as there is no smaller unit.

    CurrencyCode

    'currency-code';

    E.g., CAD

  3. Non-functional configurations:

    The C# SDK uses default configurations for parameters like connection_timeoutand max_connections. We cannot change these configurations externally.

client = new PaysafeApiClient(ApiKey, ApiSecret, Environment.TEST, AccountNumber);

To Launch the Sample Application

  1. Launch Microsoft Visual Studio.
  2. Open the SDK project.
  3. In the Solution Explorer, locate SampleApp and right-click it.
  4. Select View>View in Browser.

Example Code

The following topics contain example code for each API:

  • Card Payments API – Process all major credit cards through the Paysafe payment gateway.
  • Direct Debit API – Process purchases and credits through a variety of bank schemes.
  • Customer Vault API – Make repeat payments without having to directly access the cardholder information.
  • 3D Secure API – Mitigate fraud while providing additional security for customers using their cards online.
  • Exceptions – Handle various exceptions to ensure accurate payment processing.

The above examples do not include initialization.

Did you find this page useful?