dwolla-v2-go: github.com/kolanos/dwolla-v2-go Index | Files

package dwolla

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

Index

Package Files

account.go beneficial_owner.go business_classification.go client.go customer.go document.go event.go funding_source.go hal.go mass_payment.go micro_deposit.go ondemand_authorization.go transfer.go transfer_failure.go util.go webhook.go webhook_subscription.go

Constants

const (
    // Version is the version of the client
    Version string = "0.1.0"

    // Production is the production environment
    Production Environment = "production"
    // Sandbox is the sanbox environment
    Sandbox Environment = "sandbox"

    // ProductionAPIURL is the production api url
    ProductionAPIURL = "https://api.dwolla.com"
    // ProductionAuthURL is the production auth url
    ProductionAuthURL = "https://www.dwolla.com/oauth/v2/authenticate"
    // ProductionTokenURL is the production token url
    // Deprecated - use https://api.dwolla.com/token moving forward
    ProductionTokenURL = "https://accounts.dwolla.com/token"

    // SandboxAPIURL is the sandbox api url
    SandboxAPIURL = "https://api-sandbox.dwolla.com"
    // SandboxAuthURL is the sandbox auth url
    SandboxAuthURL = "https://sandbox.dwolla.com/oauth/v2/authenticate"
    // SandboxTokenURL is the sandbox token url
    // Deprecated - use https://api-sandbox.dwolla.com moving forward
    SandboxTokenURL = "https://accounts-sandbox.dwolla.com/token"
)

Variables

var ErrNoID = errors.New("unable to extract ID")

func IDFromHREF Uses

func IDFromHREF(href string) (string, error)

IDFromHREF takes an HREF link and returns the ID at the end of the HREF. This is useful for processing webhooks where you have an HREF, but need to make calls using this SDK, which expects bare IDs.

If the input HREF is malformed, or this function is unable to extract the ID, ErrNoID will be returned.

func Unmarshal Uses

func Unmarshal(data []byte, container interface{}) error

Unmarshal unmarhsals a hal object into a struct

type Account Uses

type Account struct {
    Resource
    ID             string  `json:"id"`
    Name           string  `json:"name"`
    TimezoneOffset float32 `json:"timezoneOffset"`
    Type           string  `json:"type"`
}

Account is a dwolla account

func (*Account) CreateFundingSource Uses

func (a *Account) CreateFundingSource(ctx context.Context, body *FundingSourceRequest) (*FundingSource, error)

CreateFundingSource creates a funding source for the account

see: https://docsv2.dwolla.com/#create-a-funding-source-for-an-account

func (*Account) ListFundingSources Uses

func (a *Account) ListFundingSources(ctx context.Context, removed bool) (*FundingSources, error)

ListFundingSources returns the account's funding sources

see: https://docsv2.dwolla.com/#list-funding-sources-for-an-account

func (*Account) ListMassPayments Uses

func (a *Account) ListMassPayments(ctx context.Context, params *url.Values) (*MassPayments, error)

ListMassPayments returns mass payments for the account

see: https://docsv2.dwolla.com/#list-mass-payments-for-an-account

func (*Account) ListTransfers Uses

func (a *Account) ListTransfers(ctx context.Context, params *url.Values) (*Transfers, error)

ListTransfers returns the account's transfers

see: https://docsv2.dwolla.com/#list-and-search-transfers-for-an-account

type AccountService Uses

type AccountService interface {
    Retrieve(context.Context) (*Account, error)
}

AccountService is the account service interface

see: https://docsv2.dwolla.com/#accounts

type AccountServiceOp Uses

type AccountServiceOp struct {
    // contains filtered or unexported fields
}

AccountServiceOp is an implementation of the account service interface

func (*AccountServiceOp) Retrieve Uses

func (a *AccountServiceOp) Retrieve(ctx context.Context) (*Account, error)

Retrieve retrieves the dwolla account

see: https://docsv2.dwolla.com/#retrieve-account-details

type Address Uses

type Address struct {
    Address1            string `json:"address1"`
    Address2            string `json:"address2,omitempty"`
    Address3            string `json:"address3,omitempty"`
    City                string `json:"city"`
    StateProvinceRegion string `json:"stateProvinceRegion"`
    PostalCode          string `json:"postalCode,omitempty"`
    Country             string `json:"country"`
}

Address represents a street address

type Amount Uses

type Amount struct {
    Value    string   `json:"value"`
    Currency Currency `json:"currency"`
}

Amount is a monetary value

func (Amount) String Uses

func (a Amount) String() string

String returns a string representation of the amount

type BeneficialOwner Uses

type BeneficialOwner struct {
    Resource
    ID                 string                `json:"id"`
    FirstName          string                `json:"firstName"`
    LastName           string                `json:"lastName"`
    Address            Address               `json:"address"`
    Passport           Passport              `json:"passport"`
    VerificationStatus BeneficialOwnerStatus `json:"verificationStatus"`
}

BeneficialOwner is a beneficial owner

func (*BeneficialOwner) CreateDocument Uses

func (b *BeneficialOwner) CreateDocument(ctx context.Context, body *DocumentRequest) (*Document, error)

CreateDocument uploads a document for the beneficial owner

see: https://docsv2.dwolla.com/#create-a-document-for-a-beneficial-owner

func (*BeneficialOwner) ListDocuments Uses

func (b *BeneficialOwner) ListDocuments(ctx context.Context) (*Documents, error)

ListDocuments returns documents for beneficial owner

see: https://docsv2.dwolla.com/#list-documents-for-beneficial-owners

func (*BeneficialOwner) Remove Uses

func (b *BeneficialOwner) Remove(ctx context.Context) error

Remove removes the beneficial owner

see: https://docsv2.dwolla.com/#remove-a-beneficial-owner

func (*BeneficialOwner) Update Uses

func (b *BeneficialOwner) Update(ctx context.Context, body *BeneficialOwnerRequest) error

Update updates the dwolla beneficial owner

see: https://docsv2.dwolla.com/#update-a-beneficial-owner

type BeneficialOwnerRequest Uses

type BeneficialOwnerRequest struct {
    FirstName   string    `json:"firstName,omitempty"`
    LastName    string    `json:"lastName,omitempty"`
    DateOfBirth string    `json:"dateOfBirth,omitempty"`
    SSN         string    `json:"ssn,omitempty"`
    Address     Address   `json:"address,omitempty"`
    Passport    *Passport `json:"passport,omitempty"`
}

BeneficialOwnerRequest is a beneficial owner request

type BeneficialOwnerService Uses

type BeneficialOwnerService interface {
    Remove(context.Context, string) error
    Retrieve(context.Context, string) (*BeneficialOwner, error)
    Update(context.Context, string, *BeneficialOwnerRequest) (*BeneficialOwner, error)
}

BeneficialOwnerService is the beneficial owner service interface

see: https://docsv2.dwolla.com/#beneficial-owners

type BeneficialOwnerServiceOp Uses

type BeneficialOwnerServiceOp struct {
    // contains filtered or unexported fields
}

BeneficialOwnerServiceOp is an implementation of the beneficial owner service

func (*BeneficialOwnerServiceOp) Remove Uses

func (b *BeneficialOwnerServiceOp) Remove(ctx context.Context, id string) error

Remove removes a beneficial owner matching the id

see: https://docsv2.dwolla.com/#remove-a-beneficial-owner

func (*BeneficialOwnerServiceOp) Retrieve Uses

func (b *BeneficialOwnerServiceOp) Retrieve(ctx context.Context, id string) (*BeneficialOwner, error)

Retrieve retrieves a beneficial owner matching the id

see: https://docsv2.dwolla.com/#retrieve-a-beneficial-owner

func (*BeneficialOwnerServiceOp) Update Uses

