Documentation
¶
Index ¶
- Constants
- Variables
- func IDFromHREF(href string) (string, error)
- func Unmarshal(data []byte, container interface{}) error
- type ACHDetails
- type Account
- func (a *Account) CreateFundingSource(ctx context.Context, body *FundingSourceRequest) (*FundingSource, error)
- func (a *Account) ListFundingSources(ctx context.Context, removed *bool) (*FundingSources, error)
- func (a *Account) ListMassPayments(ctx context.Context, params *url.Values) (*MassPayments, error)
- func (a *Account) ListTransfers(ctx context.Context, params *url.Values) (*Transfers, error)
- type AccountService
- type AccountServiceOp
- type Addenda
- type AddendaValues
- type Address
- type Amount
- type BeneficialOwner
- func (b *BeneficialOwner) CreateDocument(ctx context.Context, body *DocumentRequest) (*Document, error)
- func (b *BeneficialOwner) ListDocuments(ctx context.Context) (*Documents, error)
- func (b *BeneficialOwner) Remove(ctx context.Context) error
- func (b *BeneficialOwner) Update(ctx context.Context, body *BeneficialOwnerRequest) error
- type BeneficialOwnerRequest
- type BeneficialOwnerService
- type BeneficialOwnerServiceOp
- func (b *BeneficialOwnerServiceOp) Remove(ctx context.Context, id string) error
- func (b *BeneficialOwnerServiceOp) Retrieve(ctx context.Context, id string) (*BeneficialOwner, error)
- func (b *BeneficialOwnerServiceOp) Update(ctx context.Context, id string, body *BeneficialOwnerRequest) (*BeneficialOwner, error)
- type BeneficialOwnerStatus
- type BeneficialOwners
- type BeneficialOwnership
- type BeneficialOwnershipRequest
- type BusinessClassification
- type BusinessClassificationService
- type BusinessClassificationServiceOp
- type BusinessClassifications
- type CertificationStatus
- type Clearing
- type Client
- func (c Client) APIURL() string
- func (c Client) AuthURL() string
- func (c Client) BuildAPIURL(path string) string
- func (c *Client) CreateClientToken(ctx context.Context, action string, customer *Customer) (*ClientToken, error)
- func (c *Client) Delete(ctx context.Context, path string, params *url.Values, headers *http.Header) error
- func (c *Client) EnsureToken(ctx context.Context) error
- func (c *Client) Get(ctx context.Context, path string, params *url.Values, headers *http.Header, ...) error
- func (c *Client) Post(ctx context.Context, path string, body interface{}, headers *http.Header, ...) error
- func (c *Client) RequestToken(ctx context.Context) error
- func (c *Client) Root(ctx context.Context) (*Resource, error)
- func (c *Client) SandboxSimulations(ctx context.Context) error
- func (c Client) TokenURL() string
- func (c *Client) Upload(ctx context.Context, path string, documentType DocumentType, fileName string, ...) error
- type ClientToken
- type ClientTokenRequest
- type Collection
- type Controller
- type ControllerRequest
- type Currency
- type Customer
- func (c *Customer) CertifyBeneficialOwnership(ctx context.Context) error
- func (c *Customer) CreateBeneficialOwner(ctx context.Context, body *BeneficialOwnerRequest) (*BeneficialOwner, error)
- func (c *Customer) CreateDocument(ctx context.Context, body *DocumentRequest) (*Document, error)
- func (c *Customer) CreateFundingSource(ctx context.Context, body *FundingSourceRequest) (*FundingSource, error)
- func (c *Customer) CreateFundingSourceToken(ctx context.Context) (*FundingSourceToken, error)
- func (c Customer) CreatedTime() time.Time
- func (c *Customer) Deactivate(ctx context.Context) error
- func (c *Customer) InitiateKBA(ctx context.Context) (*KBA, error)
- func (c *Customer) ListBeneficialOwners(ctx context.Context) (*BeneficialOwners, error)
- func (c *Customer) ListDocuments(ctx context.Context) (*Documents, error)
- func (c *Customer) ListFundingSources(ctx context.Context, removed *bool) (*FundingSources, error)
- func (c *Customer) ListMassPayments(ctx context.Context, params *url.Values) (*MassPayments, error)
- func (c *Customer) ListTransfers(ctx context.Context, params *url.Values) (*Transfers, error)
- func (c *Customer) Reactivate(ctx context.Context) error
- func (c *Customer) Receive() bool
- func (c *Customer) RetrieveBeneficialOwnership(ctx context.Context) (*BeneficialOwnership, error)
- func (c *Customer) RetrieveIAVToken(ctx context.Context) (*IAVToken, error)
- func (c *Customer) RetryVerification() bool
- func (c *Customer) Send() bool
- func (c *Customer) Suspend(ctx context.Context) error
- func (c *Customer) Update(ctx context.Context, body *CustomerRequest) error
- func (c *Customer) VerifyBeneficialOwners() bool
- func (c *Customer) VerifyBusiness() bool
- func (c *Customer) VerifyController() bool
- func (c *Customer) VerifyControllerAndBusiness() bool
- type CustomerRequest
- type CustomerService
- type CustomerServiceOp
- func (c *CustomerServiceOp) Create(ctx context.Context, body *CustomerRequest) (*Customer, error)
- func (c *CustomerServiceOp) List(ctx context.Context, params *url.Values) (*Customers, error)
- func (c *CustomerServiceOp) Retrieve(ctx context.Context, id string) (*Customer, error)
- func (c *CustomerServiceOp) Update(ctx context.Context, id string, body *CustomerRequest) (*Customer, error)
- type CustomerStatus
- type CustomerType
- type Customers
- type Document
- type DocumentFailureReason
- type DocumentRequest
- type DocumentService
- type DocumentServiceOp
- type DocumentStatus
- type DocumentType
- type Documents
- type Embedded
- type Environment
- type Event
- type EventService
- type EventServiceOp
- type EventTopic
- type Events
- type FundingSource
- func (f *FundingSource) CreatedTime() time.Time
- func (f *FundingSource) Customer(ctx context.Context) (*Customer, error)
- func (f *FundingSource) FailedVerificationMicroDeposits() bool
- func (f *FundingSource) InitiateMicroDeposits(ctx context.Context, idempotencyKey string) (*MicroDeposit, error)
- func (f *FundingSource) Remove(ctx context.Context) error
- func (f *FundingSource) RetrieveBalance(ctx context.Context) (*FundingSourceBalance, error)
- func (f *FundingSource) RetrieveMicroDeposits(ctx context.Context) (*MicroDeposit, error)
- func (f *FundingSource) TransferFromBalance() bool
- func (f *FundingSource) TransferReceive() bool
- func (f *FundingSource) TransferSend() bool
- func (f *FundingSource) TransferToBalance() bool
- func (f *FundingSource) Update(ctx context.Context, body *FundingSourceRequest) error
- func (f *FundingSource) VerifyMicroDeposits(ctx context.Context, body *MicroDepositRequest) error
- type FundingSourceBalance
- type FundingSourceBankAccountType
- type FundingSourceRequest
- type FundingSourceService
- type FundingSourceServiceOp
- type FundingSourceStatus
- type FundingSourceToken
- type FundingSourceType
- type FundingSources
- type HALError
- type HALErrors
- type HTTPClient
- type IAVToken
- type IndustryClassification
- type KBA
- type KBAAnswer
- type KBAQuestion
- type KBAQuestionAnswer
- type KBARequest
- type KBAService
- type KBAServiceOp
- type Link
- type Links
- type MassPayment
- type MassPaymentItem
- type MassPaymentItemStatus
- type MassPaymentItems
- type MassPaymentService
- type MassPaymentServiceOp
- func (m *MassPaymentServiceOp) Create(ctx context.Context, body *MassPayment) (*MassPayment, error)
- func (m *MassPaymentServiceOp) Retrieve(ctx context.Context, id string) (*MassPayment, error)
- func (m *MassPaymentServiceOp) Update(ctx context.Context, id string, status MassPaymentStatus) (*MassPayment, error)
- type MassPaymentStatus
- type MassPayments
- type MetaData
- type MicroDeposit
- type MicroDepositFailure
- type MicroDepositRequest
- type MicroDepositStatus
- type OnDemandAuthorization
- type OnDemandAuthorizationService
- type OnDemandAuthorizationServiceOp
- type Passport
- type Resource
- type Token
- type Transfer
- func (t *Transfer) Cancel(ctx context.Context) error
- func (t *Transfer) CreatedTime() time.Time
- func (t *Transfer) Destination(ctx context.Context) (*Customer, error)
- func (t *Transfer) DestinationFundingSource(ctx context.Context) (*FundingSource, error)
- func (t Transfer) DestinationFundingSourceString() string
- func (t Transfer) DestinationString() string
- func (t *Transfer) ListFees(ctx context.Context) (*TransferFees, error)
- func (t *Transfer) RetrieveFailureReason(ctx context.Context) (*TransferFailure, error)
- func (t *Transfer) Source(ctx context.Context) (*Customer, error)
- func (t *Transfer) SourceFundingSource(ctx context.Context) (*FundingSource, error)
- func (t Transfer) SourceFundingSourceString() string
- func (t Transfer) SourceString() string
- type TransferACHDetails
- type TransferAddenda
- type TransferAddendaValues
- type TransferClearing
- type TransferFailure
- type TransferFailureCode
- type TransferFailureService
- type TransferFailureServiceOp
- type TransferFee
- type TransferFees
- type TransferRequest
- type TransferService
- type TransferServiceOp
- type TransferStatus
- type Transfers
- type ValidationError
- type Webhook
- func (w *Webhook) ListRetries(ctx context.Context) (*WebhookRetries, error)
- func (w *Webhook) RetrieveEvent(ctx context.Context) (*Event, error)
- func (w *Webhook) RetrieveWebhookSubscription(ctx context.Context) (*WebhookSubscription, error)
- func (w *Webhook) RetrieveWebhooks(ctx context.Context) (*Webhooks, error)
- func (w *Webhook) Retry(ctx context.Context) (*WebhookRetry, error)
- type WebhookAttempt
- type WebhookHeader
- type WebhookRequest
- type WebhookResponse
- type WebhookRetries
- type WebhookRetry
- type WebhookService
- type WebhookServiceOp
- type WebhookSubscription
- type WebhookSubscriptionRequest
- type WebhookSubscriptionService
- type WebhookSubscriptionServiceOp
- func (w *WebhookSubscriptionServiceOp) Create(ctx context.Context, body *WebhookSubscriptionRequest) (*WebhookSubscription, error)
- func (w *WebhookSubscriptionServiceOp) List(ctx context.Context) (*WebhookSubscriptions, error)
- func (w *WebhookSubscriptionServiceOp) Remove(ctx context.Context, id string) error
- func (w *WebhookSubscriptionServiceOp) Retrieve(ctx context.Context, id string) (*WebhookSubscription, error)
- type WebhookSubscriptions
- type Webhooks
Constants ¶
const ( // Version is the version of the client Version string = "0.1.0" HeaderIdempotency = "Idempotency-Key" // 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" // #nosec G101 // 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" // #nosec G101 )
Variables ¶
var ErrNoID = errors.New("unable to extract ID")
Functions ¶
func IDFromHREF ¶
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.
Types ¶
type ACHDetails ¶
type ACHDetails struct { Destination Addenda `json:"destination,omitempty"` Source Addenda `json:"source,omitempty"` }
ACHDetails contains data sent to the bank account
type Account ¶
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 ¶
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 ¶
ListFundingSources returns the account's funding sources
see: https://developers.dwolla.com/api-reference/accounts/list-funding-sources
func (*Account) ListMassPayments ¶
ListMassPayments returns mass payments for the account
see: https://docsv2.dwolla.com/#list-mass-payments-for-an-account
func (*Account) ListTransfers ¶
ListTransfers returns the account's transfers
see: https://docsv2.dwolla.com/#list-and-search-transfers-for-an-account
type AccountService ¶
AccountService is the account service interface
type AccountServiceOp ¶
type AccountServiceOp struct {
// contains filtered or unexported fields
}
AccountServiceOp is an implementation of the account service interface
type Addenda ¶
type Addenda struct {
Addenda TransferAddendaValues `json:"addenda,omitempty"`
}
Addenda is a transfer addenda
type AddendaValues ¶
type AddendaValues struct {
Values []string `json:"values,omitempty"`
}
AddendaValues is the addenda values
type Address ¶
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 BeneficialOwner ¶
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 ¶
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 ¶
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 ¶
func (b *BeneficialOwner) Remove(ctx context.Context) error
Remove removes the beneficial owner
func (*BeneficialOwner) Update ¶
func (b *BeneficialOwner) Update(ctx context.Context, body *BeneficialOwnerRequest) error
Update updates the dwolla beneficial owner
type BeneficialOwnerRequest ¶
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 ¶
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
type BeneficialOwnerServiceOp ¶
type BeneficialOwnerServiceOp struct {
// contains filtered or unexported fields
}
BeneficialOwnerServiceOp is an implementation of the beneficial owner service
func (*BeneficialOwnerServiceOp) Remove ¶
func (b *BeneficialOwnerServiceOp) Remove(ctx context.Context, id string) error
Remove removes a beneficial owner matching the id
func (*BeneficialOwnerServiceOp) Retrieve ¶
func (b *BeneficialOwnerServiceOp) Retrieve(ctx context.Context, id string) (*BeneficialOwner, error)
Retrieve retrieves a beneficial owner matching the id
func (*BeneficialOwnerServiceOp) Update ¶
func (b *BeneficialOwnerServiceOp) Update(ctx context.Context, id string, body *BeneficialOwnerRequest) (*BeneficialOwner, error)
Update updates a beneficial owner matching the id
type BeneficialOwnerStatus ¶
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 ¶
type BeneficialOwners struct { Collection Embedded map[string][]BeneficialOwner `json:"_embedded"` }
BeneficialOwners is a collection of beneficial owners
type BeneficialOwnership ¶
type BeneficialOwnership struct { Resource Status CertificationStatus `json:"status"` }
BeneficialOwnership is the beneficial ownership status
func (*BeneficialOwnership) Certify ¶
func (b *BeneficialOwnership) Certify(ctx context.Context) error
Certify certifies beneficial ownership
see: https://docsv2.dwolla.com/#certify-beneficial-ownership
type BeneficialOwnershipRequest ¶
type BeneficialOwnershipRequest struct {
Status CertificationStatus `json:"status,omitempty"`
}
BeneficialOwnershipRequest is a beneficial ownership request
type BusinessClassification ¶
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 ¶
type BusinessClassificationService interface { Retrieve(context.Context, string) (*BusinessClassification, error) List(context.Context, *url.Values) (*BusinessClassifications, error) }
BusinessClassificationService is the business classification interface
type BusinessClassificationServiceOp ¶
type BusinessClassificationServiceOp struct {
// contains filtered or unexported fields
}
BusinessClassificationServiceOp is an implementation of the business classification interface
func (*BusinessClassificationServiceOp) List ¶
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 ¶
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 ¶
type BusinessClassifications struct { Collection Embedded map[string][]BusinessClassification `json:"_embedded"` }
BusinessClassifications is a business classification
type CertificationStatus ¶
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 Clearing ¶
type Clearing struct { Destination string `json:"destination,omitempty"` Source string `json:"source,omitempty"` }
Clearing is a transfer clearing schedule
type Client ¶
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 KBA KBAService MassPayment MassPaymentService OnDemandAuthorization OnDemandAuthorizationService Transfer TransferService TransferFailure *TransferFailureServiceOp Webhook WebhookService WebhookSubscription WebhookSubscriptionService // contains filtered or unexported fields }
Client is the dwolla client
func New ¶
func New(key, secret string, environment Environment) *Client
New initializes a new dwolla client
func NewWithHTTPClient ¶
func NewWithHTTPClient(key, secret string, environment Environment, httpClient HTTPClient) *Client
NewWithHTTPClient initializes the client with specified http client
func (Client) BuildAPIURL ¶
BuildAPIURL builds an api url with a given path
func (*Client) CreateClientToken ¶
func (c *Client) CreateClientToken(ctx context.Context, action string, customer *Customer) (*ClientToken, error)
CreateClientToken creates a general use client token
func (*Client) Delete ¶
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 ¶
EnsureToken ensures that a token exists for a request
func (*Client) Get ¶
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 ¶
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 ¶
RequestToken requests a new auth token using client credentials
See: https://developers.dwolla.com/api-reference/authorization/application-authorization
func (*Client) SandboxSimulations ¶
SandboxSimulations simulates events within the sandbox environment
see: https://developers.dwolla.com/resources/testing.html#simulate-bank-transfer-processing
type ClientToken ¶
type ClientToken struct {
Token string `json:"token"`
}
ClientToken is a general use client token
type ClientTokenRequest ¶
ClientTokenRequest is a client token request
type Collection ¶
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 ¶
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 ¶
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 ¶
type Currency string
Currency represents the monetary currency
const ( // USD is U.S. dollars USD Currency = "usd" )
type Customer ¶
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"` // ISO-8601 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"` BusinessType string `json:"businessType"` CorrelationID string `json:"correlationId"` Controller Controller `json:"controller"` }
Customer is a dwolla customer
func (*Customer) CertifyBeneficialOwnership ¶
CertifyBeneficialOwnership certifies beneficial ownership
see: https://docsv2.dwolla.com/#certify-beneficial-ownership
func (*Customer) CreateBeneficialOwner ¶
func (c *Customer) CreateBeneficialOwner(ctx context.Context, body *BeneficialOwnerRequest) (*BeneficialOwner, error)
CreateBeneficialOwner creates a beneficial owner for the customer
func (*Customer) CreateDocument ¶
CreateDocument uploads a verification document for the customer
func (*Customer) CreateFundingSource ¶
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) CreateFundingSourceToken ¶
func (c *Customer) CreateFundingSourceToken(ctx context.Context) (*FundingSourceToken, error)
CreateFundingSourceToken creates a funding source dwolla.js token
see: https://docs.dwolla.com/#create-a-funding-sources-token-for-dwolla-js
func (Customer) CreatedTime ¶
CreatedTime returns the created value as time.Time
func (*Customer) Deactivate ¶
Deactivate deactivates a dwolla customer
func (*Customer) InitiateKBA ¶
InitiateKBA initiates a knowledge based authentication session
func (*Customer) ListBeneficialOwners ¶
func (c *Customer) ListBeneficialOwners(ctx context.Context) (*BeneficialOwners, error)
ListBeneficialOwners returns the customer's beneficial owners
func (*Customer) ListDocuments ¶
ListDocuments returns documents for customer
func (*Customer) ListFundingSources ¶
ListFundingSources returns the customer's funding sources
see: https://developers.dwolla.com/api-reference/funding-sources/list-funding-sources-for-a-customer
func (*Customer) ListMassPayments ¶
ListMassPayments returns the customer's mass payments
see: https://docsv2.dwolla.com/#list-mass-payments-for-a-customer
func (*Customer) ListTransfers ¶
ListTransfers returns the customer's transfers
see: https://docsv2.dwolla.com/#list-and-search-transfers-for-a-customer
func (*Customer) Reactivate ¶
Reactivate reactivates a deactivated dwolla customer
func (*Customer) RetrieveBeneficialOwnership ¶
func (c *Customer) RetrieveBeneficialOwnership(ctx context.Context) (*BeneficialOwnership, error)
RetrieveBeneficialOwnership retrieves the customer's beneficial ownership status
func (*Customer) RetrieveIAVToken ¶
RetrieveIAVToken retrieves an instant account activation token
func (*Customer) RetryVerification ¶
RetryVerification returns true if customer needs to retry verification
func (*Customer) Update ¶
func (c *Customer) Update(ctx context.Context, body *CustomerRequest) error
Update updates a dwolla customer
func (*Customer) VerifyBeneficialOwners ¶
VerifyBeneficialOwners returns true if beneficial owners needed
func (*Customer) VerifyBusiness ¶
VerifyBusiness returns true if business needs verification document
func (*Customer) VerifyController ¶
VerifyController returns true if controller needs verification document
func (*Customer) VerifyControllerAndBusiness ¶
VerifyControllerAndBusiness returns true if controller and business need verification document
type CustomerRequest ¶
type CustomerRequest struct { FirstName string `json:"firstName,omitempty"` LastName string `json:"lastName,omitempty"` Email string `json:"email,omitempty"` IPAddress string `json:"ipAddress,omitempty"` CorrelationID string `json:"correlationId,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"` IdempotencyKey string `json:"-"` }
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 ¶
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 customer service interface
type CustomerServiceOp ¶
type CustomerServiceOp struct {
// contains filtered or unexported fields
}
CustomerServiceOp is an implementation of the customer service interface
func (*CustomerServiceOp) Create ¶
func (c *CustomerServiceOp) Create(ctx context.Context, body *CustomerRequest) (*Customer, error)
Create creates a dwolla customer
func (*CustomerServiceOp) Update ¶
func (c *CustomerServiceOp) Update(ctx context.Context, id string, body *CustomerRequest) (*Customer, error)
Update updates a dwolla customer matching the id
type CustomerStatus ¶
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 ¶
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 ¶
type Customers struct { Collection Embedded map[string][]Customer `json:"_embedded"` }
Customers is a collection of customers
type Document ¶
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 ¶
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 ¶
type DocumentRequest struct { Type DocumentType FileName string File io.Reader }
DocumentRequest is a verification document request
type DocumentService ¶
DocumentService is the document service interface
type DocumentServiceOp ¶
type DocumentServiceOp struct {
// contains filtered or unexported fields
}
DocumentServiceOp is an implementation of the document service
type DocumentStatus ¶
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 ¶
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 ¶
type Documents struct { Collection Embedded map[string][]Document `json:"_embedded"` }
Documents is a collection of dwolla documents
type Environment ¶
type Environment string
Environment is a supported dwolla environment. e.g. sandbox, production, https://api-sandbox.dwolla.com
type Event ¶
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 ¶
type EventService interface { List(context.Context, *url.Values) (*Events, error) Retrieve(context.Context, string) (*Event, error) }
EventService is the event service interface
type EventServiceOp ¶
type EventServiceOp struct {
// contains filtered or unexported fields
}
EventServiceOp is an implementation of the event service interface
type Events ¶
type Events struct { Collection Embedded map[string][]Event `json:"_embedded"` // contains filtered or unexported fields }
Events is a collection of dwolla events
type FundingSource ¶
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) CreatedTime ¶ added in v0.1.2
func (f *FundingSource) CreatedTime() time.Time
CreatedTime returns the created value as time.Time
func (*FundingSource) Customer ¶
func (f *FundingSource) Customer(ctx context.Context) (*Customer, error)
Customer returns the funding source's customer
func (*FundingSource) FailedVerificationMicroDeposits ¶
func (f *FundingSource) FailedVerificationMicroDeposits() bool
FailedVerificationMicroDeposits returns true if micro deposit verificationfailed
func (*FundingSource) InitiateMicroDeposits ¶
func (f *FundingSource) InitiateMicroDeposits(ctx context.Context, idempotencyKey string) (*MicroDeposit, error)
InitiateMicroDeposits initiates micro deposit verification
func (*FundingSource) Remove ¶
func (f *FundingSource) Remove(ctx context.Context) error
Remove removes the funding source
func (*FundingSource) RetrieveBalance ¶
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 ¶
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 ¶
func (f *FundingSource) TransferFromBalance() bool
TransferFromBalance returns true if funding source can transfer from balance
func (*FundingSource) TransferReceive ¶
func (f *FundingSource) TransferReceive() bool
TransferReceive returns true if funding source can receive transfers
func (*FundingSource) TransferSend ¶
func (f *FundingSource) TransferSend() bool
TransferSend returns true if funding source can send transfers
func (*FundingSource) TransferToBalance ¶
func (f *FundingSource) TransferToBalance() bool
TransferToBalance returns true if funding source can transfer to balance
func (*FundingSource) Update ¶
func (f *FundingSource) Update(ctx context.Context, body *FundingSourceRequest) error
Update updates the funding source
func (*FundingSource) VerifyMicroDeposits ¶
func (f *FundingSource) VerifyMicroDeposits(ctx context.Context, body *MicroDepositRequest) error
VerifyMicroDeposits verifies micro deposit amounts
type FundingSourceBalance ¶
type FundingSourceBalance struct { Resource Balance Amount `json:"balance"` Total Amount `json:"total"` LastUpdated string `json:"lastUpdated"` }
FundingSourceBalance is a funding source balance
type FundingSourceBankAccountType ¶
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 ¶
type FundingSourceRequest struct { Resource RoutingNumber string `json:"routingNumber,omitempty"` AccountNumber string `json:"accountNumber,omitempty"` BankAccountType FundingSourceBankAccountType `json:"bankAccountType,omitempty"` Name string `json:"name,omitempty"` // Arbitrary nickname for the funding source. Must be 50 characters or less. Channels []string `json:"channels,omitempty"` Removed bool `json:"removed,omitempty"` PlaidToken string `json:"plaidToken,omitempty"` // A processor token obtained from Plaid for adding and verifying a bank IdempotencyKey string `json:"-"` }
FundingSourceRequest is a funding source request
type FundingSourceService ¶
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://developers.dwolla.com/api-reference/funding-sources
type FundingSourceServiceOp ¶
type FundingSourceServiceOp struct {
// contains filtered or unexported fields
}
FundingSourceServiceOp is an implementation of the funding source interface
func (*FundingSourceServiceOp) Remove ¶
func (f *FundingSourceServiceOp) Remove(ctx context.Context, id string) error
Remove removes a funding source matching the id
func (*FundingSourceServiceOp) Retrieve ¶
func (f *FundingSourceServiceOp) Retrieve(ctx context.Context, id string) (*FundingSource, error)
Retrieve retrieves a funding source with the matching id
func (*FundingSourceServiceOp) Update ¶
func (f *FundingSourceServiceOp) Update(ctx context.Context, id string, body *FundingSourceRequest) (*FundingSource, error)
Update updates the funding source with matching id
type FundingSourceStatus ¶
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 FundingSourceToken ¶
FundingSourceToken is a funding source dwolla.js token
type FundingSourceType ¶
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 ¶
type FundingSources struct { Collection Embedded map[string][]FundingSource `json:"_embedded"` }
FundingSources is a collection of funding sources
type HALError ¶
type HALError struct { Code string `json:"code"` Message string `json:"message"` Path string `json:"path"` Links Links `json:"_links"` }
HALError is a hal error
type HTTPClient ¶
HTTPClient is the http client interface
type IndustryClassification ¶
IndustryClassification is a industry subclassification
type KBA ¶
type KBA struct { Resource ID string `json:"id"` Questions []KBAQuestion `json:"questions"` }
KBA is a knowledge based authentication resource
type KBAQuestion ¶
type KBAQuestion struct { ID string `json:"id"` Text string `json:"text"` Answers []KBAAnswer `json:"answers"` }
KBAQuestion is a knowledge based authentication question
type KBAQuestionAnswer ¶
type KBAQuestionAnswer struct { QuestionID string `json:"questionId"` AnswerID string `json:"answerId"` }
KBAQuestionAnswer is a knowledge based authentication question and answer
type KBARequest ¶
type KBARequest struct {
Answers []KBAQuestionAnswer `json:"answers"`
}
KBARequest is a knowledge based authentication verification request
type KBAService ¶
KBAService is the kba service interface
type KBAServiceOp ¶
type KBAServiceOp struct {
// contains filtered or unexported fields
}
KBAServiceOp is an implementation of the kba service interface
type Link ¶
type Link struct { Href string `json:"href"` ResourceType string `json:"resource-type,omitempty"` Type string `json:"type,omitempty"` }
Link is a hal resource link
type MassPayment ¶
type MassPayment struct { Resource ID string `json:"id,omitempty"` Status MassPaymentStatus `json:"status,omitempty"` ACHDetails *ACHDetails `json:"achDetails,omitempty"` Clearing *Clearing `json:"clearing,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 ¶
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 ¶
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 ¶
func (m *MassPayment) RetrieveSource(ctx context.Context) (*FundingSource, error)
RetrieveSource retrieves the mass payment funding source
type MassPaymentItem ¶
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 ¶
func (m *MassPaymentItem) RetrieveDestination(ctx context.Context) (*Customer, error)
RetrieveDestination retrieves the destination for the item
func (*MassPaymentItem) RetrieveMassPayment ¶
func (m *MassPaymentItem) RetrieveMassPayment(ctx context.Context) (*MassPayment, error)
RetrieveMassPayment retrieves the mass payment for the item
func (*MassPaymentItem) RetrieveTransfer ¶
func (m *MassPaymentItem) RetrieveTransfer(ctx context.Context) (*Transfer, error)
RetrieveTransfer retrieves the transfer for the item
type MassPaymentItemStatus ¶
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 ¶
type MassPaymentItems struct { Collection Embedded map[string][]MassPaymentItem `json:"_embedded"` Total int `json:"total"` }
MassPaymentItems is a collection of mass payment items
type MassPaymentService ¶
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
type MassPaymentServiceOp ¶
type MassPaymentServiceOp struct {
// contains filtered or unexported fields
}
MassPaymentServiceOp is an implementation of the mass payment interface
func (*MassPaymentServiceOp) Create ¶
func (m *MassPaymentServiceOp) Create(ctx context.Context, body *MassPayment) (*MassPayment, error)
Create initiates a mass payment
func (*MassPaymentServiceOp) Retrieve ¶
func (m *MassPaymentServiceOp) Retrieve(ctx context.Context, id string) (*MassPayment, error)
Retrieve retrieves the mass payment matching the id
func (*MassPaymentServiceOp) Update ¶
func (m *MassPaymentServiceOp) Update(ctx context.Context, id string, status MassPaymentStatus) (*MassPayment, error)
Update updates a mass payment's status
type MassPaymentStatus ¶
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 ¶
type MassPayments struct { Collection Embedded map[string][]MassPayment `json:"_embedded"` }
MassPayments is a collection of mass payments
type MicroDeposit ¶
type MicroDeposit struct { Resource Created string `json:"created"` Status MicroDepositStatus `json:"status"` Failure MicroDepositFailure `json:"failure"` // Determines if micro-deposits fail to complete to a bank. }
MicroDeposit is a dwolla micro deposit
func (*MicroDeposit) CreatedTime ¶ added in v0.1.3
func (m *MicroDeposit) CreatedTime() time.Time
CreatedTime returns the created value as time.Time
type MicroDepositFailure ¶
type MicroDepositFailure struct { Code string `json:"code"` // ACH return code Description string `json:"description"` // description of the return }
MicroDepositFailure is detail about a micro deposit failure
type MicroDepositRequest ¶
type MicroDepositRequest struct { Amount1 Amount `json:"amount1,omitempty"` Amount2 Amount `json:"amount2,omitempty"` IdempotencyKey string `json:"-"` }
MicroDepositRequest is a micro deposit verification request
type MicroDepositStatus ¶
type MicroDepositStatus string
MicroDepositStatus is the status of the micro deposit
const ( // MicroDepositStatusPending is when micro-deposits initiated and are en route to their destination MicroDepositStatusPending MicroDepositStatus = "pending" // MicroDepositStatusProcessed is when micro-deposits have reached the destination account and are awaiting verification MicroDepositStatusProcessed MicroDepositStatus = "processed" // MicroDepositStatusFailed is when micro-deposits failed to clear successfully to the destination MicroDepositStatusFailed MicroDepositStatus = "failed" )
type OnDemandAuthorization ¶
type OnDemandAuthorization struct { Resource BodyText string `json:"bodyText"` ButtonText string `json:"buttonText"` }
OnDemandAuthorization is a dwolla on-demand transfer authorization
type OnDemandAuthorizationService ¶
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 ¶
type OnDemandAuthorizationServiceOp struct {
// contains filtered or unexported fields
}
OnDemandAuthorizationServiceOp is an implementation of the on-demand authorization interface
func (*OnDemandAuthorizationServiceOp) Create ¶
func (o *OnDemandAuthorizationServiceOp) Create(ctx context.Context) (*OnDemandAuthorization, error)
Create creates an on-demand transfer authorization
func (*OnDemandAuthorizationServiceOp) Retrieve ¶
func (o *OnDemandAuthorizationServiceOp) Retrieve(ctx context.Context, id string) (*OnDemandAuthorization, error)
Retrieve returns a on-demand authorization matching the id
type Resource ¶
type Resource struct { Links Links `json:"_links,omitempty"` // contains filtered or unexported fields }
Resource is a hal resource
func NewResource ¶
NewResource is constructor for Resource
type Token ¶
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
type Transfer ¶
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 Clearing `json:"clearing"` CorrelationID string `json:"correlationId"` IndividualACHID string `json:"individualAchId"` }
Transfer is a dwolla transfer
func (*Transfer) CreatedTime ¶ added in v0.1.5
CreatedTime returns the created value as time.Time
func (*Transfer) Destination ¶
Destination returns the customer transfer destination
func (*Transfer) DestinationFundingSource ¶
func (t *Transfer) DestinationFundingSource(ctx context.Context) (*FundingSource, error)
DestinationFundingSource returns the transfer funding source destination
func (Transfer) DestinationFundingSourceString ¶
DestinationFundingSourceString returns the funding source destination id
func (Transfer) DestinationString ¶
DestinationString returns the customer transfer destination id
func (*Transfer) ListFees ¶
func (t *Transfer) ListFees(ctx context.Context) (*TransferFees, error)
ListFees returns the fees associated with the transfer
func (*Transfer) RetrieveFailureReason ¶
func (t *Transfer) RetrieveFailureReason(ctx context.Context) (*TransferFailure, error)
RetrieveFailureReason returns the transfer's failure reason
see: https://developers.dwolla.com/api-reference/transfers/retrieve-a-transfer-failure-reason
func (*Transfer) SourceFundingSource ¶
func (t *Transfer) SourceFundingSource(ctx context.Context) (*FundingSource, error)
SourceFundingSource returns the transfer funding source
func (Transfer) SourceFundingSourceString ¶
SourceFundingSourceString returns the transfer funding source
func (Transfer) SourceString ¶
SourceString returns the customer transfer source id
type TransferACHDetails ¶
type TransferACHDetails = ACHDetails
TransferACHDetails is an alias of ACHDetails for backwards compatibility
type TransferAddenda ¶
type TransferAddenda = Addenda
TransferAddenda is an alias of Addenda for backwards compatibility
type TransferAddendaValues ¶
type TransferAddendaValues = AddendaValues
TransferAddendaValues is an alias of AddendaValues for backwards compatibility
type TransferClearing ¶
type TransferClearing = Clearing
TransferClearing is an alias of Clearing for backwards compatiblity
type TransferFailure ¶
type TransferFailure struct { Resource Code TransferFailureCode `json:"code"` Description string `json:"description"` Explanation string `json:"explanation"` Created string `json:"created"` }
TransferFailure is a dwolla transfer
func (*TransferFailure) CreatedTime ¶ added in v0.1.5
func (tf *TransferFailure) CreatedTime() time.Time
CreatedTime returns the created value as time.Time
type TransferFailureCode ¶
type TransferFailureCode string
const ( TransferFailureCodeInsufficientFunds TransferFailureCode = "R01" TransferFailureCodeBankAccountClosed TransferFailureCode = "R02" TransferFailureCodeNoAccount TransferFailureCode = "R03" TransferFailureCodeInvalidBankAccountNumberStructure TransferFailureCode = "R04" 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 TransferFailureService ¶
type TransferFailureService interface {
Retrieve(ctx context.Context, transferID string) (*TransferFailure, error)
}
TransferFailureService is the transfer service interface
type TransferFailureServiceOp ¶
type TransferFailureServiceOp struct {
// contains filtered or unexported fields
}
TransferFailureServiceOp is an implementation of the transfer service interface
func (TransferFailureServiceOp) Retrieve ¶
func (t TransferFailureServiceOp) Retrieve(ctx context.Context, transferID string) (*TransferFailure, error)
type TransferFee ¶
TransferFee is a transfer fee
type TransferFees ¶
TransferFees contains fees related to a transfer
type TransferRequest ¶
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 Clearing `json:"clearing,omitempty"` CorrelationID string `json:"correlationId,omitempty"` ACHDetails *ACHDetails `json:"achDetails,omitempty"` IdempotencyKey string `json:"-"` }
TransferRequest is a transfer request
type TransferService ¶
type TransferService interface { Create(context.Context, *TransferRequest) (*Transfer, error) Retrieve(context.Context, string) (*Transfer, error) }
TransferService is the transfer service interface
type TransferServiceOp ¶
type TransferServiceOp struct {
// contains filtered or unexported fields
}
TransferServiceOp is an implementation of the transfer service interface
func (*TransferServiceOp) Create ¶
func (t *TransferServiceOp) Create(ctx context.Context, body *TransferRequest) (*Transfer, error)
Create initiates a transfer
type TransferStatus ¶
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 ¶
type Transfers struct { Collection Embedded map[string][]Transfer `json:"_embedded"` }
Transfers is a collection of dwolla transfers
type ValidationError ¶
type ValidationError struct { Code string `json:"code"` Message string `json:"message"` Embedded HALErrors `json:"_embedded"` }
ValidationError is a dwolla validation error
func (ValidationError) Error ¶
func (v ValidationError) Error() string
Error implements the error interface
type Webhook ¶
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 ¶
func (w *Webhook) ListRetries(ctx context.Context) (*WebhookRetries, error)
ListRetries returns a collection of retries for this webhook
func (*Webhook) RetrieveEvent ¶
RetrieveEvent retrieves the event for the webhook
func (*Webhook) RetrieveWebhookSubscription ¶
func (w *Webhook) RetrieveWebhookSubscription(ctx context.Context) (*WebhookSubscription, error)
RetrieveWebhookSubscription returns the subscription for the webhoook
func (*Webhook) RetrieveWebhooks ¶
RetrieveWebhooks returns webhooks for this webhook subscription
type WebhookAttempt ¶
type WebhookAttempt struct { ID string `json:"id"` Request WebhookRequest `json:"request"` Response WebhookResponse `json:"response"` }
WebhookAttempt is a webhook attempt
type WebhookHeader ¶
WebhookHeader is a webhook request/response header
type WebhookRequest ¶
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 ¶
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 ¶
type WebhookRetries struct { Collection Embedded map[string][]WebhookRetry `json:"_embedded"` Total int `json:"total"` }
WebhookRetries is a collection of webhook retries
type WebhookRetry ¶
WebhookRetry is a webhook retry
type WebhookService ¶
WebhookService is the webhook service interface
type WebhookServiceOp ¶
type WebhookServiceOp struct {
// contains filtered or unexported fields
}
WebhookServiceOp is an implementation of the webhook service interface
type WebhookSubscription ¶
type WebhookSubscription struct { Resource ID string `json:"id"` URL string `json:"url"` Created string `json:"created"` }
WebhookSubscription is a webhook subscription
func (*WebhookSubscription) Pause ¶
func (w *WebhookSubscription) Pause(ctx context.Context) error
Pause pauses the webhook subscription
type WebhookSubscriptionRequest ¶
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 ¶
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
type WebhookSubscriptionServiceOp ¶
type WebhookSubscriptionServiceOp struct {
// contains filtered or unexported fields
}
WebhookSubscriptionServiceOp is an implementation of the webhook subscription service interface
func (*WebhookSubscriptionServiceOp) Create ¶
func (w *WebhookSubscriptionServiceOp) Create(ctx context.Context, body *WebhookSubscriptionRequest) (*WebhookSubscription, error)
Create creates a webhook subscription
func (*WebhookSubscriptionServiceOp) List ¶
func (w *WebhookSubscriptionServiceOp) List(ctx context.Context) (*WebhookSubscriptions, error)
List returns a list of webhook subscriptions
func (*WebhookSubscriptionServiceOp) Remove ¶
func (w *WebhookSubscriptionServiceOp) Remove(ctx context.Context, id string) error
Remove removes the webhook subscription matching the id
func (*WebhookSubscriptionServiceOp) Retrieve ¶
func (w *WebhookSubscriptionServiceOp) Retrieve(ctx context.Context, id string) (*WebhookSubscription, error)
Retrieve retrieves the webhook subscription matching id
type WebhookSubscriptions ¶
type WebhookSubscriptions struct { Collection Embedded map[string][]WebhookSubscription `json:"_embedded"` Total int `json:"total"` }
WebhookSubscriptions is a collection of webhook subscriptions