Skip to content

Instantly share code, notes, and snippets.

Avatar

Spencer Hunter spencerhunter

  • Dwolla
  • Des Moines
View GitHub Profile
@spencerhunter
spencerhunter / TransferandEvents-Account-UnverifiedCustomer.md
Last active Oct 10, 2018
Example of a bank to bank transfer between a Partner Dwolla Account and an Unverified Customer as well as related events
View TransferandEvents-Account-UnverifiedCustomer.md

Overview

Use this doc as a reference to map out the sequence of events your app will receive based on the account type(s) involved in the transaction as well as where the funds are coming from and going to (bank or balance). The following transfer scenarios are covered in this doc:

Transfer scenario 1 - Source: Partner Account bank Destination: Unverified Customer bank.
Transfer scenario 2 - Source: Unverified Customer bank Destination: Partner Account bank.

Both success and failure cases will be shown as well as additional information on what occurs in the event of a bank transfer failure.

General recommendations: Webhook endpoints may occasionally receive the same event more than once. We advise you to build in logic to protect against duplicated events by making your event p

@spencerhunter
spencerhunter / TransferAndEvents.md
Last active Dec 2, 2020
Outlines the sequence of events that are triggered for a subset of Dwolla payment flows that are bank-to-bank via ACH
View TransferAndEvents.md

Overview

Use this doc as a reference to map out the sequence of events your app will receive based on Customer type(s) involved in the transfer as well as where the funds are coming from and going to (bank or balance). The following transfer scenarios are covered in this doc:

Transfer scenario 1 - Source: Verified Customer bank Destination: Verified Customer bank.
Transfer scenario 2 - Source: Verified Customer bank Destination: Unverified Customer bank.
Transfer scenario 3 - Source: Unverified Customer bank Destination: Verified Customer bank.

Both success and failure cases will be shown as well as what occurs in the event of a bank transfer failure.

**General recommend

@spencerhunter
spencerhunter / TransferTypes.md
Created Feb 7, 2017
Example list of supported transfer types including sample requests
View TransferTypes.md

Supported Transfer types: co-branded Verified Account A bank -> Verified Account B balance Verified Account A bank -> Unverified Account B bank Verified Account A bank -> Verified Account A balance Verified Account A bank -> email address Verified Account A balance -> email address Verified Account A balance -> Verified Account A bank Unverified Account B bank -> Verified Account A balance white-label

@spencerhunter
spencerhunter / EventsDwollaAccounts.md
Created Jan 21, 2017
Example List of Events related to Dwolla Accounts
View EventsDwollaAccounts.md

Example List of Events related to Dwolla Accounts

Each webhook sent by the Dwolla API contains an Event with _links to: the associated resource, account associated with the event, and the customer associated with the event (if applicable). It is important to note that a single API request can trigger multiple webhooks to be fired, e.g. initiating a transfer from an Account to Customer can create the events transfer_created and customer_transfer_created.

List of events by account type that can be triggered for a Dwolla account

Reference additional information on account types in this resource article.

Possible events for all account types

account_suspended

@spencerhunter
spencerhunter / EventsAPICustomers.md
Last active Jan 15, 2021
Example List of webhooks related to API Customers
View EventsAPICustomers.md

Example List of webhooks related to API Customers

Each webhook sent by the Dwolla API contains an Event with _links to: the associated resource, account associated with the event, and the customer associated with the event (if applicable). It is important to note that a single API request can trigger multiple webhooks to be fired, e.g. initiating a transfer from an Account to Customer can create the events transfer_created and customer_transfer_created.

List of webhooks by Customer type that can be triggered for API Customers

Reference additional information on account types in this resource article.

Possible events for all Customer types

customer_created

@spencerhunter
spencerhunter / DwollaSandbox.postman_environment.json
Last active Apr 26, 2019
Dwolla API Sandbox Postman environment variables template
View DwollaSandbox.postman_environment.json
{
"id": "0bf1fd1b-92ef-e783-1f8b-3b0ae0d64016",
"name": "Dwolla API Sandbox",
"values": [
{
"key": "client_id",
"value": "",
"type": "text",
"enabled": true
},
@spencerhunter
spencerhunter / dwollaGateway
Last active Aug 29, 2015
Dwolla Off-Site Gateway - Generate checkoutID
View dwollaGateway
<?php
$url = 'https://uat.dwolla.com/oauth/rest/offsitegateway/checkouts';
$dwollaJson = array(
'client_id' => '*******',
'client_secret' => '*******',
'callback' => 'http://requestb.in/164go6s1',
'redirect' => 'https://purple.com',
'orderId' => 'test123',
'test' => 'false',
@spencerhunter
spencerhunter / dwollaOAuth
Created Jan 26, 2015
Dwolla OAuth flow with node.js
View dwollaOAuth
var express = require('express');
var router = express.Router();
var request = require('request');
var c = require('../config');
//step 1
var redirect_uri = c.host + '/oauth_return';
router.get('/auth/dwolla', function(req, res) {
var scope = 'Transactions';
var client_id = c.client_id;
@spencerhunter
spencerhunter / gist:a3cc22b0a5f898c188f3
Last active Aug 29, 2015
Refresh token - node-cron example
View gist:a3cc22b0a5f898c188f3
var cron = require('cron');
var cronJob = cron.job("0 */55 * * * *", function() {
User.find({
where: {
dwolla_id: '812-196-0757' //query user in db
}
}).then(function(user) {
if (user) { //if user exists in db
var rToken = user.dwolla_refresh; //grab the existing stored refresh token