Plaid
Bring your Plaid bank connections to Straddle
This guide provides a detailed walkthrough on integrating Plaid with Straddle for fast and secure account-to-account payments. By leveraging Plaid’s bank connections and Straddle’s payment infrastructure, you can offer a seamless and secure payment experience to your users.
Prerequisites
Before you begin, ensure you have:
-
Enable Straddle’s Plaid integration in your Plaid account settings. If you need assistance with this step, reach out to your Account Manager with Plaid.
-
Customize Plaid Link’s account selection to only be “enabled for one account.”
Implementation Steps
Setting Up Plaid
Configure Plaid product and Link settings in the Plaid dashboard
To get the most out of the Straddle integration with Plaid, be sure to enable the following core services in your Plaid dashboard
Once that’s complete, remember to style and customize your Link application UI - it’s especially important to define a “use case” in the Data Transparency Messaging configuration.
Data transparency messaging ensures compliance with the latest open-banking regulations. Check out this article on CFPB’s 1033 Final Rule to learn more.
Intro to Link
Plaid Link is the client-side component that your users will interact with in order to link their accounts to Plaid and allow you to access their accounts via the Plaid API.
Plaid Link will handle credential validation, multi-factor authentication, and error handling for each institution that Plaid supports. Link is supported via SDKs for all modern browsers and platforms, including web, iOS, Android, as well as via React Native, along with community-supported wrappers for Flutter, Angular, and Vue.
For webview-based integrations or integrations that don’t have a frontend, Plaid also provides a drop-in Hosted Link integration mode.
To try Link, see Plaid Link Demo.
We’ll do our best here to give you a rundown of the steps required to start building on Plaid and connect to Straddle. However, you should always treat Plaid’s official documentation as the ultimate source of truth during integration with their platform.
Create a link_token
Now you’re ready to start building. In order to integrate with Plaid Link, you will first need to create a link_token
. A link_token
is a short-lived, one-time use token that is used to authenticate your app with Link and initiate a session for a user.
To create one, make a /link/token/create
request with your client_id
, secret
, and a few other required parameters from your app server.
View the /link/token/create
documentation for a full list of configurations.
To see your client_id
and secret
, visit the Plaid Dashboard.
Initialize Link
Once you have a link_token
, all it takes is a few lines of client-side JavaScript to initialize Link. Then, in the onSuccess
callback, you can call a simple server-side handler to exchange the Link public_token
for a Plaid access_token
and — ultimately —a Straddle processor_token
.
Obtaining a Straddle Processor Token from Plaid
Once you have the access token, you can use it to obtain a Straddle processor token from Plaid This token is specific to Straddle and allows secure communication between Plaid and Straddle.
Note that straddle
(that’s us!) is the specific processor you’re requesting the token for. This tells Plaid to generate a token compatible with Straddle’s systems.
Using the Straddle Bridge API with Plaid Token
Once you have obtained the Straddle processor token from Plaid, you can use it to create a paykey via Straddle’s Bridge API. Here’s the correct HTTP request format:
Replace YOUR_STRADDLE_API_KEY
with your actual Straddle API key, and fill in the appropriate values for customer_id
and plaid_token
. The metadata
field is optional but can be useful for storing additional information related to the Plaid account.
Handling the Straddle API Response
The Straddle API will respond with a paykey object. Here’s an example of what you might receive:
Note that the source
field is set to plaid
in this case, indicating that the paykey was created using a Plaid token.
You should store this paykey
securely for future use in transactions. When it’s time to get paid , create a charge and Straddle will automatically attempt to verify the account’s balance prior to origination.
Best Practices and Security Considerations
-
Token Security: Never expose Plaid access tokens or Straddle processor tokens to the frontend. Always handle these server-side.
-
Error Handling: Implement robust error handling for both Plaid and Straddle API calls.
-
Metadata Usage: Use the metadata field to store relevant information, such as the Plaid account ID, for future reference.
-
Token Refreshing: Be aware of token expiration policies for both Plaid and Straddle. Implement token refresh mechanisms as needed.
-
Compliance: Ensure you’re complying with both Plaid and Straddle’s terms of service and data handling requirements.
-
Logging: Implement comprehensive logging for debugging and audit purposes, but be careful not to log sensitive information.
Troubleshooting Common Issues
-
Invalid Processor Token: Ensure you’re using
straddle'
as the processor when requesting the token from Plaid. -
Authentication Errors: Double-check your API keys for both Plaid and Straddle.
-
Expired Tokens: If you’re getting authentication errors, your tokens might have expired. Implement a token refresh mechanism.
-
Account Not Supported: Some bank accounts may not be supported for ACH transactions. Handle these cases gracefully in your UI.
-
Rate Limiting: Be aware of rate limits on both Plaid and Straddle APIs. Implement appropriate backoff strategies if you hit these limits.
By following this guide, you should be able to successfully integrate Plaid with Straddle, leveraging the strengths of both platforms to provide a robust, secure payment solution for your users.