CyberSource.Rest.Client 1.0.0

dotnet add package CyberSource.Rest.Client --version 1.0.0
                    
NuGet\Install-Package CyberSource.Rest.Client -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CyberSource.Rest.Client" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CyberSource.Rest.Client" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CyberSource.Rest.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CyberSource.Rest.Client --version 1.0.0
                    
#r "nuget: CyberSource.Rest.Client, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CyberSource.Rest.Client@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CyberSource.Rest.Client&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CyberSource.Rest.Client&version=1.0.0
                    
Install as a Cake Tool

.NET Client SDK for the CyberSource REST API

The CyberSource .NET Standard client provides convenient access to the CyberSource REST API from your .NET application.

Target Frameworks

  • .NET Framework 4.6.1
  • .NET Standard 2.0
  • .NET Standard 2.1
  • .NET 8.0

Installation

  • Nuget Package Manager
PM>  Install-Package CyberSource.Rest.Client

Account Registration and Configuration

  • Account Registration

Follow the first step mentioned in Getting Started with CyberSource REST SDKs to create a sandbox account.

  • Configuration

Follow the second step mentioned in Getting Started with CyberSource REST SDKs to configure the SDK by inputting your credentials.

Please note that this is for reference only. Ensure to store the credentials in a more secure manner.

How to Use

To get started using this SDK, it is highly recommended to download our sample code repository:

  • Cybersource .NET Sample Code Repository (on GitHub)

In that repository, we have comprehensive sample codes for all common uses of our APIs.

Additionally, you can find details and examples of how our API is structured in our API Reference Guide:

The API Reference Guide provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK.

Example using .NET Framework 4.6.1 Sample Code Application

For more detailed examples, refer to the cybersource-rest-samples-dotnet repository.

Switching between the sandbox environment and the production environment

Cybersource maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated.

By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, set the runEnvironment property in the SDK Configuration, as shown in Sample Configuration file.

    // For TESTING use
    _configurationDictionary.Add("runEnvironment", "apitest.cybersource.com");

    // For PRODUCTION use
    // _configurationDictionary.Add("runEnvironment", "api.cybersource.com");

API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.

Logging

Generic badge

The logging framework makes use of NLog, and standardizes the logging so that it can be integrated with the logging in the client application.

More information about this new logging framework can be found in this file : Logging.md

Features

Message Level Encryption (MLE) Feature

Generic badge

This feature provides an implementation of Message Level Encryption (MLE) for APIs provided by CyberSource, integrated within our SDK. This feature ensures secure communication by encrypting messages at the application level before they are sent over the network.

More information about this new MLE feature can be found in this file : MLE.md

JWT Authentication with Symmetric Key (Shared Secret / HS256 HMAC-SHA256) Support

Generic badge

⚠️ HTTP Signature Deprecation Notice: HTTP Signature authentication (HTTP_SIGNATURE) is being deprecated.

JWT with Shared Secret (HS256 / HMAC-SHA256) is the recommended migration path — it uses the same merchantKeyId and merchantsecretKey credentials, requires only two property changes, and enables MLE (Message Level Encryption) support that HTTP Signature does not provide.

JWT authentication now supports two key types, configurable via the jwtKeyType property:

jwtKeyType Algorithm Credentials Required
P12 (default) RS256 (asymmetric, RSA-SHA256) keysDirectory, keyFilename, keyAlias, keyPass
SHARED_SECRET HS256 (symmetric, HMAC-SHA256) merchantKeyId, merchantsecretKey

The default value is P12, which preserves full backward compatibility with existing configurations.

Configuration for JWT with P12 (default — no changes needed)
_configurationDictionary.Add("authenticationType", "JWT");
_configurationDictionary.Add("merchantID", "your_merchant_id");
_configurationDictionary.Add("runEnvironment", "apitest.cybersource.com");
// jwtKeyType defaults to P12 if omitted
_configurationDictionary.Add("keyAlias", "your_merchant_id");
_configurationDictionary.Add("keyPass", "your_merchant_id");
_configurationDictionary.Add("keyFilename", "your_merchant_id");
_configurationDictionary.Add("keysDirectory", @"path\to\p12\directory");
Configuration for JWT with Shared Secret
_configurationDictionary.Add("authenticationType", "JWT");
_configurationDictionary.Add("merchantID", "your_merchant_id");
_configurationDictionary.Add("runEnvironment", "apitest.cybersource.com");
_configurationDictionary.Add("jwtKeyType", "SHARED_SECRET");
_configurationDictionary.Add("merchantKeyId", "your_key_id");
_configurationDictionary.Add("merchantsecretKey", "your_base64_encoded_shared_secret");

Note: When jwtKeyType is set to SHARED_SECRET, the P12-related properties (keysDirectory, keyFilename, keyAlias, keyPass) are not required and will be ignored. Conversely, when using P12, the merchantKeyId and merchantsecretKey properties are not required for JWT authentication.

Migrating from HTTP Signature to JWT with Shared Secret (HS256 / HMAC-SHA256)

If you are currently using HTTP Signature authentication, migrating to JWT with Shared Secret requires only two property changes — your credentials remain the same:

// BEFORE (HTTP Signature — deprecated)
_configurationDictionary.Add("authenticationType", "HTTP_SIGNATURE");
_configurationDictionary.Add("merchantKeyId", "your_key_id");
_configurationDictionary.Add("merchantsecretKey", "your_shared_secret");

// AFTER (JWT with Shared Secret / HS256 HMAC-SHA256 — recommended)
_configurationDictionary.Add("authenticationType", "JWT");             // changed
_configurationDictionary.Add("jwtKeyType", "SHARED_SECRET");           // added — uses HS256 (HMAC-SHA256)
_configurationDictionary.Add("merchantKeyId", "your_key_id");          // same
_configurationDictionary.Add("merchantsecretKey", "your_shared_secret"); // same
Using MLE with Shared Secret Credentials

MLE (Message Level Encryption) is fully supported with the SHARED_SECRET key type. When using jwtKeyType=SHARED_SECRET with MLE, you must provide the MLE public certificate separately via the mleForRequestPublicCertPath property, since there is no P12 file to auto-extract the MLE certificate from.

The request MLE public certificate can be downloaded from the CyberSource Business Center:

_configurationDictionary.Add("authenticationType", "JWT");
_configurationDictionary.Add("merchantID", "your_merchant_id");
_configurationDictionary.Add("runEnvironment", "apitest.cybersource.com");
_configurationDictionary.Add("jwtKeyType", "SHARED_SECRET");
_configurationDictionary.Add("merchantKeyId", "your_key_id");
_configurationDictionary.Add("merchantsecretKey", "your_base64_encoded_shared_secret");

// Request MLE configuration
_configurationDictionary.Add("enableRequestMLEForOptionalApisGlobally", "true");
_configurationDictionary.Add("mleForRequestPublicCertPath", @"C:\path\to\mle\public\cert.pem");

For more details on MLE configuration options (including Response MLE), see MLE.md.

MetaKey Support

A Meta Key is a single key that can be used by one, some, or all merchants (or accounts, if created by a Portfolio user) in the portfolio.

The Portfolio or Parent Account owns the key and is considered the transaction submitter when a Meta Key is used, while the merchant owns the transaction.

Merchant IDs continue to be able to create keys for themselves, even if a Meta Key is generated.

MetaKey works with all three authentication types: HTTP Signature, JWT (P12), and JWT with Shared Secret.

Further information on MetaKey can be found in New Business Center User Guide.

How to Contribute

  • Fork the repo and create your branch from master.
  • If you've added code that should be tested, add tests.
  • Ensure the test suite passes.
  • Submit your pull request! (Ensure you have synced your fork with the original repository before initiating the PR).

Need Help?

For any help, you can reach out to us at our Discussion Forum.

Disclaimer

CyberSource may allow Customer to access, use, and/or test a CyberSource product or service that may still be in development or has not been market-tested (“Beta Product”) solely for the purpose of evaluating the functionality or marketability of the Beta Product (a “Beta Evaluation”). Notwithstanding any language to the contrary, the following terms shall apply with respect to Customer’s participation in any Beta Evaluation (and the Beta Product(s)) accessed thereunder: The Parties will enter into a separate form agreement detailing the scope of the Beta Evaluation, requirements, pricing, the length of the beta evaluation period (“Beta Product Form”). Beta Products are not, and may not become, Transaction Services and have not yet been publicly released and are offered for the sole purpose of internal testing and non-commercial evaluation. Customer’s use of the Beta Product shall be solely for the purpose of conducting the Beta Evaluation. Customer accepts all risks arising out of the access and use of the Beta Products. CyberSource may, in its sole discretion, at any time, terminate or discontinue the Beta Evaluation. Customer acknowledges and agrees that any Beta Product may still be in development and that Beta Product is provided “AS IS” and may not perform at the level of a commercially available service, may not operate as expected and may be modified prior to release. CYBERSOURCE SHALL NOT BE RESPONSIBLE OR LIABLE UNDER ANY CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE RELATING TO A BETA PRODUCT OR THE BETA EVALUATION (A) FOR LOSS OR INACCURACY OF DATA OR COST OF PROCUREMENT OF SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY, (B) ANY CLAIM, LOSSES, DAMAGES, OR CAUSE OF ACTION ARISING IN CONNECTION WITH THE BETA PRODUCT; OR (C) FOR ANY INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUES AND LOSS OF PROFITS.

License

This repository is distributed under a proprietary license.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 249 7/21/2026
0.0.1.64 2,230 7/2/2026
0.0.1.63 4,665 5/16/2026
0.0.1.62 3,903 3/31/2026
0.0.1.61 5,302 2/11/2026
0.0.1.60 17,634 1/3/2026
0.0.1.59 7,528 12/2/2025
0.0.1.58 13,501 11/10/2025
0.0.1.57 2,404 10/19/2025
0.0.1.56 4,889 9/4/2025
0.0.1.55 6,518 8/4/2025
0.0.1.54 849 7/1/2025
0.0.1.53 2,574 5/30/2025
0.0.1.52 12,279 5/5/2025
0.0.1.51 4,966 4/4/2025
0.0.1.50 1,611 3/24/2025
0.0.1.49 20,821 2/6/2025
0.0.1.48 32,317 12/11/2024
0.0.1.47 30,997 11/13/2024
0.0.1.46 136,019 9/30/2024
Loading failed