We provide complementary client and server SDKs to complete your integration:
- The client SDKs enable you to collect payment method (e.g. credit card, PayPal) details
- The server SDKs manage all requests to the gateway
We have SDKs for the following client platforms and server languages:
|Client SDKs||Server SDKs|
Before getting started with an integration, there are 2 key concepts that are helpful to understand: the client token and the payment method nonce.
A client token is a signed data blob that includes configuration and authorization information required by the Braintree client SDK. These should not be reused; a new client token should be generated for each request that's sent to Braintree. For security, we will revoke client tokens if they are reused excessively within a short time period.
Your server is responsible for generating the client token, which contains all of the necessary configuration information to set up the client SDKs. When your server provides a client token to your client, it authenticates the application to communicate directly to Braintree.
Your client is responsible for obtaining the client token from your server and initializing the client SDK. If this succeeds, the client will generate a payment method nonce.
The payment method nonce is a string returned by the client SDK to represent a payment method. This string is a reference to the customer payment method details that were provided in your payment form and should be sent to your server where it can be used with the server SDKs to create a new transaction request.
Your server integration doesn't need to know the payment method type (e.g. credit card, PayPal account, Bitcoin) that is represented in the nonce. This means that your first integration should continue to work with few or no code changes when new payment method types are introduced.
- Your app or web front-end requests a client token from your server in order to initialize the client SDK
- Your server generates and sends a client token back to your client with the server SDK
- Once the client SDK is initialized and the customer has submitted payment information, the SDK communicates that information to Braintree, which returns a payment method nonce
- You then send the payment nonce to your server
- Your server code receives the payment method nonce from your client and then uses the server SDK to create a transaction or perform other functions detailed in the guides
Get your sandbox or production API keys from the Control Panel to complete your integration. Once you're ready to go live, be sure to switch from your sandbox API keys to production. Next: Set Up Your Client →
Still have questions?
If you can’t find an answer, contact our Support team.