Skip to content

Latest commit

 

History

History
78 lines (59 loc) · 2.12 KB

README.md

File metadata and controls

78 lines (59 loc) · 2.12 KB

Build Status

DwollaElixir

An Elixir wrapper for Dwolla's API Dwolla API docs

Usage

Add DwollaElixir as a dependency to your mix.exs file

defp deps do
  [{:dwolla_elixir, github: "lochnesh/dwolla_elixir"}]
end

You should also update your applications list to include dwolla:

def application do
  [applications: [:dwolla_elixir]]
end

##Obtaining a client The Dwolla end points require the application key and secret or an oauth token. This API wrapper uses an Elixir record called Client which holds all three. The wrapped end points require a Client record. To obtain a client record,

#set application variables in mix.exs 
#or set environment variable key, secret, token
#then call 
client = Dwolla.Client.new

#to define inline
client = Dwolla.Client.client(key: "KEY", secret: "SECRET", token: "TOKEN")

##Examples To start in interactive console

iex -S mix

-Obtain a client record

require Dwolla.Client
client = Dwolla.Client.client(key: "KEY", secret: "SECRET", token: "TOKEN")

-Get user by Id

Dwolla.Users.get("[email protected]",client)

##Integration tests Integration tests are contained in integration_test folder. Integration tests execute against the Dwolla UAT environment To run, define the following environment variables (you will need to obtain an application key, secret, and an oauth_token. Get oauth token

export MIX_ENV=all
export KEY={YOUR_KEY}
export SECRET=(YOUR_SECRET}
export TOKEN={SOME_TEST_USER_TOKEN}
export MERCHANT_TOKEN={ANOTHER_TEST_USER_TOKEN}
export PIN={TEST_USER_PIN}

Support

License

Copyright © 2014 Dwolla

Released under the MIT License: http://www.opensource.org/licenses/mit-license.php