Skip to content

Instantly share code, notes, and snippets.

View spencerhunter's full-sized avatar

Spencer Hunter spencerhunter

  • Dwolla
  • Des Moines
View GitHub Profile
@spencerhunter
spencerhunter / TransferandEvents-Account-UnverifiedCustomer.md
Last active March 30, 2022 21:27
Example of a bank to bank transfer between a Client Dwolla Account and an Unverified Customer as well as related events

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: Client Account bank Destination: Unverified Customer bank.
Transfer scenario 2 - Source: Unverified Customer bank Destination: Client 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 pro

@spencerhunter
spencerhunter / TransferAndEvents.md
Last active June 14, 2023 20:10
Outlines the sequence of events that are triggered for a subset of Dwolla payment flows that are bank-to-bank via ACH

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 February 7, 2017 16:04
Example list of supported transfer types including sample requests

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 January 21, 2017 18:21
Example List of Events related to Dwolla Accounts

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 January 15, 2021 19:38
Example List of webhooks related to API Customers

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 April 26, 2019 21:29
Dwolla API Sandbox Postman environment variables template
{
"id": "0bf1fd1b-92ef-e783-1f8b-3b0ae0d64016",
"name": "Dwolla API Sandbox",
"values": [
{
"key": "client_id",
"value": "",
"type": "text",
"enabled": true
},
@spencerhunter
spencerhunter / dwollaGateway
Last active August 29, 2015 14:16
Dwolla Off-Site Gateway - Generate checkoutID
<?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 January 26, 2015 15:43
Dwolla OAuth flow with node.js
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 August 29, 2015 14:11
Refresh token - node-cron example
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