Skip to content

greathouse/dwolla-sdk-dotnet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dwolla-sdk-dotnet

Corey Oliver, 2012

An implementation of the Dwolla REST API using OAuth 2.0 in C#. The documentation for Dwolla's API can be found here.

Setup Project in Visual Studio

  1. Open the DwollaAPI.sln with Visual Studio.
  2. Click on Build > Rebuild Solution.
  3. The .dll is copied to ..\Bin.

Samples

After building DwollaAPI.sln as described above, feel free to peruse and run the examples provided in the Samples directory:

  1. Open the Samples.sln file in Visual Studio.
  2. Define the dwollaAppId and dwollaAppSecret attributes in the Web.config file with your Dwolla application key and secret respectively.
  3. Right-click on the web project labeled Samples and click View in Browser.

Usage

Instantiate an instance of the DwollaClient class assigning your Dwolla application key and secret to the ClientIdentifier and ClientSecret instance variables respectively:

private static readonly DwollaClient client = new DwollaClient
{
    ClientIdentifier = "hHLYjMVBBtl12+VKnzcFzCgXGO1lcjLARO7cJIQ8sEyCtzJaAT",
    ClientSecret = "HGJj2gbwCZuM4r3+4gbIEHfeJHfDebVmVOgfHBuRaWhO6XaEkL",
};

Create a variable of type IAuthorizationState which will store the authorization response from Dwolla. If successful, it will store the access token; null otherwise:

IAuthorizationState authorization = client.ProcessUserAuthorization();

Now you must request for user authorization from Dwolla while indicating the scope needed by any api calls you will make:

client.RequestUserAuthorization(new Scope[] { Scope.REQUEST });

If authorized by the user, you can now perform any desired set of actions allowed by the scope(s) you indicated above:

var request = client.Request(authorization.AccessToken, 1111, "812-111-1111", 1, UserType.DWOLLA, null, "Test");

About

An implementation of the Dwolla REST API using OAuth 2.0 in C#

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%