An example Braintree integration for ASP.NET.
These instructions assume you are using Visual Studio Community 2017. This has not been tested in Xamarin Studio, or other versions of Visual Studio. This project is also set up to use NuGet package restore, so all dependencies should be automatically installed.
-
Open
braintree_aspnet_example.sln
in Visual Studio. -
Open the
Web.config
inBraintreeASPExample
, and fill in your Braintree API Credentials in theBraintreeEnvironment
,BraintreeMerchantId
,BraintreePublicKey
, andBraintreePrivateKey
keys. Credentials can be found by navigating to Account > My User > View Authorizations in the Braintree Control Panel. Full instructions can be found on our support site. -
Start the project by pressing the play button in the toolbar.
There are unit and integration tests. To run the integration tests, you will need to have IIS Express and Firefox (version 46.x or below) installed and your API credentials filled in. You can run all the tests by opening the Test Explorer and clicking Run All
.
Sandbox transactions must be made with sample credit card numbers, and the response of a Transaction.Sale()
call is dependent on the amount of the transaction.
- If you do not want to or are unable to use NuGet package restore, make sure to download and reference the following packages:
- Braintree 3.3.0 or higher
- Moq 4.5 or higher (needed for
BraintreeASPExampleTests
only) - Selenium WebDriver 2.52 or higher (needed for
BraintreeASPExampleTests
only)
- Found a bug? Have a suggestion for improvement? Want to tell us we're awesome? Submit an issue
- Trouble with your integration? Contact Braintree Support / support@braintreepayments.com
- Want to contribute? Submit a pull request
This code is provided as is and is only intended to be used for illustration purposes. This code is not production-ready and is not meant to be used in a production environment. This repository is to be used as a tool to help merchants learn how to integrate with Braintree. Any use of this repository or any of its code in a production environment is highly discouraged.