Integrating Braintree with Salesforce

A developer-focused guide to integrating Braintree with Salesforce using GraphQL API and Apex, plus a no-code alternative with Breadwinner Payments.

Stony Grunow

April 21, 2021

Payments

Braintree is a payments platform that makes it easy to accept payments in your app or website. It supports credit cards, ACH, Venmo, and PayPal transactions (note: PayPal owns both Braintree and Venmo).

If you’re looking to integrate Braintree with Salesforce, you have a couple of options. Let’s walk through them.

Two Integration Approaches

Braintree SDKs

One method uses Braintree’s Server SDKs, but this requires creating middleware between Salesforce and Braintree. Options include Heroku Dynos or AWS Elastic Beanstalk running various languages (Java, .NET, Node.js, PHP, Python, Ruby).

This approach adds complexity and an additional layer to maintain, so we won’t cover it in detail here.

GraphQL API

The more direct approach enables Salesforce-to-Braintree integration using Braintree’s GraphQL API. GraphQL allows you to request exactly what is needed and nothing more through POST calls, providing flexible query capabilities.

This is the preferred method for developers who want a clean, direct integration.

Benefits of Integration

Integrating Braintree with Salesforce allows you to:

  • Pull Customers, Payment Methods, and Payments into Salesforce to track transactions
  • Create Braintree Customers and Payment Methods within Salesforce
  • Process charges directly from your CRM

Implementation Steps

To get started, you’ll need to:

  1. Create a Braintree account (sandbox for testing)
  2. Retrieve your Public and Private Keys from the API section of the Braintree dashboard
  3. Build Apex classes that make GraphQL calls to Braintree’s API
  4. Parse the JSON responses and map data to Salesforce objects

The authentication uses HTTP headers with your Braintree credentials, and the GraphQL queries can be constructed as JSON strings in your Apex code.

Non-Developer Alternative

If you aren’t a developer and don’t want to build and maintain a custom integration, consider Breadwinner Payments. It provides a native Salesforce integration with Braintree (as well as Stripe and Square) that works out of the box.

Why choose Breadwinner?

  • Lightning-fast Integration with minimal manual setup
  • Native Salesforce integration with ERP and Financial Systems.
  • Unified view of financial and operational data.
  • Certified by Salesforce, and featured on AppExchange

Want to learn more?

Schedule a demo to see how Breadwinner integrates your finance systems with Salesforce.