This repo contains a Dwolla starter-kit app illustrating the send flow, where a Client (business) sends money to its Customers. This project was built using Next.js, React and Auth0.
- Clone the repository and run
npm install
oryarn
- Create a free Auth0 account
- Rename
.env.local.example
file to.env.local
- Ensure the variables in
.env.local
file are set up correctly
.env.local.example
# Auth0 (find this information in your Auth0 dashboard - https://manage.auth0.com/dashboard)
AUTH0_SECRET="LONG_RANDOM_VALUE"
AUTH0_BASE_URL="http://localhost:3000"
AUTH0_ISSUER_BASE_URL="https://YOUR_AUTH0_DOMAIN.auth0.com"
AUTH0_CLIENT_ID="YOUR_AUTH0_CLIENT_ID"
AUTH0_CLIENT_SECRET="YOUR_AUTH0_CLIENT_SECRET"
# Dwolla (navigate to your Sandbox Dashboard to find your Key and Secret - https://accounts-sandbox.dwolla.com)
DWOLLA_APP_KEY="YOUR_DWOLLA_APP_KEY"
DWOLLA_APP_SECRET="YOUR_DWOLLA_APP_SECRET"
DWOLLA_APP_ENV="sandbox"
# This is the email you used to sign up for a Sandbox account.
ADMIN_EMAIL="YOUR_DWOLLA_ACCOUNT_EMAIL"
-
After creating an Auth0 account, choose the application type "Regular Web Applications" (Traditional web app using redirects) when creating an application.
-
Select
Next.js
for type of technology -
Under the settings tab of your newly created application, copy/paste
http://localhost:3000/api/auth/callback
for "Allowed Callback URLs" -
Copy/Paste
http://localhost:3000/
for "Allowed Logout URLs" -
Copy/Paste
http://localhost:3000/
for "Allowed Web Origins"
Run tests
npm run checks
# or
yarn checks
Run the project
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
Once you have the app set up and running, you will see a login page. Clicking on the Login/Signup button will trigger the Auth0 flow for login and authentication.
You can either login as the Admin
of the app or a User
.
- If you login using your Sandbox email address, you are taken to the
Admin
dashboard where you can view a list of your Customers. You can send funds to these Customers by clicking on theSend Money
button.
- You can navigate to the Settings page to view your Account information.
- If you login using an email other than your Sandbox account email, then you are taken to the
Customer
Dashboard where you can create your payment profile. This step will create aRecieve-Only
Dwolla Customer account associated with that email.
- Once your profile is created, you are taken to the Dashboard view where you are able to view a list all payments made to you by the
Admin
.
- Navigate to the Settings page to view your Account information and add or remove a bank.
Visit our Guide or API docs for more additional information.
Support queries can be directed to our Developer Forum.
Feel free to fork this repo and submit PRs for any corrections, new features, etc. you think we should include!