func (b *BeneficialOwnerServiceOp) Update(ctx context.Context, id string, body *BeneficialOwnerRequest) (*BeneficialOwner, error)

Update updates a beneficial owner matching the id

see: https://docsv2.dwolla.com/#update-a-beneficial-owner

type BeneficialOwnerStatus Uses

type BeneficialOwnerStatus string

BeneficialOwnerStatus is the status of the beneficial owner

const (
    // BeneficialOwnerStatusDocument is when the beneficial owner needs verification document
    BeneficialOwnerStatusDocument BeneficialOwnerStatus = "document"

    // BeneficialOwnerStatusIncomplete is when the beneficial owner is incomplete
    BeneficialOwnerStatusIncomplete BeneficialOwnerStatus = "incomplete"

    // BeneficialOwnerStatusVerified is when the beneficial owner is verified
    BeneficialOwnerStatusVerified BeneficialOwnerStatus = "verified"
)

type BeneficialOwners Uses

type BeneficialOwners struct {
    Collection
    Embedded map[string][]BeneficialOwner `json:"_embedded"`
}

BeneficialOwners is a collection of beneficial owners

type BeneficialOwnership Uses

type BeneficialOwnership struct {
    Resource
    Status CertificationStatus `json:"status"`
}

BeneficialOwnership is the beneficial ownership status

func (*BeneficialOwnership) Certify Uses

func (b *BeneficialOwnership) Certify(ctx context.Context) error

Certify certifies beneficial ownership

see: https://docsv2.dwolla.com/#certify-beneficial-ownership

type BeneficialOwnershipRequest Uses

type BeneficialOwnershipRequest struct {
    Status CertificationStatus `json:"status,omitempty"`
}

BeneficialOwnershipRequest is a beneficial ownership request

type BusinessClassification Uses

type BusinessClassification struct {
    Resource
    ID       string                              `json:"id"`
    Name     string                              `json:"name"`
    Embedded map[string][]IndustryClassification `json:"_embedded"`
}

BusinessClassification is a business industry type

type BusinessClassificationService Uses

type BusinessClassificationService interface {
    Retrieve(context.Context, string) (*BusinessClassification, error)
    List(context.Context, *url.Values) (*BusinessClassifications, error)
}

BusinessClassificationService is the business classification interface

type BusinessClassificationServiceOp Uses

type BusinessClassificationServiceOp struct {
    // contains filtered or unexported fields
}

BusinessClassificationServiceOp is an implementation of the business classification interface

func (*BusinessClassificationServiceOp) List Uses

func (b *BusinessClassificationServiceOp) List(ctx context.Context, params *url.Values) (*BusinessClassifications, error)

List returns a collection of business classifications

see: https://docsv2.dwolla.com/#list-business-classifications

func (*BusinessClassificationServiceOp) Retrieve Uses

func (b *BusinessClassificationServiceOp) Retrieve(ctx context.Context, id string) (*BusinessClassification, error)

Retrieve retrieves a business classification matching the id

see: https://docsv2.dwolla.com/#retrieve-a-business-classification

type BusinessClassifications Uses

type BusinessClassifications struct {
    Collection
    Embedded map[string][]BusinessClassification `json:"_embedded"`
}

BusinessClassifications is a business classification

type CertificationStatus Uses

type CertificationStatus string

CertificationStatus is the beneficial ownership certification status

const (
    // CertificationStatusCertified is when the ownership status is certified
    CertificationStatusCertified CertificationStatus = "certified"

    // CertificationStatusRecertify is when the ownership status needs
    // to be recertified
    CertificationStatusRecertify CertificationStatus = "recertify"

    // CertificationStatusUncertified is when the ownership status is uncertified
    CertificationStatusUncertified CertificationStatus = "uncertified"
)

type Client Uses

type Client struct {
    Key         string
    Secret      string
    Environment Environment
    HTTPClient  HTTPClient
    Token       *Token

    Account                AccountService
    BeneficialOwner        BeneficialOwnerService
    BusinessClassification BusinessClassificationService
    Customer               CustomerService
    Document               DocumentService
    Event                  EventService
    FundingSource          FundingSourceService
    MassPayment            MassPaymentService
    OnDemandAuthorization  OnDemandAuthorizationService
    Transfer               TransferService
    TransferFailure        *TransferFailureServiceOp
    Webhook                WebhookService
    WebhookSubscription    WebhookSubscriptionService
    // contains filtered or unexported fields
}

Client is the dwolla client

func New Uses

func New(key, secret string, environment Environment) *Client

New initializes a new dwolla client

func NewWithHTTPClient Uses

func NewWithHTTPClient(key, secret string, environment Environment, httpClient HTTPClient) *Client

NewWithHTTPClient initializes the client with specified http client

func (Client) APIURL Uses

func (c Client) APIURL() string

APIURL returns the api url for the environment

func (Client) AuthURL Uses

func (c Client) AuthURL() string

AuthURL returns the auth url for the environment

func (Client) BuildAPIURL Uses

func (c Client) BuildAPIURL(path string) string

BuildAPIURL builds an api url with a given path

func (*Client) Delete Uses

func (c *Client) Delete(ctx context.Context, path string, params *url.Values, headers *http.Header) error

Delete performs a DELETE against the api

func (*Client) EnsureToken Uses

func (c *Client) EnsureToken(ctx context.Context) error

EnsureToken ensures that a token exists for a request

func (*Client) Get Uses

func (c *Client) Get(ctx context.Context, path string, params *url.Values, headers *http.Header, container interface{}) error

Get performs a GET against the api

func (*Client) Post Uses

func (c *Client) Post(ctx context.Context, path string, body interface{}, headers *http.Header, container interface{}) error

Post performs a POST against the api

func (*Client) RequestToken Uses

func (c *Client) RequestToken(ctx context.Context) error

RequestToken requests a new auth token using client credentials

func (*Client) Root Uses

func (c *Client) Root(ctx context.Context) (*Resource, error)

Root returns the dwolla root response

func (*Client) SandboxSimulations Uses

func (c *Client) SandboxSimulations(ctx context.Context) error

SandboxSimulations simulates events within the sandbox environment

see: https://developers.dwolla.com/resources/testing.html#simulate-bank-transfer-processing

func (Client) TokenURL Uses

func (c Client) TokenURL() string

TokenURL returns the token url for the environment

func (*Client) Upload Uses

func (c *Client) Upload(ctx context.Context, path string, documentType DocumentType, fileName string, file io.Reader, container interface{}) error

Upload performs a multipart file upload to the Dwolla API

type Collection Uses

type Collection struct {
    Links    Links    `json:"_links"`
    Embedded Embedded `json:"_embedded"`
    Total    int      `json:"total"`
    // contains filtered or unexported fields
}

Collection is a collection of hal resources

type Controller Uses

type Controller struct {
    FirstName   string   `json:"firstName,omitempty"`
    LastName    string   `json:"lastName,omitempty"`
    Title       string   `json:"title,omitempty"`
    DateOfBirth string   `json:"dateOfBirth,omitempty"`
    SSN         string   `json:"ssn,omitempty"`
    Address     Address  `json:"address,omitempty"`
    Passport    Passport `json:"passport,omitempty"`
}

Controller is a controller of a business

type ControllerRequest Uses

type ControllerRequest struct {
    FirstName   string    `json:"firstName,omitempty"`
    LastName    string    `json:"lastName,omitempty"`
    Title       string    `json:"title,omitempty"`
    DateOfBirth string    `json:"dateOfBirth,omitempty"`
    SSN         string    `json:"ssn,omitempty"`
    Address     Address   `json:"address,omitempty"`
    Passport    *Passport `json:"passport,omitempty"`
}

ControllerRequest is a controller of a business create/update request

type Currency Uses

type Currency string

Currency represents the monetary currency

