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.
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
{{ 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
- Payment Settled: Runs on
transaction_settled,subscription_charged_successfully, anddisbursementnotifications. - Subscription Updated: Runs on subscription notifications, such as
subscription_canceled,subscription_charged_unsuccessfully,subscription_expired,subscription_went_active, andsubscription_went_past_due.
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.