Enable ACH/Bank payments and transfers in your application with the Dwolla API.
You must have an account with Dwolla to interact with the API. Create you development account at: https://accounts-sandbox.dwolla.com/sign-up
Note: Plaid’s development environment is not compatible with Dwolla. Dwolla uses Sandbox and Production environments which work with Plaid's Sandbox and Production environments respectively. How to work with different environments - https://developers.dwolla.com/guides/sandbox#testing-in-the-sandbox
To use this plugin you need to create a Dwolla account. You can create a Dwolla sandbox account at: https://accounts-sandbox.dwolla.com/sign-up.
After signing up, navigate to the applications tab at https://dashboard-sandbox.dwolla.com/applications-legacy and create an app.
After creating the app copy the necessary credentials below and paste them in the Dwolla Plugin Settings in Bubble
The Environment field should be set to sandbox when using Dwolla Sandbox API keys and changed to production when you go to production.
Dwolla has multiple customer types with various limitations as can be seen here: https://developers.dwolla.com/resources/account-types.html. This plugin currently supports creating two customer types which are Personal Verified Customer and Unverified customer. You can choose which one to create for your app user based on your needs.
When you create a customer, a customer resource link is returned. You should save this link to your user as it would be need later on. The customer link is something like: https://api-sandbox.dwolla.com/customers/9da3aa7c-2524-430b-a751-6dc722735fce
When you create a customer in Dwolla, the customer needs to have a funding source in order for you to send money to or receive money from the customer. There are two types of Dwolla funding sources which are balance and bank. Read more here: https://docs.dwolla.com/#funding-sources. In this documentation we would only be handling bank funding sources.
To simplify the process of adding a bank funding source, this plugin is designed to work with the Plaid plugin by Copilot. You would use Plaid to collect the user's account details and then continue the process with Dwolla.
Also, you would likely want to charge your users variable amounts in the future, to do this, you need to create a funding source with an on-demand transfer authorization. Read more here: https://docs.dwolla.com/#create-an-on-demand-transfer-authorization
We will now go through the steps of creating a funding source for a customer with an on-demand transfer authorization.
In your application where you want a user to add their bank account you need to get an on-demand transfer authorization after they click a similar button to the one below:
Your workflow should be like below:
When the Agree & Continue button is clicked your workflow should then:
Now back to the funding source creation, after the user has selected their bank account with Plaid, your Plaid token has been created workflow would look like below:
The /accounts/balance/get endpoint returns the real-time balance for each of an Item's accounts. It can be used for existing Items that were added via any of Plaid’s other products.Parameters:
The /auth/get endpoint returns the details from your Plaid bank account.Parameters:
Used in plugin workflow to retrieve bank account details
Now that you have created a funding source with an on-demand authorization, you will now be able to charge users varying amounts of money in the future. To do so, you need to use the "Receive money from Customer" plugin action.
Make sure you setup the plugin action correctly.
The receive money action will return a Dwolla Transfer resource link. You should extract the ID from this link and store it in a transaction object for future reference and webhook confirmations. To extract the ID from the URL, truncate from end to last 36 digits as done below
This is similar to above but you would simple use the "Send money to customer" action and also the source and destination would be flipped as seen below:
Verified Customers are defined by their ability to both send and receive money, thus, being able to fit all funds flows. They can also interact with any Customer type and hold a balance funding source within the Dwolla network. Think of the Dwolla balance as a “wallet” in which a Customer can send, receive, or hold funds within the Dwolla network. With no weekly transfer limits, this Customer type is flexible for high transaction volumes.
Unverified Customers have a default sending transaction limit of $5,000 per week. A week is defined as Monday to Sunday UTC time. As this Customer is not identity verified, they will only be able to transact with verified Customers or your Dwolla Master Account.
Verified Customers of type personal or business and of status document require color photos of identifying documents to be uploaded for manual review in order to be verified.
Customer ID - Customer unique identifier.
Environment - Plaid Environment. Use 'production' when going live
Authorization - Authorization token consisting of the word Bearer + access token (e.g. Bearer r3lybQeOjJ8Vae5VcbJyVyL67pLWmlDVhYO3MDa9MjyLzm5FIn)
Document Type - Acceptable values of: passport, license, idCard, or other. Refer to the acceptable documents section for more information on how these document types apply to each Customer type.
File - File contents.
Retrieve a list of documents that belong to a Customer.
To receive webhooks in Dwolla, you need to subscribe to them with the plugin action "Create webhook subscription".
Ideally you are going to create 2 subscriptions. The first one is to initialize the API endpoint to fetch the request data. More information -https://developers.dwolla.com/guides/webhooks/create-subscription#step-2-create-a-webhook-subscription
On a test page in your app simple add a workflow to create a webhook subscription. The URL to be subscribed should be that of the API endpoint wherein you wish to receive these webhooks. (Note: Set your endpoint and secret key accordingly)
The API workflow endpoint URL should be copied from the detecting request data mode of the API endpoint like below
After you have subscribed to the URL gotten above, trigger a webhook event by create an unverified customer so that your endpoint can detect the request data and then you can save it.
Once this is done, create another subscription for this URL but without the /initialize portion.
If you want, you can delete the first initialize webhook subscription using the delete webhook subscription plugin action.
Handling Webhook events
The most common use of webhooks is to confirm success or failure of transfers to or from users. In your API endpoint which receives all Dwolla webhook events, you can trigger other API workflows depending on the kind of webhook event received.
As seen in the image above, a workflow called monthly_payment_successful is triggered when a search for monthly payment which has the ID fetched from the transfer resource URL and when the webhook event has a topic of transfer_completed. It then terminates the workflow based on the same condition. If this condition is not met, it moves on to the next one workflow action whose condition is met.
The /transfers/[transfer_ID] endpoint for get information about transactions
To send funds you need to get Transfer ID
With this API Call you can make transfers from user to user with fees included.Parameters:
Example:You can set a fee recipient - your platform. To do this, specify the platform’s ID.
2. Create the API Call - Get Transfer By ID
3. Get platform ID
4. Send moneys with fees
5. Show alert on success!
Update: 30/07/2020 –
Update: 26/01/2021 –