const (
    // USD is U.S. dollars
    USD Currency = "usd"
)

type Customer Uses

type Customer struct {
    Resource
    ID           string         `json:"id"`
    FirstName    string         `json:"firstName"`
    LastName     string         `json:"lastName"`
    Email        string         `json:"email"`
    Type         CustomerType   `json:"type"`
    Status       CustomerStatus `json:"status"`
    Created      string         `json:"created"`
    Address1     string         `json:"address1"`
    Address2     string         `json:"address2"`
    City         string         `json:"city"`
    State        string         `json:"state"`
    PostalCode   string         `json:"postalCode"`
    Phone        string         `json:"phone"`
    BusinessName string         `json:"businessName"`
    Controller   Controller     `json:"controller"`
}

Customer is a dwolla customer

func (*Customer) CertifyBeneficialOwnership Uses

func (c *Customer) CertifyBeneficialOwnership(ctx context.Context) error

CertifyBeneficialOwnership certifies beneficial ownership

see: https://docsv2.dwolla.com/#certify-beneficial-ownership

func (*Customer) CreateBeneficialOwner Uses

func (c *Customer) CreateBeneficialOwner(ctx context.Context, body *BeneficialOwnerRequest) (*BeneficialOwner, error)

CreateBeneficialOwner creates a beneficial owner for the customer

see: https://docsv2.dwolla.com/#create-a-beneficial-owner

func (*Customer) CreateDocument Uses

func (c *Customer) CreateDocument(ctx context.Context, body *DocumentRequest) (*Document, error)

CreateDocument uploads a verification document for the customer

see: https://docsv2.dwolla.com/#create-a-document

func (*Customer) CreateFundingSource Uses

func (c *Customer) CreateFundingSource(ctx context.Context, body *FundingSourceRequest) (*FundingSource, error)

CreateFundingSource creates a funding source for the customer

see: https://docsv2.dwolla.com/#create-a-funding-source-for-a-customer

func (Customer) CreatedTime Uses

func (c Customer) CreatedTime() time.Time

CreatedTime returns the created value as time.Time

func (*Customer) Deactivate Uses

func (c *Customer) Deactivate(ctx context.Context) error

Deactivate deactivates a dwolla customer

func (*Customer) ListBeneficialOwners Uses

func (c *Customer) ListBeneficialOwners(ctx context.Context) (*BeneficialOwners, error)

ListBeneficialOwners returns the customer's beneficial owners

see: https://docsv2.dwolla.com/#list-beneficial-owners

func (*Customer) ListDocuments Uses

func (c *Customer) ListDocuments(ctx context.Context) (*Documents, error)

ListDocuments returns documents for customer

see: https://docsv2.dwolla.com/#list-documents

func (*Customer) ListFundingSources Uses

func (c *Customer) ListFundingSources(ctx context.Context, removed bool) (*FundingSources, error)

ListFundingSources returns the customer's funding sources

see: https://docsv2.dwolla.com/#list-funding-sources-for-a-customer

func (*Customer) ListMassPayments Uses

func (c *Customer) ListMassPayments(ctx context.Context, params *url.Values) (*MassPayments, error)

ListMassPayments returns the customer's mass payments

see: https://docsv2.dwolla.com/#list-mass-payments-for-a-customer

func (*Customer) ListTransfers Uses

func (c *Customer) ListTransfers(ctx context.Context, params *url.Values) (*Transfers, error)

ListTransfers returns the customer's transfers

see: https://docsv2.dwolla.com/#list-and-search-transfers-for-a-customer

func (*Customer) Reactivate Uses

func (c *Customer) Reactivate(ctx context.Context) error

Reactivate reactivates a deactivated dwolla customer

func (*Customer) Receive Uses

func (c *Customer) Receive() bool

Receive returns true if customer can receive transfers

func (*Customer) RetrieveBeneficialOwnership Uses

func (c *Customer) RetrieveBeneficialOwnership(ctx context.Context) (*BeneficialOwnership, error)

RetrieveBeneficialOwnership retrieves the customer's beneficial ownership status

func (*Customer) RetrieveIAVToken Uses

func (c *Customer) RetrieveIAVToken(ctx context.Context) (*IAVToken, error)

RetrieveIAVToken retrieves an instant account activation token

func (*Customer) RetryVerification Uses

func (c *Customer) RetryVerification() bool

RetryVerification returns true if customer needs to retry verification

func (*Customer) Send Uses

func (c *Customer) Send() bool

Send returns true if customer can send transfers

func (*Customer) Suspend Uses

func (c *Customer) Suspend(ctx context.Context) error

Suspend suspends a dwolla customer

func (*Customer) Update Uses

func (c *Customer) Update(ctx context.Context, body *CustomerRequest) error

Update updates a dwolla customer

see: https://docsv2.dwolla.com/#update-a-customer

func (*Customer) VerifyBeneficialOwners Uses

func (c *Customer) VerifyBeneficialOwners() bool

VerifyBeneficialOwners returns true if beneficial owners needed

func (*Customer) VerifyBusiness Uses

func (c *Customer) VerifyBusiness() bool

VerifyBusiness returns true if business needs verification document

func (*Customer) VerifyController Uses

func (c *Customer) VerifyController() bool

VerifyController returns true if controller needs verification document

func (*Customer) VerifyControllerAndBusiness Uses

func (c *Customer) VerifyControllerAndBusiness() bool

VerifyControllerAndBusiness returns true if controller and business need verification document

type CustomerRequest Uses

type CustomerRequest struct {
    FirstName              string             `json:"firstName,omitempty"`
    LastName               string             `json:"lastName,omitempty"`
    Email                  string             `json:"email,omitempty"`
    IPAddress              string             `json:"ipAddress,omitempty"`
    Type                   CustomerType       `json:"type,omitempty"`
    Status                 CustomerStatus     `json:"status,omitempty"`
    DateOfBirth            string             `json:"dateOfBirth,omitempty"`
    SSN                    string             `json:"ssn,omitempty"`
    Phone                  string             `json:"phone,omitempty"`
    Address1               string             `json:"address1,omitempty"`
    Address2               string             `json:"address2,omitempty"`
    City                   string             `json:"city,omitempty"`
    State                  string             `json:"state,omitempty"`
    PostalCode             string             `json:"postalCode,omitempty"`
    BusinessClassification string             `json:"businessClassification,omitempty"`
    BusinessType           string             `json:"businessType,omitempty"`
    BusinessName           string             `json:"businessName,omitempty"`
    DoingBusinessAs        string             `json:"doingBusinessAs,omitempty"`
    EIN                    string             `json:"ein,omitempty"`
    Website                string             `json:"website,omitempty"`
    Controller             *ControllerRequest `json:"controller,omitempty"`
}

CustomerRequest is a customer create/update request

We don't just use the Customer struct here because there are fields that are not returned by the Dwolla API. As such, we don't want fields to be unset during marshaling.

type CustomerService Uses

type CustomerService interface {
    Create(context.Context, *CustomerRequest) (*Customer, error)
    List(context.Context, *url.Values) (*Customers, error)
    Retrieve(context.Context, string) (*Customer, error)
    Update(context.Context, string, *CustomerRequest) (*Customer, error)
}

CustomerService is the customerservice interface

see: https://docsv2.dwolla.com/#customers

type CustomerServiceOp Uses

type CustomerServiceOp struct {
    // contains filtered or unexported fields
}

CustomerServiceOp is an implementation of the customer service interface

func (*CustomerServiceOp) Create Uses

func (c *CustomerServiceOp) Create(ctx context.Context, body *CustomerRequest) (*Customer, error)

Create creates a dwolla customer

func (*CustomerServiceOp) List Uses

func (c *CustomerServiceOp) List(ctx context.Context, params *url.Values) (*Customers, error)

List returns a collection of customers

