kolanos / dwolla-v2-go

A Go wrapper for the Dwolla API V2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dwolla-v2-go

Build Status Code Coverage GoDoc MIT Go Report Card

A Go wrapper for the Dwolla API V2

Requirements

  • Go v1.11+ (uses modules)

Install

go get -u github.com/kolanos/dwolla-v2-go

Usage

To instantiate the client:

package main

import (
	"context"
	"fmt"

	"github.com/kolanos/dwolla-v2-go"
)

var ctx = context.Background()

func main() {
	client := dwolla.New("<your dwolla key here>", "<your dwolla secret here>", dwolla.Production)

	# Or if using the Dwolla sandbox
	#client := dwolla.New("<your dwolla key here>", "<your dwolla secret here>", dwolla.Sandbox)
}

To retrieve dwolla account information:

res, err := client.Account.Retrieve(ctx)

if err != nil {
	fmt.Println("Error:", err)
	return err
}

fmt.Println("Account ID:", res.ID)
fmt.Println("Account Name:", res.Name)

See the GoDoc for the full API.

License

MIT License

About

A Go wrapper for the Dwolla API V2

License:MIT License


Languages

Language:Go 100.0%