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.
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.
Open the configuration file:
Update the following details:
Key Value AccountNumber
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.
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
- Launch Microsoft Visual Studio.
- Open the SDK project.
- In the Solution Explorer, locate SampleApp and right-click it.
- Select View>View in Browser.
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.
To download a French version of this guide in PDF, click here.