see: https://docsv2.dwolla.com/#list-and-search-customers

func (*CustomerServiceOp) Retrieve Uses

func (c *CustomerServiceOp) Retrieve(ctx context.Context, id string) (*Customer, error)

Retrieve retrieves a customer matching the id

see: https://docsv2.dwolla.com/#retrieve-a-customer

func (*CustomerServiceOp) Update Uses

func (c *CustomerServiceOp) Update(ctx context.Context, id string, body *CustomerRequest) (*Customer, error)

Update updates a dwolla customer matching the id

see: https://docsv2.dwolla.com/#update-a-customer

type CustomerStatus Uses

type CustomerStatus string

CustomerStatus is the customer's status

const (
    // CustomerStatusDeactivated is when the customer has been deactivated
    CustomerStatusDeactivated CustomerStatus = "deactivated"
    // CustomerStatusDocument is when the customer needs verification document
    CustomerStatusDocument CustomerStatus = "document"
    // CustomerStatusReactivated is when a deactivated customer is reactivated
    CustomerStatusReactivated CustomerStatus = "reactivated"
    // CustomerStatusRetry is when the customer needs to retry verification
    CustomerStatusRetry CustomerStatus = "retry"
    // CustomerStatusSuspended is when the customer has been suspended
    CustomerStatusSuspended CustomerStatus = "suspended"
    // CustomerStatusUnverified is when the customer is unverified
    CustomerStatusUnverified CustomerStatus = "unverified"
    // CustomerStatusVerified is when the customer is verified
    CustomerStatusVerified CustomerStatus = "verified"
)

type CustomerType Uses

type CustomerType string

CustomerType is the customer's type

const (
    // CustomerTypeBusiness is when the customer is a business
    CustomerTypeBusiness CustomerType = "business"
    // CustomerTypePersonal is when the customer is an individual
    CustomerTypePersonal CustomerType = "personal"
    // CustomerTypeReceiveOnly is when the customer can only receive funds
    CustomerTypeReceiveOnly CustomerType = "receive-only"
    // CustomerTypeUnverified is when the customer is unverified
    CustomerTypeUnverified CustomerType = "unverified"
)

type Customers Uses

type Customers struct {
    Collection
    Embedded map[string][]Customer `json:"_embedded"`
}

Customers is a collection of customers

type Document Uses

type Document struct {
    Resource
    ID            string                `json:"id"`
    Status        DocumentStatus        `json:"status"`
    Type          DocumentType          `json:"type"`
    Created       string                `json:"created"`
    FailureReason DocumentFailureReason `json:"failureReason"`
}

Document is a dwolla verification document

type DocumentFailureReason Uses

type DocumentFailureReason string

DocumentFailureReason is the reason document verification failed

const (
    // DocumentScanIDTypeNotSupported is when the scanned I.D. type is not
    // supported
    DocumentScanIDTypeNotSupported DocumentFailureReason = "ScanIdTypeNotSupported"
    // DocumentNameMismatch is when the scanned document name does not match
    DocumentScanNameMismatch DocumentFailureReason = "ScanNameMismatch"
    // DocumentScanNotReadable is when the scanned document is not readable
    DocumentScanNotReadable DocumentFailureReason = "ScanNotReadable"
    // DocumentScanNotUploaded is when the scanned document failed to upload
    DocumentScanNotUploaded DocumentFailureReason = "ScanNotUploaded"
    // DocumentScanFailedOther is when the scanned document was rejected for
    // another reason
    DocumentScanFailedOther DocumentFailureReason = "ScanFailedOther"
    // DocumentFailedOther is when the document was rejected for another
    // reason
    DocumentFailedOther DocumentFailureReason = "FailedOther"
)

type DocumentRequest Uses

type DocumentRequest struct {
    Type     DocumentType
    FileName string
    File     io.Reader
}

DocumentRequest is a verification document request

type DocumentService Uses

type DocumentService interface {
    Retrieve(context.Context, string) (*Document, error)
}

DocumentService is the document service interface

see: https://docsv2.dwolla.com/#documents

type DocumentServiceOp Uses

type DocumentServiceOp struct {
    // contains filtered or unexported fields
}

DocumentServiceOp is an implementation of the document service

func (*DocumentServiceOp) Retrieve Uses

func (d *DocumentServiceOp) Retrieve(ctx context.Context, id string) (*Document, error)

Retrieve retrieves a document matching the id

type DocumentStatus Uses

type DocumentStatus string

DocumentStatus is the status of the document

const (
    // DocumentStatusPending is when the document is pending review
    DocumentStatusPending DocumentStatus = "pending"
    // DocumentStatusReviewed is when the document has been reviewed
    DocumentStatusReviewed DocumentStatus = "reviewed"
)

type DocumentType Uses

type DocumentType string

DocumentType is the type of document

const (
    // DocumentTypePassport is a passport
    DocumentTypePassport DocumentType = "passport"
    // DocumentTypeLicense is a state-issued driver's license
    DocumentTypeLicense DocumentType = "license"
    // DocumentTypeIDCard is a U.S. government issued photo I.D. card
    DocumentTypeIDCard DocumentType = "idCard"
    // DocumentTypeOther is an EIN Letter / IRS-issued SS4 Confirmation Letter
    DocumentTypeOther DocumentType = "other"
)

type Documents Uses

type Documents struct {
    Collection
    Embedded map[string][]Document `json:"_embedded"`
}

Documents is a collection of dwolla documents

type Embedded Uses

type Embedded map[string][]Resource

Embedded is a hal embedded resource

type Environment Uses

type Environment string

Environment is a supported dwolla environment

type Event Uses

type Event struct {
    Resource
    ID         string     `json:"id"`
    Created    string     `json:"created"`
    Topic      EventTopic `json:"topic"`
    ResourceID string     `json:"resourceId"`
}

Event is a dwolla event

type EventService Uses

type EventService interface {
    List(context.Context, *url.Values) (*Events, error)
    Retrieve(context.Context, string) (*Event, error)
}

EventService is the event service interface

see: https://docsv2.dwolla.com/#events

type EventServiceOp Uses

type EventServiceOp struct {
    // contains filtered or unexported fields
}

EventServiceOp is an implementation of the event service interface

func (*EventServiceOp) List Uses

func (e *EventServiceOp) List(ctx context.Context, params *url.Values) (*Events, error)

List returns a collection of events

see: https://docsv2.dwolla.com/#list-events

func (*EventServiceOp) Retrieve Uses

func (e *EventServiceOp) Retrieve(ctx context.Context, id string) (*Event, error)

Retrieve retrieves the event matching the id

see: https://docsv2.dwolla.com/#retrieve-an-event

type EventTopic Uses

type EventTopic string

EventTopic is an event topic

type Events Uses

type Events struct {
    Collection

    Embedded map[string][]Event `json:"_embedded"`
    // contains filtered or unexported fields
}

Events is a collection of dwolla events

type FundingSource Uses

type FundingSource struct {
    Resource
    ID              string                       `json:"id"`
    Status          FundingSourceStatus          `json:"status"`
    Type            FundingSourceType            `json:"type"`
    BankAccountType FundingSourceBankAccountType `json:"bankAccountType"`
    Name            string                       `json:"name"`
    Created         string                       `json:"created"`
    Balance         Amount                       `json:"balance"`
    Removed         bool                         `json:"removed"`
    Channels        []string                     `json:"channels"`
    BankName        string                       `json:"bankName"`
    Fingerprint     string                       `json:"fingerprint"`
}

FundingSource is a dwolla funding source

func (*FundingSource) Customer Uses

func (f *FundingSource) Customer(ctx context.Context) (*Customer, error)

Customer returns the funding source's customer

func (*FundingSource) FailedVerificationMicroDeposits Uses

func (f *FundingSource) FailedVerificationMicroDeposits() bool

