BraintreeBraintree is a mobile and web payment platform that helps merchants to reach more buyers and drive higher conversion with a payment solution that processes PayPal, Venmo, credit and debit cards, Apple Pay, and Google Pay.
Braintree is a service connector that specializes in mobile and web payment systems for e-commerce companies.
If you wish your workflow to be kicked off by a particular action in Braintree, you can use the Braintree Trigger.
The Braintree trigger allows you to receive notifications and trigger workflows when given events occur associated with the selected trigger operation.
Instead of using a connector, choose Braintree as your trigger at the 'Create new workflow' section and wait to be redirected to your new workflow.
Before using the Braintree trigger, an authentication will need to be created. With the Braintree trigger step highlighted, in the properties panel on the right, click on 'New Authentication' which is located under the 'Settings' heading.
This will result in a Tray.io authentication pop-up window. The first page will ask you to name your authentication, and state which type of authentication you wish to create ('Personal' or 'Organisational').
As you can see, the next page asks you to choose the relevant Braintree 'Environment' and for your 'Merchant ID', 'Public Key' and 'Private Key' credentials.
In order to get these fields, head to your Braintree dashboard. Click on the settings wheel in the top right corner and select 'API'.
Here you will see 'API Keys' for your account.
Click 'Generate New API Key' to create a key. A popup should appear with the message the 'API Key successfully created' and the 'Public Key' should now be visible under the 'API Keys' heading.
To get the all the information required including the 'Private Key', select 'View' underneath the 'Private Key' heading.
This will take you to the individual key page. Here you will find all the information required for authentication; 'Merchant ID', 'Public Key' and 'Private Key':
Once you have added these fields to your Tray.io authentication popup window, click on the 'Create authentication' button. Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.
Your connector authentication setup should now be complete.
Trigger Operations Available:
Use the instructions above to authenticate your trigger, and select the 'Webhook' operation.
For now, leave the properties panel settings and do not select any of the options until the next stage is complete.
To trigger the workflow you have to manually add and setup the webhook, adding the workflow URL to the Webhook tab section within your Braintree account.
First, make sure to enable the workflow by clicking on the green 'Enable' button, in the bottom right corner of the builder.
Then get your Tray.io Public URL for the workflow by clicking on the settings wheel in the top left of the build screen, and copying it from the settings window:
Head to your Braintree account API settings (the same place you found the authentication information above). Once there click on 'Webhooks':
Here you will see all the available 'Webhooks' for your account. Click 'Generate New Webhook' to create a new webhook if you have none already. A new window should appear. Paste the Tray.io URL into the destination URL field, and select which 'Notification' types you would like to trigger the workflow.
Make a note of these for later use.
Once you have finished selecting these, scroll to the bottom of the page and select 'Create Webhook'.
Your new webhook should now be shown on the 'Webhooks' page in your Braintree dashboard.
To test whether your webhook has been set up correctly, select the 'Check URL' option within the Braintree webhook dashboard (to the right of the webhook, under the 'Actions' tab). A popup should appear with the message 'Success! Server responded with 200'.
Head back over to your Tray.io workflow and make sure your trigger is selected once more.
Select the 'Event types' you want your trigger to respond to, making sure to match them with the 'Notifications' that were selected during the online Braintree webhook setup, from earlier.
The Braintree trigger, only responds to the 'Notifications' setup within the Braintree webhook setup page - which are in effect Braintree terminology for Tray.io 'Event types'.
The event types listed within your Braintree trigger properties panel however only dictate the output schema that your trigger will generate - which is based off the Braintree webhook request itself. For more details on output schema and the like, see our jsonpath shortcuts
Make sure to check the output within the Debug panel, in order to test the setup. Select Debug at the top of the workflow builder. You should be able to choose one of workflow runs and select a log step to see your output.