This sample app shows how to create a Dwolla Webhook Subscription and verify its signature. See the Documentation for more details.
This app deploys a webhook handler as an AWS Lambda function via the Serverless Framework. You can deploy one to your AWS account as follows,
- Clone the repository and install dependencies with
npm install - Export environment variables for your Dwolla Sandbox
DWOLLA_APP_KEY,DWOLLA_APP_SECRET, andWEBHOOK_SECRET. If you're not sure what these are, start here. TheWEBHOOK_SECRETis explained here. - Run
npm run deployto create the Lambda function. After the deploy, a publicly accessible HTTP endpoint is logged to the console asServiceEndpoint. Copy and paste it into theURLvariable inone-time-setup.ts. - Run
npm run setupto create your Webhook Subscription - Run
npm run create-customerto create a customer in Dwolla's API - Check your Lambda function's logs for
Received customer_created, body=...withnpm run logs(you may have to wait ~15 seconds). It's working! - [Optional] To remove the resources in AWS,
npm run remove