FailedVerificationMicroDeposits returns true if micro deposit verificationfailed

func (*FundingSource) InitiateMicroDeposits Uses

func (f *FundingSource) InitiateMicroDeposits(ctx context.Context) (*MicroDeposit, error)

InitiateMicroDeposits initiates micro deposit verification

see: https://docsv2.dwolla.com/#initiate-micro-deposits

func (*FundingSource) Remove Uses

func (f *FundingSource) Remove(ctx context.Context) error

Remove removes the funding source

see: https://docsv2.dwolla.com/#remove-a-funding-source

func (*FundingSource) RetrieveBalance Uses

func (f *FundingSource) RetrieveBalance(ctx context.Context) (*FundingSourceBalance, error)

RetrieveBalance retrieves the funding source balance

see: https://docsv2.dwolla.com/#retrieve-a-funding-source-balance

func (*FundingSource) RetrieveMicroDeposits Uses

func (f *FundingSource) RetrieveMicroDeposits(ctx context.Context) (*MicroDeposit, error)

RetrieveMicroDeposits retrieves funding source micro deposits

see: https://docsv2.dwolla.com/#retrieve-micro-deposits-details

func (*FundingSource) TransferFromBalance Uses

func (f *FundingSource) TransferFromBalance() bool

TransferFromBalance returns true if funding source can transfer from balance

func (*FundingSource) TransferReceive Uses

func (f *FundingSource) TransferReceive() bool

TransferReceive returns true if funding source can receive transfers

func (*FundingSource) TransferSend Uses

func (f *FundingSource) TransferSend() bool

TransferSend returns true if funding source can send transfers

func (*FundingSource) TransferToBalance Uses

func (f *FundingSource) TransferToBalance() bool

TransferToBalance returns true if funding source can transfer to balance

func (*FundingSource) Update Uses

func (f *FundingSource) Update(ctx context.Context, body *FundingSourceRequest) error

Update updates the funding source

see: https://docsv2.dwolla.com/#update-a-funding-source

func (*FundingSource) VerifyMicroDeposits Uses

func (f *FundingSource) VerifyMicroDeposits(ctx context.Context, body *MicroDepositRequest) error

VerifyMicroDeposits verifies micro deposit amounts

see: https://docsv2.dwolla.com/#verify-micro-deposits

type FundingSourceBalance Uses

type FundingSourceBalance struct {
    Resource
    Balance     Amount `json:"balance"`
    LastUpdated string `json:"lastUpdated"`
}

FundingSourceBalance is a funding source balance

type FundingSourceBankAccountType Uses

type FundingSourceBankAccountType string

FundingSourceBankAccountType is a dwolla bank account type enum

const (
    // FundingSourceBankAccountTypeChecking is a checking bank account
    FundingSourceBankAccountTypeChecking FundingSourceBankAccountType = "checking"
    // FundingSourceBankAccountTypeSavings is a savings bank account
    FundingSourceBankAccountTypeSavings FundingSourceBankAccountType = "savings"
)

type FundingSourceRequest Uses

type FundingSourceRequest struct {
    Resource
    RoutingNumber   string                       `json:"routingNumber,omitempty"`
    AccountNumber   string                       `json:"accountNumber,omitempty"`
    BankAccountType FundingSourceBankAccountType `json:"bankAccountType,omitempty"`
    Name            string                       `json:"name,omitempty"`
    Channels        []string                     `json:"channels,omitempty"`
    Removed         bool                         `json:"removed,omitempty"`
    PlaidToken      string                       `json:"plaidToken,omitempty"`
}

FundingSourceRequest is a funding source request

type FundingSourceService Uses

type FundingSourceService interface {
    Retrieve(context.Context, string) (*FundingSource, error)
    Update(context.Context, string, *FundingSourceRequest) (*FundingSource, error)
    Remove(context.Context, string) error
}

FundingSourceService is the funding source service interface

see: https://docsv2.dwolla.com/#funding-sources

type FundingSourceServiceOp Uses

type FundingSourceServiceOp struct {
    // contains filtered or unexported fields
}

FundingSourceServiceOp is an implementation of the funding source interface

func (*FundingSourceServiceOp) Remove Uses

func (f *FundingSourceServiceOp) Remove(ctx context.Context, id string) error

Remove removes a funding source matching the id

see: https://docsv2.dwolla.com/#remove-a-funding-source

func (*FundingSourceServiceOp) Retrieve Uses

func (f *FundingSourceServiceOp) Retrieve(ctx context.Context, id string) (*FundingSource, error)

Retrieve retrieves a funding source with the matching id

see: https://docsv2.dwolla.com/#retrieve-a-funding-source

func (*FundingSourceServiceOp) Update Uses

func (f *FundingSourceServiceOp) Update(ctx context.Context, id string, body *FundingSourceRequest) (*FundingSource, error)

Update updates the funding source with matching id

see: https://docsv2.dwolla.com/#update-a-funding-source

type FundingSourceStatus Uses

type FundingSourceStatus string

FundingSourceStatus is a funding source's status

const (
    // FundingSourceStatusUnverified is when the funding source is unverified
    FundingSourceStatusUnverified FundingSourceStatus = "unverified"
    // FundingSourceStatusVerified is when the funding source is verified
    FundingSourceStatusVerified FundingSourceStatus = "verified"
)

type FundingSourceType Uses

type FundingSourceType string

FundingSourceType is the funding source type

const (
    // FundingSourceTypeBank is when the funding source is a bank account
    FundingSourceTypeBank FundingSourceType = "bank"
    // FundingSourceTypeBalance is when the funding source is a dwolla balance
    FundingSourceTypeBalance FundingSourceType = "balance"
)

type FundingSources Uses

type FundingSources struct {
    Collection
    Embedded map[string][]FundingSource `json:"_embedded"`
}

FundingSources is a collection of funding sources

type HALError Uses

type HALError struct {
    Code    string `json:"code"`
    Message string `json:"message"`
    Path    string `json:"path"`
}

HALError is a hal error

func (HALError) Error Uses

func (e HALError) Error() string

HALError implements the error interface

type HALErrors Uses

type HALErrors map[string][]HALError

HALErrors is an array of embedded hal errors

type HTTPClient Uses

