Updated Braintree Client Library for .NET — A C# / .NET SDK for interacting with the Braintree Payment Gateway (transactions, customers, subscriptions, webhooks, etc.). Supports .NET Standard 2.0 and .NET Framework 4.5.2+. MIT Licensed.
License
—
Deps
4
Install Size
—
Vulns
✓ 0
Published
Feb 15, 2026
$ dotnet add package Braintree.NetThe Braintree .NET client library (C# / .NET) provides a convenient, strongly typed API to interact with the Braintree Payment Gateway. You can perform operations such as creating transactions, managing customers, handling subscriptions, processing webhooks, and more.
This library targets .NET Standard 2.0 (and .NET Framework 4.5.2+) and is distributed under the MIT license.
It is maintained in the braintree_dotnet GitHub repo.
using System;
using Braintree;
class Program
{
static void Main(string[] args)
{
var gateway = new BraintreeGateway
{
Environment = Braintree.Environment.SANDBOX,
MerchantId = "your_merchant_id",
PublicKey = "your_public_key",
PrivateKey = "your_private_key"
};
var request = new TransactionRequest
{
Amount = 100.00M,
PaymentMethodNonce = "nonce-from-client",
Options = new TransactionOptionsRequest
{
SubmitForSettlement = true
}
};
var result = gateway.Transaction.Sale(request);
if (result.IsSuccess())
{
Console.WriteLine("Transaction succeeded: " + result.Target.Id);
}
else
{
Console.WriteLine("Error: " + result.Message);
}
}
}
Install-Package Braintree
or
dotnet add package Braintree
This library is licensed under the MIT License. See the LICENSE file for details.