Skip to main content

Connecting to Braintree

Your users will need the following information to connect their Braintree account with your integration built with Paragon Connect:
  • Environment: Sandbox or Production. Sandbox keys only work against the Braintree sandbox, and production keys only work against production.
  • Merchant ID: The gateway merchant ID, found in the Braintree Control Panel under Account > Merchant Account Info. Plan and subscription actions require it.
  • Public Key: The API public key from the Braintree Control Panel.
  • Private Key: The API private key from the Braintree Control Panel.
See Braintree’s API credentials documentation for where to find these values. Once your users have connected their Braintree account, you can use the Paragon SDK to access the Braintree GraphQL API on behalf of connected users. Paragon sends requests to https://payments.braintree-api.com/graphql or https://payments.sandbox.braintree-api.com/graphql based on the environment your user selected, and sets the Authorization and Braintree-Version headers on each request. Any Braintree GraphQL queries and mutations can be sent with the Paragon SDK as shown in this example.
JavaScript

Building Braintree workflows

Once your Braintree account is connected, you can add steps to perform the following actions:
  • Customers: Search Customers, Get Customer, Create Customer, Update Customer, Delete Customer
  • Transactions: Search Transactions, Get Transaction, Charge Payment Method, Capture Transaction, Void or Reverse Transaction
  • Refunds: Search Refunds, Get Refund, Refund Transaction
  • Payment methods: Vault Payment Method, Delete Payment Method
  • Plans: Search Plans, Get Plan
  • Subscriptions: Search Subscriptions, Get Subscription, Create Subscription, Update Subscription, Cancel Subscription
  • Payouts: Search Disbursed Transactions
  • Checkout: Create Client Token
  • Merchant: Get Merchant
You can also use the Braintree Request step to access any of Braintree’s API endpoints without the authentication piece. When creating or updating records in Braintree, you can reference data from previous steps by typing {{ to invoke the variable menu.

Using triggers

Braintree polling triggers check your users’ Braintree account for records created since the last check and run your workflows when they find new ones. The first poll starts at the time you enable the workflow, so existing records are not replayed. You can use the following polling triggers:
  • Customer Created
  • Transaction Created
Braintree webhook triggers run your workflows when Braintree sends a webhook notification. You can use the following webhook triggers:
  • Payment Settled: Runs on transaction_settled, subscription_charged_successfully, and disbursement notifications.
  • Subscription Updated: Runs on subscription notifications, such as subscription_canceled, subscription_charged_unsuccessfully, subscription_expired, subscription_went_active, and subscription_went_past_due.
Paragon does not register webhooks with Braintree automatically. To use a webhook trigger, add the trigger’s webhook URL as a destination in the connected Braintree account’s Control Panel and select the notification kinds it listens for. See Braintree’s webhooks documentation for details. Paragon verifies the bt_signature of each notification and answers Braintree’s URL challenge with the connected user’s API keys, so the webhook must be created in the same Braintree account and environment the user connected.