type HTTPClient interface {
    Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the http client interface

type IAVToken Uses

type IAVToken struct {
    Resource
    Token string `json:"token"`
}

IAVToken is a instant account verification token

type IndustryClassification Uses

type IndustryClassification struct {
    ID   string `json:"id"`
    Name string `json:"name"`
}

IndustryClassification is a industry subclassification

type Link struct {
    Href         string `json:"href"`
    ResourceType string `json:"resource-type"`
    Type         string `json:"type"`
}

Link is a hal resource link

type Links map[string]Link

Links is a group of resource links

type MassPayment Uses

type MassPayment struct {
    Resource
    ID            string                       `json:"id,omitempty"`
    Status        MassPaymentStatus            `json:"status,omitempty"`
    Items         []MassPaymentItem            `json:"items,omitempty"`
    Embedded      map[string][]MassPaymentItem `json:"_embedded,omitempty"`
    Created       string                       `json:"created,omitempty"`
    MetaData      MetaData                     `json:"metadata,omitempty"`
    Total         Amount                       `json:"total,omitempty"`
    TotalFees     Amount                       `json:"totalFees,omitempty"`
    CorrelationID string                       `json:"correlationId,omitempty"`
}

MassPayment is a dwolla mass payment

func (*MassPayment) ListItems Uses

func (m *MassPayment) ListItems(ctx context.Context, params *url.Values) (*MassPaymentItems, error)

ListItems returns a collection of items for the mass payment

see: https://docsv2.dwolla.com/#list-items-for-a-mass-payment

func (*MassPayment) RetrieveItem Uses

func (m *MassPayment) RetrieveItem(ctx context.Context, id string) (*MassPaymentItem, error)

RetrieveItem returns a mass payment item matching id

see: https://docsv2.dwolla.com/#retrieve-a-mass-payment-item

func (*MassPayment) RetrieveSource Uses

func (m *MassPayment) RetrieveSource(ctx context.Context) (*FundingSource, error)

RetrieveSource retrieves the mass payment funding source

type MassPaymentItem Uses

type MassPaymentItem struct {
    Resource
    ID            string                `json:"id,omitempty"`
    Status        MassPaymentItemStatus `json:"status,omitempty"`
    Amount        Amount                `json:"amount,omitempty"`
    MetaData      MetaData              `json:"metadata,omitempty"`
    CorrelationID string                `json:"correlationId,omitempty"`
    Embedded      HALErrors             `json:"_embedded,omitempty"`
}

MassPaymentItem is a dwolla mass payment item

func (*MassPaymentItem) RetrieveDestination Uses

func (m *MassPaymentItem) RetrieveDestination(ctx context.Context) (*Customer, error)

RetrieveDestination retrieves the destination for the item

func (*MassPaymentItem) RetrieveMassPayment Uses

func (m *MassPaymentItem) RetrieveMassPayment(ctx context.Context) (*MassPayment, error)

RetrieveMassPayment retrieves the mass payment for the item

func (*MassPaymentItem) RetrieveTransfer Uses

func (m *MassPaymentItem) RetrieveTransfer(ctx context.Context) (*Transfer, error)

RetrieveTransfer retrieves the transfer for the item

type MassPaymentItemStatus Uses

type MassPaymentItemStatus string

MassPaymentItemStatus is a mass payment item status

const (
    // MassPaymentItemStatusPending is when a mass payment item is pending
    MassPaymentItemStatusPending MassPaymentItemStatus = "pending"
    // MassPaymentItemStatusSuccess is when amass payment item is successful
    MassPaymentItemStatusSuccess MassPaymentItemStatus = "success"
    // MassPaymentItemStatusFailed is when a mass payment item failed
    MassPaymentItemStatusFailed MassPaymentItemStatus = "failed"
)

type MassPaymentItems Uses

type MassPaymentItems struct {
    Collection
    Embedded map[string][]MassPaymentItem `json:"_embedded"`
    Total    int                          `json:"total"`
}

MassPaymentItems is a collection of mass payment items

type MassPaymentService Uses

type MassPaymentService interface {
    Create(context.Context, *MassPayment) (*MassPayment, error)
    Retrieve(context.Context, string) (*MassPayment, error)
    Update(context.Context, string, MassPaymentStatus) (*MassPayment, error)
}

MassPaymentService is the mass payment service interface

see: https://docsv2.dwolla.com/#mass-payments

type MassPaymentServiceOp Uses

type MassPaymentServiceOp struct {
    // contains filtered or unexported fields
}

MassPaymentServiceOp is an implementation of the mass payment interface

func (*MassPaymentServiceOp) Create Uses

func (m *MassPaymentServiceOp) Create(ctx context.Context, body *MassPayment) (*MassPayment, error)

Create initiates a mass payment

see: https://docsv2.dwolla.com/#initiate-a-mass-payment

func (*MassPaymentServiceOp) Retrieve Uses

func (m *MassPaymentServiceOp) Retrieve(ctx context.Context, id string) (*MassPayment, error)

Retrieve retrieves the mass payment matching the id

see: https://docsv2.dwolla.com/#retrieve-a-mass-payment

func (*MassPaymentServiceOp) Update Uses

func (m *MassPaymentServiceOp) Update(ctx context.Context, id string, status MassPaymentStatus) (*MassPayment, error)

Update updates a mass payment's status

see: https://docsv2.dwolla.com/#update-a-mass-payment

type MassPaymentStatus Uses

type MassPaymentStatus string

MassPaymentStatus is a mass payment status

const (
    // MassPaymentStatusDeferred is when a mass payment is deferred
    MassPaymentStatusDeferred MassPaymentStatus = "deferred"
    // MassPaymentStatusPending is when the mass payment is pending
    MassPaymentStatusPending MassPaymentStatus = "pending"
    // MassPaymentStatusProcessing is when the mass payment is processing
    MassPaymentStatusProcessing MassPaymentStatus = "processing"
    // MassPaymentStatusComplete is when the mass payment is complete
    MassPaymentStatusComplete MassPaymentStatus = "complete"
    // MassPaymentStatusCancelled is when the mass payment is cancelled
    MassPaymentStatusCancelled MassPaymentStatus = "cancelled"
)

type MassPayments Uses

type MassPayments struct {
    Collection
    Embedded map[string][]MassPayment `json:"_embedded"`
}

MassPayments is a collection of mass payments

type MetaData Uses

type MetaData map[string]interface{}

MetaData represents key/value meta data

type MicroDeposit Uses

type MicroDeposit struct {
    Resource
    Created string              `json:"created"`
    Status  MicroDepositStatus  `json:"status"`
    Failure MicroDepositFailure `json:"failure"`
}

MicroDeposit is a dwolla micro deposit

type MicroDepositFailure Uses

type MicroDepositFailure struct {
    Code        string `json:"code"`
    Description string `json:"description"`
}

MicroDepositFailure is detail about a micro deposit failure

type MicroDepositRequest Uses

type MicroDepositRequest struct {
    Amount1 Amount `json:"amount1,omitempty"`
    Amount2 Amount `json:"amount2,omitempty"`
}

MicroDepositRequest is a micro deposit verification request

type MicroDepositStatus Uses

type MicroDepositStatus string

MicroDepositStatus is the status of the micro deposit

const (
    // MicroDepositStatusPending is when the micro deposit is pending
    // processing
    MicroDepositStatusPending MicroDepositStatus = "pending"
    // MicroDepositStatusProcessed is when the micro deposit is processed
    MicroDepositStatusProcessed MicroDepositStatus = "processed"
)

type OnDemandAuthorization Uses

type OnDemandAuthorization struct {
    Resource
    BodyText   string `json:"bodyText"`
    ButtonText string `json:"buttonText"`
}

OnDemandAuthorization is a dwolla on-demand transfer authorization

type OnDemandAuthorizationService Uses

type OnDemandAuthorizationService interface {
    Create(context.Context) (*OnDemandAuthorization, error)
    Retrieve(context.Context, string) (*OnDemandAuthorization, error)
}

OnDemandAuthorizationService is the on-demand authorization interface

see: https://docsv2.dwolla.com/#create-an-on-demand-transfer-authorization

type OnDemandAuthorizationServiceOp Uses

type OnDemandAuthorizationServiceOp struct {
    // contains filtered or unexported fields
}

OnDemandAuthorizationServiceOp is an implementation of the on-demand authorization interface

func (*OnDemandAuthorizationServiceOp) Create Uses

func (o *OnDemandAuthorizationServiceOp) Create(ctx context.Context) (*OnDemandAuthorization, error)

Create creates an on-demand transfer authorization

func (*OnDemandAuthorizationServiceOp) Retrieve Uses

func (o *OnDemandAuthorizationServiceOp) Retrieve(ctx context.Context, id string) (*OnDemandAuthorization, error)

Retrieve returns a on-demand authorization matching the id

type Passport Uses

type Passport struct {
    Number  string `json:"number"`
    Country string `json:"country"`
}

Passport represents a passport

type Resource Uses

type Resource struct {
    Links Links `json:"_links,omitempty"`
    // contains filtered or unexported fields
}

Resource is a hal resource

func NewResource Uses

func NewResource(links Links, client *Client) *Resource

NewResource is constructor for Resource

type Token Uses

type Token struct {
    AccessToken      string `json:"access_token"`
    ExpiresIn        int    `json:"expires_in"`
    TokenType        string `json:"token_type"`
    Error            string `json:"error"`
    ErrorDescription string `json:"error_description"`
    // contains filtered or unexported fields
}

Token is a dwolla auth token

func (*Token) Expired Uses

func (t *Token) Expired() bool

Expired returns true if token has expired

type Transfer Uses

type Transfer struct {
    Resource
    ID              string           `json:"id"`
    Status          TransferStatus   `json:"status"`
    Amount          Amount           `json:"amount"`
    Created         string           `json:"created"`
    MetaData        MetaData         `json:"metadata"`
    Clearing        TransferClearing `json:"clearing"`
    CorrelationID   string           `json:"correlationId"`
    IndividualACHID string           `json:"individualAchId"`
}

Transfer is a dwolla transfer

func (*Transfer) Cancel Uses

func (t *Transfer) Cancel(ctx context.Context) error

Cancel cancels the transfer

see: https://docsv2.dwolla.com/#cancel-a-transfer

func (*Transfer) Destination Uses

func (t *Transfer) Destination(ctx context.Context) (*Customer, error)

Destination returns the customer transfer destination

func (*Transfer) DestinationFundingSource Uses

func (t *Transfer) DestinationFundingSource(ctx context.Context) (*FundingSource, error)

DestinationFundingSource returns the transfer funding source destination

func (Transfer) DestinationFundingSourceString Uses

func (t Transfer) DestinationFundingSourceString() string

DestinationFundingSourceString returns the funding source destination id

func (Transfer) DestinationString Uses

func (t Transfer) DestinationString() string

DestinationString returns the customer transfer destination id

func (*Transfer) ListFees Uses

func (t *Transfer) ListFees(ctx context.Context) (*TransferFees, error)

ListFees returns the fees associated with the transfer

see: https://docsv2.dwolla.com/#list-fees-for-a-transfer

func (*Transfer) RetrieveFailureReason Uses

func (t *Transfer) RetrieveFailureReason(ctx context.Context) (*TransferFailureReason, error)

RetrieveFailureReason returns the transfer's failure reason

see: https://docsv2.dwolla.com/#retrieve-a-transfer-failure-reason

func (*Transfer) Source Uses

func (t *Transfer) Source(ctx context.Context) (*Customer, error)

Source returns the customer transfer source

func (*Transfer) SourceFundingSource Uses

func (t *Transfer) SourceFundingSource(ctx context.Context) (*FundingSource, error)

SourceFundingSource returns the transfer funding source

func (Transfer) SourceFundingSourceString Uses

func (t Transfer) SourceFundingSourceString() string

SourceFundingSourceString returns the transfer funding source

func (Transfer) SourceString Uses

func (t Transfer) SourceString() string

SourceString returns the customer transfer source id

type TransferACHDetails Uses

type TransferACHDetails struct {
    Destination TransferAddenda `json:"destination,omitempty"`
    Source      TransferAddenda `json:"source,omitempty"`
}

TransferACHDetails contains data sent to the bank account

type TransferAddenda Uses

type TransferAddenda struct {
    Addenda TransferAddendaValues `json:"addenda,omitempty"`
}

TransferAddenda is a transfer addenda

type TransferAddendaValues Uses

type TransferAddendaValues struct {
    Values []string `json:"values,omitempty"`
}

TransferAddendaValues is the addenda values

type TransferClearing Uses

type TransferClearing struct {
    Destination string `json:"destination,omitempty"`
    Source      string `json:"source,omitempty"`
}

TransferClearing is a transfer clearing schedule

type TransferFailure Uses

type TransferFailure struct {
    Resource
    Code        TransferFailureCode `json:"code"`
    Description string              `json:"description"`
    Explanation string              `json:"explanation"`
}

TransferFailure is a dwolla transfer

type TransferFailureCode Uses

type TransferFailureCode string
const (
    TransferFailureCodeInsufficientFunds                     TransferFailureCode = "R01"
    TransferFailureCodeBankAccountClosed                     TransferFailureCode = "R02"
    TransferFailureCodeNoAccount                             TransferFailureCode = "R03"
    TransferFailureCodeInvalidBankAccountNumberStructure     TransferFailureCode = "R04"
    TransferFailureCodeUnauthorizedDebitToConsumerAccount    TransferFailureCode = "R05"
    TransferFailureCodeReturnedPerODFIRequest                TransferFailureCode = "R06"
    TransferFailureCodeAuthorizationRevokedByCustomer        TransferFailureCode = "R07"
    TransferFailureCodePaymentStopped                        TransferFailureCode = "R08"
    TransferFailureCodeUncollectedFunds                      TransferFailureCode = "R09"
    TransferFailureCodeCustomerAdvisesNotAuthorized          TransferFailureCode = "R10"
    TransferFailureCodeBankAccountFrozen                     TransferFailureCode = "R16"
    TransferFailureCodeNonTransactionAccount                 TransferFailureCode = "R20"
    TransferFailureCodeCreditEntryRefusedByReceiver          TransferFailureCode = "R23"
    TransferFailureCodeCorporateCustomerAdvisesNotAuthorized TransferFailureCode = "R29"
)

type TransferFailureReason Uses

type TransferFailureReason struct {
    Resource
    Code        string `json:"code"`
    Description string `json:"description"`
}

TransferFailureReason contains details about a failed transfer

type TransferFailureService Uses

type TransferFailureService interface {
    Retrieve(ctx context.Context, transferID string) (*TransferFailure, error)
}

TransferFailureService is the transfer service interface

see: https://docsv2.dwolla.com/#transfers

type TransferFailureServiceOp Uses

type TransferFailureServiceOp struct {
    // contains filtered or unexported fields
}

TransferFailureServiceOp is an implementation of the transfer service interface

func (TransferFailureServiceOp) Retrieve Uses

func (t TransferFailureServiceOp) Retrieve(ctx context.Context, transferID string) (*TransferFailure, error)

type TransferFee Uses

type TransferFee struct {
    Resource
    Amount Amount `json:"amount"`
}

TransferFee is a transfer fee

type TransferFees Uses

type TransferFees struct {
    Transactions []Transfer `json:"transactions"`
    Total        int        `json:"total"`
}

TransferFees contains fees related to a transfer

type TransferRequest Uses

type TransferRequest struct {
    Resource
    Status         TransferStatus      `json:"status,omitempty"`
    Amount         Amount              `json:"amount,omitempty"`
    MetaData       MetaData            `json:"metadata,omitempty"`
    Fees           []TransferFee       `json:"fees,omitempty"`
    Clearing       TransferClearing    `json:"clearing,omitempty"`
    CorrelationID  string              `json:"correlationId,omitempty"`
    ACHDetails     *TransferACHDetails `json:"achDetails,omitempty"`
    IdempotencyKey string              `json:"-"`
}

TransferRequest is a transfer request

type TransferService Uses

type TransferService interface {
    Create(context.Context, *TransferRequest) (*Transfer, error)
    Retrieve(context.Context, string) (*Transfer, error)
}

TransferService is the transfer service interface

see: https://docsv2.dwolla.com/#transfers

type TransferServiceOp Uses

type TransferServiceOp struct {
    // contains filtered or unexported fields
}

TransferServiceOp is an implementation of the transfer service interface

func (*TransferServiceOp) Create Uses

func (t *TransferServiceOp) Create(ctx context.Context, body *TransferRequest) (*Transfer, error)

Create initiates a transfer

see: https://docsv2.dwolla.com/#initiate-a-transfer

func (*TransferServiceOp) Retrieve Uses

func (t *TransferServiceOp) Retrieve(ctx context.Context, id string) (*Transfer, error)

Retrieve returns the transfer matching the id

see: https://docsv2.dwolla.com/#retrieve-a-transfer

type TransferStatus Uses

type TransferStatus string

TransferStatus is a transfer's status

const (
    // TransferStatusCancelled is when the transfer has been cancelled
    TransferStatusCancelled TransferStatus = "cancelled"
    // TransferStatusFailed is when the transfer failed
    TransferStatusFailed TransferStatus = "failed"
    // TransferStatusPending is when the transfer is pending
    TransferStatusPending TransferStatus = "pending"
    // TransferStatusProcessed is when the transfer is processed
    TransferStatusProcessed TransferStatus = "processed"
    // TransferStatusReclaimed is when the transfer is reclaimed
    TransferStatusReclaimed TransferStatus = "reclaimed"
)

type Transfers Uses

type Transfers struct {
    Collection
    Embedded map[string][]Transfer `json:"_embedded"`
}

Transfers is a collection of dwolla transfers

type ValidationError Uses

type ValidationError struct {
    Code     string    `json:"code"`
    Message  string    `json:"message"`
    Path     string    `json:"path"`
    Embedded HALErrors `json:"_embedded"`
}

ValidationError is a dwolla validation error

func (ValidationError) Error Uses

func (v ValidationError) Error() string

Error implements the error interface

type Webhook Uses

type Webhook struct {
    Resource
    ID             string           `json:"id"`
    Topic          EventTopic       `json:"topic"`
    AccountID      string           `json:"accountId"`
    EventID        string           `json:"eventId"`
    SubscriptionID string           `json:"subscriptionId"`
    Attempts       []WebhookAttempt `json:"attempts"`
}

Webhook is a dwolla webhook

func (*Webhook) ListRetries Uses

func (w *Webhook) ListRetries(ctx context.Context) (*WebhookRetries, error)

ListRetries returns a collection of retries for this webhook

see: https://docsv2.dwolla.com/#list-retries-for-a-webhook

func (*Webhook) RetrieveEvent Uses

func (w *Webhook) RetrieveEvent(ctx context.Context) (*Event, error)

RetrieveEvent retrieves the event for the webhook

func (*Webhook) RetrieveWebhookSubscription Uses

func (w *Webhook) RetrieveWebhookSubscription(ctx context.Context) (*WebhookSubscription, error)

RetrieveWebhookSubscription returns the subscription for the webhoook

func (*Webhook) RetrieveWebhooks Uses

func (w *Webhook) RetrieveWebhooks(ctx context.Context) (*Webhooks, error)

RetrieveWebhooks returns webhooks for this webhook subscription

func (*Webhook) Retry Uses

func (w *Webhook) Retry(ctx context.Context) (*WebhookRetry, error)

Retry retries the webhook

see: https://docsv2.dwolla.com/#retry-a-webhook

type WebhookAttempt Uses

type WebhookAttempt struct {
    ID       string          `json:"id"`
    Request  WebhookRequest  `json:"request"`
    Response WebhookResponse `json:"response"`
}

WebhookAttempt is a webhook attempt

type WebhookHeader Uses

type WebhookHeader struct {
    Name  string `json:"name"`
    Value string `json:"value"`
}

WebhookHeader is a webhook request/response header

type WebhookRequest Uses

type WebhookRequest struct {
    Timestamp string          `json:"timestamp"`
    UrL       string          `json:"url"`
    Headers   []WebhookHeader `json:"headers"`
    Body      string          `json:"body"`
}

WebhookRequest is a webhook request

type WebhookResponse Uses

type WebhookResponse struct {
    Timestamp  string          `json:"timestamp"`
    Headers    []WebhookHeader `json:"headers"`
    StatusCode int             `json:"statusCode"`
    Body       string          `json:"body"`
}

WebhookResponse is a webhook response

type WebhookRetries Uses

type WebhookRetries struct {
    Collection
    Embedded map[string][]WebhookRetry `json:"_embedded"`
    Total    int                       `json:"total"`
}

WebhookRetries is a collection of webhook retries

type WebhookRetry Uses

type WebhookRetry struct {
    Resource
    ID        string `json:"id"`
    Timestamp string `json:"timestamp"`
}

WebhookRetry is a webhook retry

type WebhookService Uses

type WebhookService interface {
    Retrieve(context.Context, string) (*Webhook, error)
}

WebhookService is the webhook service interface

see: https://docsv2.dwolla.com/#webhooks

type WebhookServiceOp Uses

type WebhookServiceOp struct {
    // contains filtered or unexported fields
}

WebhookServiceOp is an implementation of the webhook service interface

func (*WebhookServiceOp) Retrieve Uses

func (w *WebhookServiceOp) Retrieve(ctx context.Context, id string) (*Webhook, error)

Retrieve retrieves the webhook with matching id

see: https://docsv2.dwolla.com/#retrieve-a-webhook

type WebhookSubscription Uses

type WebhookSubscription struct {
    Resource
    ID      string `json:"id"`
    URL     string `json:"url"`
    Created string `json:"created"`
}

WebhookSubscription is a webhook subscription

func (*WebhookSubscription) Pause Uses

func (w *WebhookSubscription) Pause(ctx context.Context) error

Pause pauses the webhook subscription

func (*WebhookSubscription) Remove Uses

func (w *WebhookSubscription) Remove(ctx context.Context) error

Remove removes the webhook subscription

func (*WebhookSubscription) Unpause Uses

func (w *WebhookSubscription) Unpause(ctx context.Context) error

Unpause unpauses the webhook subscription

type WebhookSubscriptionRequest Uses

type WebhookSubscriptionRequest struct {
    URL    string `json:"url,omitempty"`
    Secret string `json:"secret,omitempty"`
    Paused bool   `json:"paused"`
}

WebhookSubscriptionRequest is a webhook subscription request

type WebhookSubscriptionService Uses

type WebhookSubscriptionService interface {
    Create(context.Context, *WebhookSubscriptionRequest) (*WebhookSubscription, error)
    Retrieve(context.Context, string) (*WebhookSubscription, error)
    List(context.Context) (*WebhookSubscriptions, error)
    Remove(context.Context, string) error
}

WebhookSubscriptionService is the webhook subscription service interface

see: https://docsv2.dwolla.com/#webhook-subscriptions

type WebhookSubscriptionServiceOp Uses

type WebhookSubscriptionServiceOp struct {
    // contains filtered or unexported fields
}

WebhookSubscriptionServiceOp is an implementation of the webhook subscription service interface

func (*WebhookSubscriptionServiceOp) Create Uses

func (w *WebhookSubscriptionServiceOp) Create(ctx context.Context, body *WebhookSubscriptionRequest) (*WebhookSubscription, error)

Create creates a webhook subscription

func (*WebhookSubscriptionServiceOp) List Uses

func (w *WebhookSubscriptionServiceOp) List(ctx context.Context) (*WebhookSubscriptions, error)

List returns a list of webhook subscriptions

func (*WebhookSubscriptionServiceOp) Remove Uses

func (w *WebhookSubscriptionServiceOp) Remove(ctx context.Context, id string) error

Remove removes the webhook subscription matching the id

func (*WebhookSubscriptionServiceOp) Retrieve Uses

func (w *WebhookSubscriptionServiceOp) Retrieve(ctx context.Context, id string) (*WebhookSubscription, error)

Retrieve retrieves the webhook subscription matching id

type WebhookSubscriptions Uses

type WebhookSubscriptions struct {
    Collection
    Embedded map[string][]WebhookSubscription `json:"_embedded"`
    Total    int                              `json:"total"`
}

WebhookSubscriptions is a collection of webhook subscriptions

type Webhooks Uses

type Webhooks struct {
    Collection
    Embedded map[string][]Webhook `json:"_embedded"`
    Total    int                  `json:"total"`
}

Webhooks is a collection of webhooks

Package dwolla imports 14 packages (graph). Updated 2020-03-31. Refresh now. Tools for package owners.