Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
C# Other

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Braintree.Tests
Braintree
.gitignore
Braintree.Tests.VisualState.xml
Braintree.Tests.nunit
Braintree.sln
Braintree.sln.cache
Braintree.suo
LICENSE
README.md
default.ps1

README.md

Braintree .NET Client Library

The Braintree assembly provides integration access to the Braintree Gateway.

Dependencies

  • none

Quick Start Example

using System;
using Braintree;

namespace BraintreeExample
{
    class Program
    {
        static void Main(string[] args)
        {
            var gateway = new BraintreeGateway
            {
                Environment = Braintree.Environment.SANDBOX,
                MerchantId = "the_merchant_id",
                PublicKey = "a_public_key",
                PrivateKey = "a_private_key"
            };

            var request = new TransactionRequest
            {
                Amount = 100.00M,
                CreditCard = new CreditCardRequest
                {
                    Number = "5105105105105100",
                    ExpirationDate = "05/12"
                }
            };

            Transaction transaction = gateway.Transaction.Sale(request).Target;

            Console.WriteLine(String.Format("Transaction ID: {0}", transaction.Id));
            Console.WriteLine(String.Format("Status: {0}", transaction.Status));
        }
    }
}

License

See the LICENSE file.

Something went wrong with that request. Please try again.