bosgo

package module
v0.6.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 12 Imported by: 2

README

bosgo - a Bankrs OS Go client

This is the official Go client for accessing the Bankrs OS API.

Documentation: GoDoc

bosgo requires Go version 1.7 or greater.

Getting started

Ensure you have a working Go installation and then use go get as follows:

go get code.bankrs.com/bosgo

Usage

import "code.bankrs.com/bosgo"

There are four types of client that represent the three levels of authorisation required for interacting with Bankrs OS:

  • Client - the base client that is used to create a new developer account, login as a developer or request lost passwords.
  • DevClient - contains the developer session obtained after a successful login, used for creating and deleting applications and obtaining statistics about the developer account.
  • AppClient - provides functionality to manage users for an application and for obtaining information on available financial providers and categories.
  • UserClient - contains the user session obtained after logging in via an AppClient. Used for all interactions on behalf of a user including reading transactions and processing payments.

Construct a new client and login as a developer to the Bankrs OS sandbox to obtain recent user statistics:

client := bosgo.New(http.DefaultClient, bosgo.SandboxAddr)
devClient, err := client.Login("email", "password").Send()
if err != nil {
    log.Fatalf("failed to login: %v", err)
}

stats, err := devClient.Stats.Users().Send()
if err != nil {
    log.Fatalf("failed to obtain user stats: %v", err)
}
log.Printf("Total users today: %d", stats.UsersToday.value)

Some API services have optional parameters that can be passed. For example, to count the number of active users in the past week the FromDate can be set:

request := devClient.Stats.Users()
stats, err := devClient.Stats.Users().FromDate("2017-06-09").Send()
if err != nil {
    log.Fatalf("failed to obtain user stats: %v", err)
}
log.Printf("Total users in past week: %d", stats.UsersTotal.value)
Create a new developer account and application
client := bosgo.New(http.DefaultClient, bosgo.SandboxAddr)
devClient, err := client.CreateDeveloper("email", "password").Send()
if err != nil {
    log.Fatalf("failed to create developer: %v", err)
}

applicationID, err := devClient.Applications.Create("my application").Send()
if err != nil {
    log.Fatalf("failed to create application: %v", err)
}

applicationKey, err := devClient.Application.CreateKey(applicationID).Send()
if err != nil {
    log.Fatalf("failed to create application key: %v", err)
}

Once an application has been created, it can be used to create user accounts:

appClient := bosgo.NewAppClient(http.DefaultClient, bosgo.SandboxAddr, applicationKey.Key)
userClient, err := appClient.Users.Create("username", "password").Send()
if err != nil {
    log.Fatalf("failed to create user: %v", err)
}
Login on behalf of a user
appClient := bosgo.NewAppClient(http.DefaultClient, bosgo.SandboxAddr, applicationKey.Key)
userClient, err := appClient.Users.Login("username", "password").Send()
if err != nil {
    log.Fatalf("failed to login as user: %v", err)
}
Add a bank access for a user and respond to challenges

Obtain a user client as above then add the bank access, providing challenge answers up front:

req := userClient.Accesses.Add("DE-BIN-10010010")
req.ChallengeAnswer(bosgo.ChallengeAnswer{
    ID: "login",
    Value: "fakebank_investor_1",
    Store: true,
})
req.ChallengeAnswer(bosgo.ChallengeAnswer{
    ID: "pin",
    Value: "1234",
    Store: false,
})
job, err := req.Send()
if err != nil {
    log.Fatalf("failed to add bank access: %v", err)
}

Adding an access is an asynchronous operation which can be tracked using the job URI returned from the service call:

status, err := userClient.Jobs.Get(job.URI).Send()
if err != nil {
    log.Fatalf("failed to obtain job status: %v", err)
}
log.Printf("job stage: %s", status.Stage)

Some jobs may require further challenges to be provided so they can proceed:

req := userClient.Jobs.Answer(job.URI).Send()
req.ChallengeAnswer(bosgo.ChallengeAnswer{
    ID: "pin",
    Value: "5678",
    Store: false,
})
status, err := req.Send()
if err != nil {
    log.Fatalf("failed to obtain job status: %v", err)
}
log.Printf("job stage: %s", status.Stage)

Documentation

Overview

Package bosgo provides a Go client for accessing the Bankrs OS API.

Index

Constants

View Source
const (

	// Version is the current version of the bosgo library.
	Version = "0.1"

	// DefaultUserAgent is the default user agent header used by the bosgo library.
	DefaultUserAgent = "bosgo-bankrs-os-client/" + Version
)
View Source
const (
	SandboxAddr    = "api.sandbox.bankrs.com"
	ProductionAddr = "api.bankrs.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
	ID                int64              `json:"id"`
	Name              string             `json:"name"`
	Enabled           bool               `json:"enabled"`
	AuthPossible      bool               `json:"auth_possible"`
	ProviderID        string             `json:"provider_id"`
	Accounts          []Account          `json:"accounts,omitempty"`
	Capabilities      AccessCapabilities `json:"capabilities"`
	Beneficiaries     []Beneficiary      `json:"beneficiaries,omitempty"`
	ConsentExpiration time.Time          `json:"consent_expiration,omitempty"`
	// Personal information of the user, just for this access
	UserInfo UserInfo `json:"user_info,omitempty"`
}

type AccessCapabilities added in v0.1.3

type AccessCapabilities struct {
	RecurringTransfer RecurringTransferCapabilities `json:"recurring_transfer"`
	ScheduledTransfer ScheduledTransferCapabilities `json:"scheduled_transfer"`
	Trading           bool                          `json:"trading"`
}

type AccessPage

type AccessPage struct {
	Accesses []Access `json:"accesses"`
}

type AccessesService

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

AccessesService provides access to bank access related API services.

func NewAccessesService

func NewAccessesService(u *UserClient) *AccessesService

func (*AccessesService) Add

func (a *AccessesService) Add(providerID string) *AddAccessReq

func (*AccessesService) Delete

func (a *AccessesService) Delete(id int64) *DeleteAccessReq

func (*AccessesService) Get

func (a *AccessesService) Get(id int64) *GetAccessReq

Get prepares and returns a request to fetch data about a bank access associated with the user.

func (*AccessesService) List

func (a *AccessesService) List() *ListAccessesReq

func (*AccessesService) Refresh

func (a *AccessesService) Refresh(id int64) *RefreshAccessReq

Refresh prepares and returns a request to refresh the data for a bank access associated with the user. The request returns a job which may be used to track the progress of the refresh.

func (*AccessesService) RefreshAll

func (a *AccessesService) RefreshAll() *RefreshAllAccessesReq

RefreshAll prepares and returns a request to refresh all data for all accesses associated with the user. The request returns one job per access.

func (*AccessesService) Update

func (a *AccessesService) Update(id int64) *UpdateAccessReq

Update prepares and returns a request to update the stored answers for a bank access associated with the user.

type Account

type Account struct {
	ID               int64               `json:"id"`
	ProviderID       string              `json:"provider_id"`
	BankAccessID     int64               `json:"bank_access_id"`
	Name             string              `json:"name"`
	Type             AccountType         `json:"type"`
	Holder           string              `json:"holder,omitempty"`
	Number           string              `json:"number"`
	Balance          string              `json:"balance"`
	BalanceDate      time.Time           `json:"balance_date"`
	AvailableBalance string              `json:"available_balance"`
	CreditLine       string              `json:"credit_line"`
	Removed          bool                `json:"removed"`
	Currency         string              `json:"currency"`
	IBAN             string              `json:"iban"`
	Alias            string              `json:"alias"`
	Capabilities     AccountCapabilities `json:"capabilities"`
	Bin              string              `json:"bin"`
	Beneficiaries    []int64             `json:"beneficiaries,omitempty"`
}

type AccountCapabilities

type AccountCapabilities struct {
	AccountStatement  []string `json:"account_statement"`
	Transfer          []string `json:"transfer"`
	RecurringTransfer []string `json:"recurring_transfer"`
}

type AccountPage

type AccountPage struct {
	Accounts []Account
}

type AccountRef

type AccountRef struct {
	ProviderID string `json:"provider_id"`
	IBAN       string `json:"iban,omitempty"`
	Label      string `json:"label,omitempty"`
	Number     string `json:"id,omitempty"`
	Type       string `json:"type,omitempty"`
}

type AccountType

type AccountType string
const (
	AccountTypeCurrent    AccountType = "current"
	AccountTypeSavings    AccountType = "savings"
	AccountTypeCreditCard AccountType = "creditcard"
	AccountTypeLoan       AccountType = "loan"
)

type AccountsService

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

AccountsService provides access to account related API services.

func NewAccountsService

func NewAccountsService(u *UserClient) *AccountsService

func (*AccountsService) Get

func (a *AccountsService) Get(id string) *GetAccountReq

func (*AccountsService) List

func (a *AccountsService) List() *ListAccountsReq

type AddAccessReq

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

func (*AddAccessReq) ChallengeAnswer

func (r *AddAccessReq) ChallengeAnswer(answer ChallengeAnswer) *AddAccessReq

ChallengeAnswer adds an answer to one of the authorisation challenges required to complete addition of the access.

func (*AddAccessReq) ClientID

func (r *AddAccessReq) ClientID(id string) *AddAccessReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*AddAccessReq) Context

func (r *AddAccessReq) Context(ctx context.Context) *AddAccessReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*AddAccessReq) Send

func (r *AddAccessReq) Send() (*Job, error)

type AppClient

type AppClient struct {
	Providers *ProvidersService
	Users     *AppUsersService
	IBAN      *IBANService
	// contains filtered or unexported fields
}

AppClient is a client used for interacting with services in the context of a registered application without a valid user or developer session. It is safe for concurrent use by multiple goroutines.

func NewAppClient

func NewAppClient(client *http.Client, addr string, applicationKey string) *AppClient

NewAppClient creates a new client that may be used to interact with services that require a specific application context.

func (*AppClient) WithUserIDAndUserToken added in v0.6.2

func (a *AppClient) WithUserIDAndUserToken(userID, token string) *UserClient

WithUserToken creates a UserClient with the supplied user token and application ID, copying options set on the receiver.

type AppUsersService

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

AppUsersService provides access to application user related API services.

func NewAppUsersService

func NewAppUsersService(c *AppClient) *AppUsersService

func (*AppUsersService) Create

func (a *AppUsersService) Create(username, password string) *UserCreateReq

Create returns a request that may be used to create a user with the given username and password.

func (*AppUsersService) Login

func (a *AppUsersService) Login(username, password string) *UserLoginReq

Login returns a request that may be used to login a user with the given username and password.

func (*AppUsersService) ResetPassword

func (a *AppUsersService) ResetPassword(username, password string) *ResetUserPasswordReq

ResetPassword prepares and returns a request to reset a user's password.

type ApplicationKey added in v0.2.8

type ApplicationKey struct {
	Key       string    `json:"key,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

type ApplicationKeyPage added in v0.2.8

type ApplicationKeyPage struct {
	Keys []ApplicationKey `json:"keys,omitempty"`
}

type ApplicationKeysService added in v0.4.0

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

ApplicationKeysService provides access to application key related API services that also require an authenticated developer session.

func NewApplicationKeysService added in v0.4.0

func NewApplicationKeysService(c *DevClient) *ApplicationKeysService

func (*ApplicationKeysService) Delete added in v0.4.0

func (d *ApplicationKeysService) Delete(applicationKey string) *DeleteAppKeyReq

Delete returns a request that may be used to remove the specified key from application.

type ApplicationMetadata

type ApplicationMetadata struct {
	ApplicationID string `json:"id,omitempty"`
	Label         string `json:"label,omitempty"`
}

type ApplicationPage

type ApplicationPage struct {
	Applications []ApplicationMetadata `json:"applications,omitempty"`
}

type ApplicationSettings

type ApplicationSettings struct {
	BackgroundRefresh bool `json:"background_refresh"`
}

type ApplicationsService

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

ApplicationsService provides access to application related API services that also require an authenticated developer session.

func NewApplicationsService

func NewApplicationsService(c *DevClient) *ApplicationsService

func (*ApplicationsService) Create

func (*ApplicationsService) CreateCredential added in v0.4.0

func (d *ApplicationsService) CreateCredential(applicationID, provider string, credentials map[string]string) *CreateCredentialReq

CreateCredential returns a request that may be used to create a set of developer credentials.

func (*ApplicationsService) CreateKey added in v0.2.8

func (d *ApplicationsService) CreateKey(applicationID string) *CreateAppKeyReq

func (*ApplicationsService) Delete

func (d *ApplicationsService) Delete(applicationID string) *DeleteApplicationsReq

func (*ApplicationsService) List

func (*ApplicationsService) ListCredentials added in v0.4.0

func (d *ApplicationsService) ListCredentials(applicationID string) *ListCredentialsReq

ListCredentials returns a request that may be used to list all developer credentials associated with an application.

func (*ApplicationsService) ListKeys added in v0.2.8

func (d *ApplicationsService) ListKeys(applicationID string) *ListAppKeysReq

func (*ApplicationsService) ListUsers

func (d *ApplicationsService) ListUsers(applicationKey string) *ListDevUsersReq

func (*ApplicationsService) ResetUsers

func (d *ApplicationsService) ResetUsers(applicationKey string, usernames []string) *ResetDevUsersReq

ResetUsers prepares and returns a request to reset user data.

func (*ApplicationsService) Settings

func (d *ApplicationsService) Settings(applicationID string) *GetApplicationSettingsReq

Settings prepares and returns a request to retrieve an application's configuration settings.

func (*ApplicationsService) Update

func (d *ApplicationsService) Update(applicationID string, label string) *UpdateApplicationReq

func (*ApplicationsService) UpdateSettings added in v0.1.1

func (d *ApplicationsService) UpdateSettings(applicationID string) *UpdateApplicationSettingsReq

UpdateSettings prepares and returns a request to update an application's configuration settings.

func (*ApplicationsService) UserInfo

func (d *ApplicationsService) UserInfo(applicationKey, id string) *DevUserInfoReq

UserInfo prepares and returns a request to lookup information about a user.

type AuthMethod

type AuthMethod struct {
	ID          string `json:"id"`
	Description string `json:"description"`
}

type Beneficiary added in v0.4.0

type Beneficiary struct {
	ID        int64      `json:"id"`
	RemoteAcc AccountRef `json:"remote_account"`
	Reference string     `json:"reference,omitempty"`
}

type CancelRecurringTransferReq

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

func (*CancelRecurringTransferReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*CancelRecurringTransferReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*CancelRecurringTransferReq) Send

Send sends the request to update a money transfer.

type CancelTransferReq

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

func (*CancelTransferReq) ClientID

func (r *CancelTransferReq) ClientID(id string) *CancelTransferReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*CancelTransferReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*CancelTransferReq) Send

func (r *CancelTransferReq) Send() (*Transfer, error)

Send sends the request to update a money transfer.

type Category

type Category struct {
	ID    int64             `json:"id"`
	Names map[string]string `json:"names"`
	Group string            `json:"group"`
}

type CategoryList

type CategoryList []Category

type Challenge

type Challenge struct {
	NextChallenges []ChallengeField `json:"next_challenges"`
	LastProblems   []Problem        `json:"last_problems"`
}

type ChallengeAnswer

type ChallengeAnswer struct {
	ID         string    `json:"id"`
	Value      string    `json:"value"`
	Store      bool      `json:"store"`
	ValidUntil time.Time `json:"valid_until"`
}

type ChallengeAnswerList

type ChallengeAnswerList []ChallengeAnswer

type ChallengeAnswerMap

type ChallengeAnswerMap map[string]ChallengeAnswer

type ChallengeField

type ChallengeField struct {
	ID            string            `json:"id"`
	Description   string            `json:"description"`
	ChallengeType string            `json:"type"`
	Previous      string            `json:"previous"`
	Stored        bool              `json:"stored"`
	Reset         bool              `json:"reset"`
	Secure        bool              `json:"secure"`
	Optional      bool              `json:"optional"`
	UnStoreable   bool              `json:"unstoreable"`
	Transient     bool              `json:"transient"`
	MinLen        int               `json:"minLen"`
	Methods       []string          `json:"methods"`
	Info          map[string]string `json:"info"`
}

type ChallengeSpec

type ChallengeSpec struct {
	ID          string            `json:"id"`
	Description string            `json:"description"`
	Type        ChallengeType     `json:"type"`
	Secure      bool              `json:"secure"`
	UnStoreable bool              `json:"unstoreable"`
	Optional    bool              `json:"optional"`
	Methods     []string          `json:"methods,omitempty"`
	Info        map[string]string `json:"info,omitempty"`
}

type ChallengeType

type ChallengeType string
const (
	ChallengeTypeAlpha        ChallengeType = "alpha"
	ChallengeTypeNumeric      ChallengeType = "numeric"
	ChallengeTypeAlphaNumeric ChallengeType = "alphanumeric"
)

type Client

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

Client is the base client used for interacting with services that do not require authentication. Use Login to initiate a developer session. It is safe for concurrent use by multiple goroutines.

func New

func New(client *http.Client, addr string, opts ...ClientOption) *Client

New creates a new client that will use the supplied HTTP client and connect via the specified API host address.

func (*Client) CreateDeveloper

func (c *Client) CreateDeveloper(email, password string) *DeveloperCreateReq

CreateDeveloper prepares and returns a request to create a developer account for the Bankrs API. Sending a successful request will return a new client that allows access to services requiring a valid developer session.

func (*Client) Login

func (c *Client) Login(email, password string) *DeveloperLoginReq

Login prepares and returns a request to log a developer into the Bankrs API. Sending a successful request will return a new client that allows access to services requiring a valid developer session.

func (*Client) LostPassword

func (c *Client) LostPassword(email string) *LostPasswordReq

LostPassword prepares and returns a request to start the lost password process.

func (*Client) ResetPassword

func (c *Client) ResetPassword(password string, token string) *ResetPasswordReq

ResetPassword prepares and returns a request to reset a lost password.

func (*Client) WithApplicationKey added in v0.6.4

func (c *Client) WithApplicationKey(applicationKey string) *AppClient

WithApplicationKey creates an AppClient with the supplied application ID, copying options set on the receiver.

func (*Client) WithDeveloperToken added in v0.1.4

func (c *Client) WithDeveloperToken(token string) *DevClient

WithDeveloperToken creates a DevClient with the supplied developer token, copying options set on the receiver.

type ClientOption

type ClientOption func(*Client)

func Environment added in v0.1.1

func Environment(environment string) ClientOption

Environment is a client option that may be used to set the X-Environment header used by the client.

func UserAgent

func UserAgent(ua string) ClientOption

UserAgent is a client option that may be used to add information to the user agent header used by the client.

func WithRetryPolicy added in v0.1.3

func WithRetryPolicy(policy RetryPolicy) ClientOption

WithRetryPolicy is a client option that may be used to set the retry policy used by the client.

type Consent struct {
	ID               string            `json:"id"`
	ObjectType       ConsentObjectType `json:"object_type"`
	ObjectID         string            `json:"object_id"`
	Status           ConsentStatus     `json:"status"`
	StatusChangeTime time.Time         `json:"status_change_time"`
	Expiration       time.Time         `json:"expiration"`
	AuthMethod       ConsentAuthMethod `json:"auth_method"`
	AuthURL          string            `json:"auth_url"`
	AuthMessage      string            `json:"auth_message"`
}

type ConsentAuthMethod added in v0.6.0

type ConsentAuthMethod string
const (
	OAuth    ConsentAuthMethod = "oauth"
	Redirect ConsentAuthMethod = "redirect"
	External ConsentAuthMethod = "external"
	Login    ConsentAuthMethod = "login"
)

type ConsentGetReq added in v0.6.0

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

func (*ConsentGetReq) ClientID added in v0.6.0

func (r *ConsentGetReq) ClientID(id string) *ConsentGetReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ConsentGetReq) Context added in v0.6.0

func (r *ConsentGetReq) Context(ctx context.Context) *ConsentGetReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ConsentGetReq) Send added in v0.6.0

func (r *ConsentGetReq) Send() (*Consent, error)

Send sends the request to get details of a consent.

type ConsentObjectType added in v0.6.0

type ConsentObjectType string
const (
	ObjectTypeAccess   ConsentObjectType = "access"
	ObjectTypeTransfer ConsentObjectType = "transfer"
)

type ConsentStatus added in v0.6.0

type ConsentStatus string
const (
	AwaitingAuthorisation ConsentStatus = "awaiting_authorisation"
	Authorised            ConsentStatus = "authorised"
	Rejected              ConsentStatus = "rejected"
	Revoked               ConsentStatus = "revoked"
	Consumed              ConsentStatus = "consumed"
)

type ConsentsService added in v0.6.0

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

ConsentsService provides access to consent related API services.

func NewConsentsService added in v0.6.0

func NewConsentsService(u *UserClient) *ConsentsService

func (*ConsentsService) Get added in v0.6.0

func (j *ConsentsService) Get(id string) *ConsentGetReq

Get returns a request that may be used to get the details of a consent.

type Counterparty

type Counterparty struct {
	Name     string     `json:"name"`
	Account  AccountRef `json:"account,omitempty"`
	Merchant *Merchant  `json:"merchant,omitempty"`
}

type CreateAppKeyReq added in v0.2.8

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

func (*CreateAppKeyReq) ClientID added in v0.2.8

func (r *CreateAppKeyReq) ClientID(id string) *CreateAppKeyReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*CreateAppKeyReq) Context added in v0.2.8

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*CreateAppKeyReq) Send added in v0.2.8

func (r *CreateAppKeyReq) Send() (*ApplicationKey, error)

type CreateApplicationsReq

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

func (*CreateApplicationsReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*CreateApplicationsReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*CreateApplicationsReq) Send

type CreateCredentialReq added in v0.4.0

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

func (*CreateCredentialReq) ClientID added in v0.4.0

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*CreateCredentialReq) Context added in v0.4.0

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*CreateCredentialReq) Send added in v0.4.0

func (r *CreateCredentialReq) Send() (string, error)

type CreateRecurringTransferReq

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

func (*CreateRecurringTransferReq) ChallengeAnswer

ChallengeAnswer adds an answer to one of the authorisation challenges required to complete the transfer.

func (*CreateRecurringTransferReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*CreateRecurringTransferReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*CreateRecurringTransferReq) Description

Description sets a human readable description for the transfer.

func (*CreateRecurringTransferReq) EntryDate

EntryDate sets the desired date for the transfer to be placed. It cannot be a date in the past.

func (*CreateRecurringTransferReq) Send

Send sends the request to create a money transfer.

type CreateTransferReq

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

func (*CreateTransferReq) ChallengeAnswer

func (r *CreateTransferReq) ChallengeAnswer(answer ChallengeAnswer) *CreateTransferReq

ChallengeAnswer adds an answer to one of the authorisation challenges required to complete the transfer.

func (*CreateTransferReq) ClientID

func (r *CreateTransferReq) ClientID(id string) *CreateTransferReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*CreateTransferReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*CreateTransferReq) Description

func (r *CreateTransferReq) Description(s string) *CreateTransferReq

Description sets a human readable description for the transfer.

func (*CreateTransferReq) EntryDate

func (r *CreateTransferReq) EntryDate(date time.Time) *CreateTransferReq

EntryDate sets the desired date for the transfer to be placed. It cannot be a date in the past.

func (*CreateTransferReq) Send

func (r *CreateTransferReq) Send() (*Transfer, error)

Send sends the request to create a money transfer.

type CreateWebhookReq

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

func (*CreateWebhookReq) ClientID

func (r *CreateWebhookReq) ClientID(id string) *CreateWebhookReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*CreateWebhookReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*CreateWebhookReq) Send

func (r *CreateWebhookReq) Send() (string, error)

type Credential added in v0.4.0

type Credential struct {
	ID          string            `json:"id"`
	Provider    string            `json:"provider"`
	CreatedAt   time.Time         `json:"created_at"`
	Credentials map[string]string `json:"keys"`
}

type CredentialEntry added in v0.4.0

type CredentialEntry struct {
	ID        string    `json:"id"`
	Provider  string    `json:"provider"`
	CreatedAt time.Time `json:"created_at"`
}

type CredentialProvider added in v0.4.0

type CredentialProvider struct {
	Name string   `json:"name"`
	Keys []string `json:"keys"`
}

type CredentialProviderPage added in v0.4.0

type CredentialProviderPage struct {
	Providers []CredentialProvider `json:"providers"`
}

type CredentialsPage added in v0.4.0

type CredentialsPage struct {
	Entries []CredentialEntry `json:"entries,omitempty"`
}

type CredentialsService added in v0.4.0

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

CredentialsService provides access to credential related API services that also require an authenticated developer session.

func NewCredentialsService added in v0.4.0

func NewCredentialsService(c *DevClient) *CredentialsService

func (*CredentialsService) Delete added in v0.4.0

func (d *CredentialsService) Delete(credentialID string) *DeleteCredentialReq

Delete returns a request that may be used to get a delete a set of stored credentials.

func (*CredentialsService) Get added in v0.4.0

func (d *CredentialsService) Get(credentialID string) *GetCredentialReq

Get returns a request that may be used to get a set of stored credentials.

func (*CredentialsService) ListProviders added in v0.4.0

func (d *CredentialsService) ListProviders() *ListCredentialProvidersReq

ListProviders returns a request that may be used to get a list of supported providers for credential sets.

func (*CredentialsService) Update added in v0.4.0

func (d *CredentialsService) Update(credentialID string, credentials map[string]string) *UpdateCredentialReq

Update returns a request that may be used to update a set of stored credentials.

type DailyMerchantsStats

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

type DailyProvidersStats

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

type DailyRequestsStats

type DailyRequestsStats struct {
	Date          string `json:"date"`
	RequestsTotal int64  `json:"requests_total"`
}

type DailyTransfersStats

type DailyTransfersStats struct {
	Date string             `json:"date"`
	Out  []StatsMoneyAmount `json:"out"`
}

type DailyUsersStats

type DailyUsersStats struct {
	Date     string `json:"date"`
	NewUsers int64  `json:"new_users"`
}

type DeleteAccessReq

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

func (*DeleteAccessReq) ClientID

func (r *DeleteAccessReq) ClientID(id string) *DeleteAccessReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeleteAccessReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeleteAccessReq) Send

func (r *DeleteAccessReq) Send() (int64, error)

Send sends the request to get details of a bank access.

type DeleteAppKeyReq added in v0.4.0

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

func (*DeleteAppKeyReq) ClientID added in v0.4.0

func (r *DeleteAppKeyReq) ClientID(id string) *DeleteAppKeyReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeleteAppKeyReq) Context added in v0.4.0

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeleteAppKeyReq) Send added in v0.4.0

func (r *DeleteAppKeyReq) Send() error

type DeleteApplicationsReq

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

func (*DeleteApplicationsReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeleteApplicationsReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeleteApplicationsReq) Send

func (r *DeleteApplicationsReq) Send() error

type DeleteCredentialReq added in v0.4.0

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

func (*DeleteCredentialReq) ClientID added in v0.4.0

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeleteCredentialReq) Context added in v0.4.0

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeleteCredentialReq) Send added in v0.4.0

func (r *DeleteCredentialReq) Send() error

type DeleteRepeatedTransactionReq

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

func (*DeleteRepeatedTransactionReq) ChallengeAnswer

ChallengeAnswer adds an answer to one of the authorisation challenges required to complete the deletion.

func (*DeleteRepeatedTransactionReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeleteRepeatedTransactionReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeleteRepeatedTransactionReq) Send

Send sends the request to delete a repeated transaction. It returns information about the long running recurring transfer job that may be used to track and progress the deletion. TODO: This looks wrong

type DeleteWebhookReq

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

func (*DeleteWebhookReq) ClientID

func (r *DeleteWebhookReq) ClientID(id string) *DeleteWebhookReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeleteWebhookReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeleteWebhookReq) Send

func (r *DeleteWebhookReq) Send() error

type DeletedUser

type DeletedUser struct {
	DeletedUserID string `json:"deleted_user_id"`
}

type DevClient

type DevClient struct {
	Applications    *ApplicationsService
	ApplicationKeys *ApplicationKeysService
	Stats           *StatsService
	Webhooks        *WebhooksService
	Credentials     *CredentialsService
	// contains filtered or unexported fields
}

DevClient is a client used for interacting with services that require a valid developer session. It is safe for concurrent use by multiple goroutines.

func NewDevClient

func NewDevClient(client *http.Client, addr string, token string) *DevClient

NewDevClient creates a new developer client, ready to use.

func (*DevClient) ChangePassword

func (d *DevClient) ChangePassword(old, new string) *DeveloperChangePasswordReq

ChangePassword prepares and returns a request to change a developer's password.

func (*DevClient) Delete

func (d *DevClient) Delete() *DeveloperDeleteReq

Delete prepares and returns a request to delete the developer account and all it's associated data in all environments. Once this request has been sent the client is no longer valid and should not be used.

func (*DevClient) Logout

func (d *DevClient) Logout() *DeveloperLogoutReq

Logout prepares and returns a request to log a developer out of the Bankrs API. Once this request has been sent the client is no longer valid and should not be used.

func (*DevClient) Profile

func (d *DevClient) Profile() *DeveloperProfileReq

Profile retrieves the developer's profile.

func (*DevClient) SessionToken

func (d *DevClient) SessionToken() string

SessionToken returns the current session token.

func (*DevClient) SetProfile

func (d *DevClient) SetProfile(profile *DeveloperProfile) *DeveloperSetProfileReq

SetProfile sets the developer's profile.

type DevUserInfo

type DevUserInfo struct {
	Username string `json:"username"`
}

type DevUserInfoReq

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

func (*DevUserInfoReq) ClientID

func (r *DevUserInfoReq) ClientID(id string) *DevUserInfoReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DevUserInfoReq) Context

func (r *DevUserInfoReq) Context(ctx context.Context) *DevUserInfoReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DevUserInfoReq) Send

func (r *DevUserInfoReq) Send() (*DevUserInfo, error)

type DeveloperChangePasswordReq

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

func (*DeveloperChangePasswordReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeveloperChangePasswordReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeveloperChangePasswordReq) Send

Send sends the request to change the developer's password.

type DeveloperCreateReq

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

func (*DeveloperCreateReq) ClientID

func (r *DeveloperCreateReq) ClientID(id string) *DeveloperCreateReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeveloperCreateReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeveloperCreateReq) Send

func (r *DeveloperCreateReq) Send() (*DevClient, error)

Send sends the create request and returns a client that can be used to access services within the developer's session.

type DeveloperCredentials

type DeveloperCredentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	OTP      string `json:"otp"`
}

type DeveloperDeleteReq

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

func (*DeveloperDeleteReq) ClientID

func (r *DeveloperDeleteReq) ClientID(id string) *DeveloperDeleteReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeveloperDeleteReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeveloperDeleteReq) Send

func (r *DeveloperDeleteReq) Send() error

Send sends the request to delete developer. Once this request has been sent the developer client should not be used again.

type DeveloperLoginReq

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

func (*DeveloperLoginReq) ClientID

func (r *DeveloperLoginReq) ClientID(id string) *DeveloperLoginReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeveloperLoginReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeveloperLoginReq) Send

func (r *DeveloperLoginReq) Send() (*DevClient, error)

Send sends the login request and returns a client that can be used to access services within the developer's session.

type DeveloperLogoutReq

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

func (*DeveloperLogoutReq) ClientID

func (r *DeveloperLogoutReq) ClientID(id string) *DeveloperLogoutReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeveloperLogoutReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeveloperLogoutReq) Send

func (r *DeveloperLogoutReq) Send() error

Send sends the request to log the developer out and end the session. Once this request has been sent the developer client should not be used again.

type DeveloperProfile

type DeveloperProfile struct {
	Company             string          `json:"company"`
	HasProductionAccess bool            `json:"has_production_access"`
	Confirmed           bool            `json:"confirmed"`
	ExpiresAt           string          `json:"expires_at,omitempty"`
	LinkedAccounts      []LinkedAccount `json:"linked_accounts,omitempty"`
	LinkedTeam          []LinkedTeam    `json:"linked_teams,omitempty"`
}

type DeveloperProfileReq

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

func (*DeveloperProfileReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeveloperProfileReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeveloperProfileReq) Send

Send sends the request to retrieve the developer's profile.

type DeveloperSetProfileReq

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

func (*DeveloperSetProfileReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*DeveloperSetProfileReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*DeveloperSetProfileReq) Send

func (r *DeveloperSetProfileReq) Send() error

Send sends the request to retrieve the developer's profile.

type Error

type Error struct {
	Errors     []ErrorItem `json:"errors"` // error messages reported by the service
	StatusCode int         // the HTTP status code from the service response
	Status     string      // the HTTP status line from the service response
	Header     http.Header // the HTTP headers from the service response
	RequestID  string      // the ID of the request that generated the error
	URL        string      // the request URL
}

Error contains an error response from a service.

func (*Error) Error

func (e *Error) Error() string

type ErrorItem

type ErrorItem struct {
	Code    string              `json:"code"`    // standard error code
	Message string              `json:"message"` // additional information about the error
	Payload map[string][]string `json:"payload,omitempty"`
}

ErrorItem is a detailed error code & message.

func (*ErrorItem) Description

func (ei *ErrorItem) Description() string

type Frequency

type Frequency string
const (
	FrequencyOnce    Frequency = "once"
	FrequencyDaily   Frequency = "daily"
	FrequencyWeekly  Frequency = "weekly"
	FrequencyMonthly Frequency = "monthly"
	FrequencyYearly  Frequency = "yearly"
)

type GetAccessReq

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

func (*GetAccessReq) ClientID

func (r *GetAccessReq) ClientID(id string) *GetAccessReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*GetAccessReq) Context

func (r *GetAccessReq) Context(ctx context.Context) *GetAccessReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*GetAccessReq) Send

func (r *GetAccessReq) Send() (*Access, error)

Send sends the request to get details of a bank access.

type GetAccountReq

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

func (*GetAccountReq) ClientID

func (r *GetAccountReq) ClientID(id string) *GetAccountReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*GetAccountReq) Context

func (r *GetAccountReq) Context(ctx context.Context) *GetAccountReq

func (*GetAccountReq) Send

func (r *GetAccountReq) Send() (*Account, error)

type GetApplicationSettingsReq

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

func (*GetApplicationSettingsReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*GetApplicationSettingsReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*GetApplicationSettingsReq) Send

Send sends the request to retrieve the developer's profile.

type GetCredentialReq added in v0.4.0

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

func (*GetCredentialReq) ClientID added in v0.4.0

func (r *GetCredentialReq) ClientID(id string) *GetCredentialReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*GetCredentialReq) Context added in v0.4.0

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*GetCredentialReq) Send added in v0.4.0

func (r *GetCredentialReq) Send() (*Credential, error)

type GetRepeatedTransactionReq

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

func (*GetRepeatedTransactionReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*GetRepeatedTransactionReq) Context

func (*GetRepeatedTransactionReq) Send

type GetScheduledTransactionReq

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

func (*GetScheduledTransactionReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*GetScheduledTransactionReq) Context

func (*GetScheduledTransactionReq) Send

type GetTransactionReq

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

func (*GetTransactionReq) ClientID

func (r *GetTransactionReq) ClientID(id string) *GetTransactionReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*GetTransactionReq) Context

func (*GetTransactionReq) Send

func (r *GetTransactionReq) Send() (*Transaction, error)

type GetWebhookReq

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

func (*GetWebhookReq) ClientID

func (r *GetWebhookReq) ClientID(id string) *GetWebhookReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*GetWebhookReq) Context

func (r *GetWebhookReq) Context(ctx context.Context) *GetWebhookReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*GetWebhookReq) Send

func (r *GetWebhookReq) Send() (*Webhook, error)

type IBANAccount

type IBANAccount struct {
	IBAN     string `json:"IBAN"`     // the validated IBAN
	Provider string `json:"provider"` // the authoritative provider, IBO for IBANs
}

type IBANBank

type IBANBank struct {
	ID             string `json:"id"`              // the bank identity assigned by the identity provider
	Label          string `json:"label"`           // the bank name
	Country        string `json:"country"`         // the country (e.g. DE)
	Provider       string `json:"provider"`        //  the identity provider (e.g. BIC)
	ServiceContext string `json:"service_context"` // the service context, (e.g. SEPA)
}

type IBANDetails

type IBANDetails struct {
	Account IBANAccount `json:"acc_ref"`
	Banks   []IBANBank  `json:"fis"`
}

type IBANService

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

IBANService provides access to IBAN related API services.

func NewIBANService

func NewIBANService(c *AppClient) *IBANService

func (*IBANService) Validate

func (a *IBANService) Validate(iban string) *ValidateIBANReq

Validate returns a request that may be used to validate an IBAN.

type Job

type Job struct {
	URI string `json:"uri"`
}

type JobAccess

type JobAccess struct {
	ID         int64        `json:"id,omitempty"`
	ProviderID string       `json:"provider_id,omitempty"`
	Name       string       `json:"name,omitempty"`
	Accounts   []JobAccount `json:"accounts,omitempty"`
}

type JobAccount

type JobAccount struct {
	ID         int64     `json:"id,omitempty"`
	Name       string    `json:"name"`
	Number     string    `json:"number"`
	IBAN       string    `json:"iban"`
	ProviderID string    `json:"provider_id,omitempty"`
	Errors     []Problem `json:"errors"`
}

type JobAnswerReq

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

func (*JobAnswerReq) ChallengeAnswer

func (r *JobAnswerReq) ChallengeAnswer(answer ChallengeAnswer) *JobAnswerReq

ChallengeAnswer adds an answer to one of the authorisation challenges required to complete the job.

func (*JobAnswerReq) ClientID

func (r *JobAnswerReq) ClientID(id string) *JobAnswerReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*JobAnswerReq) Context

func (r *JobAnswerReq) Context(ctx context.Context) *JobAnswerReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*JobAnswerReq) Send

func (r *JobAnswerReq) Send() error

Send sends the request to get answer a challenge needed by a job.

type JobCancelReq

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

func (*JobCancelReq) ClientID

func (r *JobCancelReq) ClientID(id string) *JobCancelReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*JobCancelReq) Context

func (r *JobCancelReq) Context(ctx context.Context) *JobCancelReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*JobCancelReq) Send

func (r *JobCancelReq) Send() error

Send sends the request to cancel a job.

type JobConsent added in v0.6.0

type JobConsent struct {
	ID          string `json:"id,omitempty"`
	AuthURL     string `json:"auth_url,omitempty"`
	AuthMessage string `json:"auth_message,omitempty"`
}

type JobGetReq

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

func (*JobGetReq) ClientID

func (r *JobGetReq) ClientID(id string) *JobGetReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*JobGetReq) Context

func (r *JobGetReq) Context(ctx context.Context) *JobGetReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*JobGetReq) Send

func (r *JobGetReq) Send() (*JobStatus, error)

Send sends the request to get details of a job.

type JobStage

type JobStage string
const (
	JobStageUnauthenticated JobStage = "unauthenticated"
	JobStageAuthenticated   JobStage = "authenticated"
	JobStageChallenge       JobStage = "challenge"
	JobStageImported        JobStage = "imported"
	JobStageCancelled       JobStage = "cancelled"
	JobStageProblem         JobStage = "problem"
	JobStageConsent         JobStage = "consent"
)

type JobStatus

type JobStatus struct {
	Finished  bool        `json:"finished"`
	Stage     JobStage    `json:"stage"`
	Challenge *Challenge  `json:"challenge,omitempty"`
	URI       string      `json:"uri,omitempty"`
	Errors    []Problem   `json:"errors,omitempty"`
	Access    *JobAccess  `json:"access,omitempty"`
	Consent   *JobConsent `json:"consent,omitempty"`
}

type JobsService

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

JobsService provides access to jobs related API services.

func NewJobsService

func NewJobsService(u *UserClient) *JobsService

func (*JobsService) Answer

func (j *JobsService) Answer(uri string) *JobAnswerReq

Answer returns a request that may be used to answer a challenge needed by a job

func (*JobsService) Cancel

func (j *JobsService) Cancel(uri string) *JobCancelReq

Cancel returns a request that may be used to cancel a job.

func (*JobsService) Get

func (j *JobsService) Get(uri string) *JobGetReq

Get returns a request that may be used to get the details of a job.

type LinkedAccount added in v0.4.0

type LinkedAccount struct {
	Type     LinkedAccountType `json:"type"`
	ID       string            `json:"id"`
	Title    string            `json:"title"`
	UserName string            `json:"user_name"`
	SyncTime string            `json:"sync_time"`
}

type LinkedAccountType added in v0.4.0

type LinkedAccountType int
const (
	LinkedAccountTypeRegular       LinkedAccountType = 0
	LinkedAccountTypeAuthorization LinkedAccountType = 1
)

type LinkedTeam added in v0.4.0

type LinkedTeam struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Active bool   `json:"active"`
	Owner  bool   `json:"owner"`
}

type ListAccessesReq

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

func (*ListAccessesReq) ClientID

func (r *ListAccessesReq) ClientID(id string) *ListAccessesReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListAccessesReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ListAccessesReq) Send

func (r *ListAccessesReq) Send() (*AccessPage, error)

type ListAccountsReq

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

func (*ListAccountsReq) ClientID

func (r *ListAccountsReq) ClientID(id string) *ListAccountsReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListAccountsReq) Context

func (*ListAccountsReq) Send

func (r *ListAccountsReq) Send() (*AccountPage, error)

type ListAppKeysReq added in v0.2.8

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

func (*ListAppKeysReq) ClientID added in v0.2.8

func (r *ListAppKeysReq) ClientID(id string) *ListAppKeysReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListAppKeysReq) Context added in v0.2.8

func (r *ListAppKeysReq) Context(ctx context.Context) *ListAppKeysReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ListAppKeysReq) Send added in v0.2.8

func (r *ListAppKeysReq) Send() (*ApplicationKeyPage, error)

type ListApplicationsReq

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

func (*ListApplicationsReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListApplicationsReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ListApplicationsReq) Send

type ListCredentialProvidersReq added in v0.4.0

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

func (*ListCredentialProvidersReq) ClientID added in v0.4.0

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListCredentialProvidersReq) Context added in v0.4.0

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ListCredentialProvidersReq) Send added in v0.4.0

type ListCredentialsReq added in v0.4.0

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

func (*ListCredentialsReq) ClientID added in v0.4.0

func (r *ListCredentialsReq) ClientID(id string) *ListCredentialsReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListCredentialsReq) Context added in v0.4.0

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ListCredentialsReq) Send added in v0.4.0

type ListDevUsersReq

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

func (*ListDevUsersReq) ClientID

func (r *ListDevUsersReq) ClientID(id string) *ListDevUsersReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListDevUsersReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ListDevUsersReq) Cursor

func (r *ListDevUsersReq) Cursor(cursor string) *ListDevUsersReq

func (*ListDevUsersReq) Limit

func (r *ListDevUsersReq) Limit(v int) *ListDevUsersReq

func (*ListDevUsersReq) Send

func (r *ListDevUsersReq) Send() (*UserListPage, error)

type ListRepeatedTransactionsReq

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

func (*ListRepeatedTransactionsReq) AccessID

func (*ListRepeatedTransactionsReq) AccountID

func (*ListRepeatedTransactionsReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListRepeatedTransactionsReq) Context

func (*ListRepeatedTransactionsReq) Limit

func (*ListRepeatedTransactionsReq) Offset

func (*ListRepeatedTransactionsReq) Send

type ListScheduledTransactionsReq

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

func (*ListScheduledTransactionsReq) AccessID

func (*ListScheduledTransactionsReq) AccountID

func (*ListScheduledTransactionsReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListScheduledTransactionsReq) Context

func (*ListScheduledTransactionsReq) Send

type ListTransactionsReq

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

func (*ListTransactionsReq) AccessID

func (*ListTransactionsReq) AccountID

func (r *ListTransactionsReq) AccountID(id int64) *ListTransactionsReq

func (*ListTransactionsReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListTransactionsReq) Context

func (*ListTransactionsReq) Limit

func (r *ListTransactionsReq) Limit(limit int) *ListTransactionsReq

func (*ListTransactionsReq) Offset

func (r *ListTransactionsReq) Offset(offset int) *ListTransactionsReq

func (*ListTransactionsReq) Send

func (*ListTransactionsReq) Since

type ListWebhookReq

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

func (*ListWebhookReq) ClientID

func (r *ListWebhookReq) ClientID(id string) *ListWebhookReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ListWebhookReq) Context

func (r *ListWebhookReq) Context(ctx context.Context) *ListWebhookReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ListWebhookReq) Send

func (r *ListWebhookReq) Send() (*WebhookPage, error)

type LostPasswordReq

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

func (*LostPasswordReq) ClientID

func (r *LostPasswordReq) ClientID(id string) *LostPasswordReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*LostPasswordReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*LostPasswordReq) Send

func (r *LostPasswordReq) Send() error

Send sends the lost password request.

type Merchant

type Merchant struct {
	Name string `json:"name"`
}

type MerchantsStats

type MerchantsStats struct {
	From   string                `json:"from_date"`
	To     string                `json:"to_date"`
	Domain string                `json:"domain"`
	Stats  []DailyMerchantsStats `json:"stats"`
}

type MoneyAmount

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

type NameValue

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

type OriginalAmount added in v0.2.2

type OriginalAmount struct {
	Value        *MoneyAmount `json:"value"`
	ExchangeRate string       `json:"exchange_rate"`
}

type PageParams

type PageParams struct {
	Cursor string `json:"cursor"`
	Limit  int    `json:"limit"`
}

type PaymentTransferCancelParams

type PaymentTransferCancelParams struct {
	ID      string `json:"id"`
	Version int    `json:"version"`
}

type Period added in v0.1.3

type Period struct {
	Type   string `json:"type"`
	Repeat int    `json:"repeat"`
}

type Problem

type Problem struct {
	Domain                     string                 `json:"domain"`
	Code                       string                 `json:"code"`
	Info                       map[string]interface{} `json:"info"`
	ContainsPrivateInformation bool                   `json:"contains_private_information"`
}

type ProcessRecurringTransferReq

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

func (*ProcessRecurringTransferReq) ChallengeAnswer

ChallengeAnswer adds an answer to one of the authorisation challenges required to complete the transfer.

func (*ProcessRecurringTransferReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ProcessRecurringTransferReq) Confirm

Confirm sets whether the user has confirmed a transfer that appears to be similar to another that was recently sent.

func (*ProcessRecurringTransferReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ProcessRecurringTransferReq) Send

Send sends the request to update information and answer challenges for a transfer.

type ProcessTransferReq

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

func (*ProcessTransferReq) ChallengeAnswer

func (r *ProcessTransferReq) ChallengeAnswer(answer ChallengeAnswer) *ProcessTransferReq

ChallengeAnswer adds an answer to one of the authorisation challenges required to complete the transfer.

func (*ProcessTransferReq) ClientID

func (r *ProcessTransferReq) ClientID(id string) *ProcessTransferReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ProcessTransferReq) Confirm

func (r *ProcessTransferReq) Confirm(confirm bool) *ProcessTransferReq

Confirm sets whether the user has confirmed a transfer that appears to be similar to another that was recently sent.

func (*ProcessTransferReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ProcessTransferReq) Send

func (r *ProcessTransferReq) Send() (*Transfer, error)

Send sends the request to update information and answer challenges for a transfer.

type Provider

type Provider struct {
	ID          string             `json:"id"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Country     string             `json:"country"`
	URL         string             `json:"url"`
	Address     string             `json:"address"`
	PostalCode  string             `json:"postal_code"`
	Operations  ProviderOperations `json:"operations"`
	Challenges  []ChallengeSpec    `json:"challenges"`
}

type ProviderAllowedOperations added in v0.4.0

type ProviderAllowedOperations struct {
	PaymentTransfer     bool `json:"transfer"`
	AccountStatement    bool `json:"statement"`
	AccountBalance      bool `json:"balance"`
	CreditCardStatement bool `json:"-"`
	CreditCardBalance   bool `json:"-"`
	CreateRecTrf        bool `json:"create_recurring_transfer"`
	ReadRecTrf          bool `json:"read_recurring_transfer"`
	UpdateRecTrf        bool `json:"update_recurring_transfer"`
	DeleteRecTrf        bool `json:"delete_recurring_transfer"`
	ReadBeneficiaries   bool `json:"beneficiaries"`
}

type ProviderOperations added in v0.4.0

type ProviderOperations struct {
	Adapter           string                    `json:"adapter"`
	AllowedOperations ProviderAllowedOperations `json:"allowed_operations,omitempty" `
}

type ProviderSearchResult

type ProviderSearchResult struct {
	Score    float64  `json:"score"`
	Provider Provider `json:"provider"`
}

type ProviderSearchResults

type ProviderSearchResults []ProviderSearchResult

type ProvidersGetReq

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

func (*ProvidersGetReq) ClientID

func (r *ProvidersGetReq) ClientID(id string) *ProvidersGetReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ProvidersGetReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ProvidersGetReq) Send

func (r *ProvidersGetReq) Send() (*Provider, error)

Send sends the request to get a single financial provider.

type ProvidersSearchReq

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

func (*ProvidersSearchReq) ClientID

func (r *ProvidersSearchReq) ClientID(id string) *ProvidersSearchReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ProvidersSearchReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ProvidersSearchReq) Send

Send sends the request to search providers.

type ProvidersService

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

ProvidersService provides access to financial provider related API services.

func NewProvidersService

func NewProvidersService(a *AppClient) *ProvidersService

func (*ProvidersService) Get

Get returns a request that may be used to get the details of a single financial provider.

func (*ProvidersService) Search

func (c *ProvidersService) Search(query string) *ProvidersSearchReq

Search returns a request that may be used to search the list of financial providers.

type ProvidersStats

type ProvidersStats struct {
	From   string                `json:"from_date"`
	To     string                `json:"to_date"`
	Domain string                `json:"domain"`
	Stats  []DailyProvidersStats `json:"stats"`
}

type RecurrenceRule

type RecurrenceRule struct {
	Start     time.Time `json:"start"`
	Until     time.Time `json:"until"`
	Frequency Frequency `json:"frequency"`
	Interval  int       `json:"interval"`
	ByDay     int       `json:"by_day"`
}

type RecurringTransfer

type RecurringTransfer struct {
	ID       string           `json:"id"`
	From     TransferAddress  `json:"from"`
	To       TransferAddress  `json:"to"`
	Amount   MoneyAmount      `json:"amount"`
	Usage    string           `json:"usage"`
	Version  int              `json:"version"`
	Step     TransferStep     `json:"step"`
	State    TransferState    `json:"state"`
	Schedule *RecurrenceRule  `json:"schedule,omitempty"`
	Created  time.Time        `json:"created,omitempty"`
	Updated  time.Time        `json:"updated,omitempty"`
	RemoteID string           `json:"remote_id"`
	Errors   []Problem        `json:"errors,omitempty"`
	Consent  *TransferConsent `json:"consent,omitempty"`
}

type RecurringTransferCapabilities added in v0.1.3

type RecurringTransferCapabilities struct {
	Periods                      []Period `json:"periods"`
	MinimumLeadTimeCreate        int      `json:"minimum_lead_time_create"`
	MaximumLeadTimeCreate        int      `json:"maximum_lead_time_create"`
	MinimumLeadTimeEdit          int      `json:"minimum_lead_time_edit"`
	MaximumLeadTimeEdit          int      `json:"maximum_lead_time_edit"`
	MinimumLeadTimeDelete        int      `json:"minimum_lead_time_delete"`
	MaximumLeadTimeDelete        int      `json:"maximum_lead_time_delete"`
	LastDayOfMonthEnabled        bool     `json:"last_day_of_month_enabled"`
	FirstScheduledDateModifiable bool     `json:"first_scheduled_date_modifiable"`
	TimeUnitModifiable           bool     `json:"time_unit_modifiable"`
	PeriodLengthModifiable       bool     `json:"period_length_modifiable"`
	ScheduledDateModifiable      bool     `json:"scheduled_date_modifiable"`
	LastScheduleDateModifiable   bool     `json:"last_schedule_date_modifiable"`
}

type RecurringTransfersService

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

RecurringTransfersService provides access to recurring money transfer related API services.

func NewRecurringTransfersService

func NewRecurringTransfersService(u *UserClient) *RecurringTransfersService

func (*RecurringTransfersService) Cancel

Cancel returns a request that may be used to cancel an ongoing money transfer.

func (*RecurringTransfersService) Create

Create returns a request that may be used to create a money transfer. from is an account id belonging to the user.

func (*RecurringTransfersService) Process

Process returns a request that may be used to update information and answer challenges for a transfer.

type RefreshAccessReq

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

func (*RefreshAccessReq) ClientID

func (r *RefreshAccessReq) ClientID(id string) *RefreshAccessReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*RefreshAccessReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*RefreshAccessReq) Send

func (r *RefreshAccessReq) Send() (*Job, error)

type RefreshAllAccessesReq

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

func (*RefreshAllAccessesReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*RefreshAllAccessesReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*RefreshAllAccessesReq) Send

func (r *RefreshAllAccessesReq) Send() ([]Job, error)

type RepeatedTransaction

type RepeatedTransaction struct {
	ID            int64          `json:"id"`
	AccessID      int64          `json:"user_bank_access_id,omitempty"`
	UserAccountID int64          `json:"user_bank_account_id,omitempty"`
	UserAccount   AccountRef     `json:"user_account"`
	RemoteAccount AccountRef     `json:"remote_account"`
	RemoteID      string         `json:"remote_id"`
	Schedule      RecurrenceRule `json:"schedule"`
	Amount        *MoneyAmount   `json:"amount"`
	Usage         string         `json:"usage"`
}

type RepeatedTransactionPage

type RepeatedTransactionPage struct {
	Transactions []RepeatedTransaction `json:"data"`
	Total        int                   `json:"total"`
	Limit        int                   `json:"limit"`
	Offset       int                   `json:"offset"`
}

type RepeatedTransactionsService

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

RepeatedTransactionsService provides access to repeated transaction related API services.

func NewRepeatedTransactionsService

func NewRepeatedTransactionsService(u *UserClient) *RepeatedTransactionsService

func (*RepeatedTransactionsService) Delete

Delete returns a request that may be used to delete a repeated transaction.

func (*RepeatedTransactionsService) Get

func (*RepeatedTransactionsService) List

func (*RepeatedTransactionsService) Update

Update returns a request that may be used to update a repeated transaction.

type RequestsStats

type RequestsStats struct {
	From          string               `json:"from_date"`
	To            string               `json:"to_date"`
	Domain        string               `json:"domain"`
	RequestsTotal StatsValueChange     `json:"requests_total"`
	RequestsToday StatsValueChange     `json:"requests_today"`
	Stats         []DailyRequestsStats `json:"stats"`
}

type ResetDevUsersReq

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

func (*ResetDevUsersReq) ClientID

func (r *ResetDevUsersReq) ClientID(id string) *ResetDevUsersReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ResetDevUsersReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ResetDevUsersReq) Send

Send sends the request to reset user data.

type ResetPasswordReq

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

func (*ResetPasswordReq) ClientID

func (r *ResetPasswordReq) ClientID(id string) *ResetPasswordReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ResetPasswordReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ResetPasswordReq) Send

func (r *ResetPasswordReq) Send() error

Send sends the reset password request.

type ResetUserOutcome

type ResetUserOutcome struct {
	Username string    `json:"username"`
	Problems []Problem `json:"problems"`
}

type ResetUserPasswordReq

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

func (*ResetUserPasswordReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ResetUserPasswordReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ResetUserPasswordReq) Send

func (r *ResetUserPasswordReq) Send() error

Send sends the request to reset a user's password.

type ResetUsersResponse

type ResetUsersResponse struct {
	Users []ResetUserOutcome `json:"users"`
}

type RetryPolicy added in v0.1.3

type RetryPolicy struct {
	// MaxRetries is the maximum number of requests that will be made after the original request.
	MaxRetries int

	// Wait is the base time to wait between attempts.
	Wait time.Duration

	// MaxWait is the maximum length of time to wait between retries.
	MaxWait time.Duration

	// Multiplier is the multiplier applied to Wait on each retry after the first. Set to zero
	// to implement a linear backoff.
	Multiplier float64

	// Jitter controls the amount of randomness applied to each wait period. A
	// random amount of time up to +/- Jitter is added to the period.
	Jitter time.Duration
}

func (RetryPolicy) NextWait added in v0.1.3

func (r RetryPolicy) NextWait(requestsAttempted int) time.Duration

type ScheduledTransactionsService

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

ScheduledTransactionsService provides access to scheduled transaction related API services.

func NewScheduledTransactionsService

func NewScheduledTransactionsService(u *UserClient) *ScheduledTransactionsService

func (*ScheduledTransactionsService) Get

func (*ScheduledTransactionsService) List

type ScheduledTransferCapabilities added in v0.1.3

type ScheduledTransferCapabilities struct {
	Supported bool `json:"supported"`
}

type StatsMerchantsReq

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

func (*StatsMerchantsReq) ClientID

func (r *StatsMerchantsReq) ClientID(id string) *StatsMerchantsReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*StatsMerchantsReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*StatsMerchantsReq) FromDate

func (r *StatsMerchantsReq) FromDate(date time.Time) *StatsMerchantsReq

func (*StatsMerchantsReq) Send

func (r *StatsMerchantsReq) Send() (*MerchantsStats, error)

func (*StatsMerchantsReq) ToDate

func (r *StatsMerchantsReq) ToDate(date time.Time) *StatsMerchantsReq

type StatsMoneyAmount

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

type StatsProvidersReq

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

func (*StatsProvidersReq) ClientID

func (r *StatsProvidersReq) ClientID(id string) *StatsProvidersReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*StatsProvidersReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*StatsProvidersReq) FromDate

func (r *StatsProvidersReq) FromDate(date time.Time) *StatsProvidersReq

func (*StatsProvidersReq) Send

func (r *StatsProvidersReq) Send() (*ProvidersStats, error)

func (*StatsProvidersReq) ToDate

func (r *StatsProvidersReq) ToDate(date time.Time) *StatsProvidersReq

type StatsRequestsReq

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

func (*StatsRequestsReq) ClientID

func (r *StatsRequestsReq) ClientID(id string) *StatsRequestsReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*StatsRequestsReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*StatsRequestsReq) FromDate

func (r *StatsRequestsReq) FromDate(date time.Time) *StatsRequestsReq

func (*StatsRequestsReq) Send

func (r *StatsRequestsReq) Send() (*RequestsStats, error)

func (*StatsRequestsReq) ToDate

func (r *StatsRequestsReq) ToDate(date time.Time) *StatsRequestsReq

type StatsService

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

StatsService provides access to statistic related API services.

func NewStatsService

func NewStatsService(c *DevClient) *StatsService

func (*StatsService) Merchants

func (d *StatsService) Merchants() *StatsMerchantsReq

func (*StatsService) Providers

func (d *StatsService) Providers() *StatsProvidersReq

func (*StatsService) Requests

func (d *StatsService) Requests() *StatsRequestsReq

func (*StatsService) Transfers

func (d *StatsService) Transfers() *StatsTransfersReq

func (*StatsService) Users

func (d *StatsService) Users() *StatsUsersReq

type StatsTransfersReq

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

func (*StatsTransfersReq) ClientID

func (r *StatsTransfersReq) ClientID(id string) *StatsTransfersReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*StatsTransfersReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*StatsTransfersReq) FromDate

func (r *StatsTransfersReq) FromDate(date time.Time) *StatsTransfersReq

func (*StatsTransfersReq) Send

func (r *StatsTransfersReq) Send() (interface{}, error)

func (*StatsTransfersReq) ToDate

func (r *StatsTransfersReq) ToDate(date time.Time) *StatsTransfersReq

type StatsUsersReq

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

func (*StatsUsersReq) ClientID

func (r *StatsUsersReq) ClientID(id string) *StatsUsersReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*StatsUsersReq) Context

func (r *StatsUsersReq) Context(ctx context.Context) *StatsUsersReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*StatsUsersReq) FromDate

func (r *StatsUsersReq) FromDate(date time.Time) *StatsUsersReq

func (*StatsUsersReq) Send

func (r *StatsUsersReq) Send() (*UsersStats, error)

func (*StatsUsersReq) ToDate

func (r *StatsUsersReq) ToDate(date time.Time) *StatsUsersReq

type StatsValueChange added in v0.4.0

type StatsValueChange struct {
	Value  int64   `json:"value"`
	Change float64 `json:"change"`
}

type TANType

type TANType string
const (
	// TANTypePaymentPin4 is an abstract 4-chars string used to authorise payment
	TANTypePaymentPin4 TANType = "paymentPIN4"
	// TANTypeOptical indicates an optical TAN such as flickering barcodes
	TANTypeOptical TANType = "optical"
	// TANTypeITAN indicates an iTAN (aka indexed TAN) such as a list of TAN numbers with a sequence
	TANTypeITAN TANType = "itan"
	// TANTypeMobile indicates a mobileTAN such as an SMS with a passcode
	TANTypeMobile TANType = "mobile"
	// TANTypeChip indicates a chipTAN provided from a calculator device
	TANTypeChip TANType = "chip"
	// TANTypePush indicates a push push notification to a mobile app
	TANTypePush TANType = "push"
	// TANTypeOTP indicates a one-time password
	TANTypeOTP TANType = "otp"
	// TANTypeUSB indicate a usb based TAN
	TANTypeUSB TANType = "usb"
	// TANTypePhoto indicates a colorised matrix barcode
	TANTypePhoto TANType = "photo"

	TANTypeUnknown TANType = "unknown"
)

type TestWebhookReq

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

func (*TestWebhookReq) ClientID

func (r *TestWebhookReq) ClientID(id string) *TestWebhookReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*TestWebhookReq) Context

func (r *TestWebhookReq) Context(ctx context.Context) *TestWebhookReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*TestWebhookReq) Send

func (r *TestWebhookReq) Send() (*WebhookTestResult, error)

type Transaction

type Transaction struct {
	ID                    int64           `json:"id"`
	AccessID              int64           `json:"user_bank_access_id,omitempty"`
	UserAccountID         int64           `json:"user_bank_account_id,omitempty"`
	UserAccount           AccountRef      `json:"user_account,omitempty"`
	CategoryID            int64           `json:"category_id,omitempty"`
	RepeatedTransactionID int64           `json:"repeated_transaction_id,omitempty"`
	Counterparty          Counterparty    `json:"counterparty,omitempty"`
	RemoteID              string          `json:"remote_id"`
	EntryDate             time.Time       `json:"entry_date,omitempty"`
	SettlementDate        time.Time       `json:"settlement_date,omitempty"`
	Amount                *MoneyAmount    `json:"amount,omitempty"`
	OriginalAmount        *OriginalAmount `json:"original_amount,omitempty"`
	Usage                 string          `json:"usage,omitempty"`
	TransactionType       string          `json:"transaction_type,omitempty"`
	Gvcode                string          `json:"gvcode,omitempty"`
}

type TransactionPage

type TransactionPage struct {
	Transactions []Transaction `json:"data"`
	Total        int           `json:"total"`
	Limit        int           `json:"limit"`
	Offset       int           `json:"offset"`
}

type TransactionsService

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

TransactionsService provides access to transaction related API services.

func NewTransactionsService

func NewTransactionsService(u *UserClient) *TransactionsService

func (*TransactionsService) Get

func (*TransactionsService) List

type Transfer

type Transfer struct {
	ID             string           `json:"id"`
	From           TransferAddress  `json:"from"`
	To             TransferAddress  `json:"to"`
	Amount         *MoneyAmount     `json:"amount"`
	Usage          string           `json:"usage"`
	Version        int              `json:"version"`
	Step           TransferStep     `json:"step"`
	State          TransferState    `json:"state"`
	EntryDate      time.Time        `json:"booking_date,omitempty"`
	SettlementDate time.Time        `json:"effective_date,omitempty"`
	Created        time.Time        `json:"created,omitempty"`
	Updated        time.Time        `json:"updated,omitempty"`
	RemoteID       string           `json:"remote_id"`
	Errors         []Problem        `json:"errors"`
	Consent        *TransferConsent `json:"consent,omitempty"`
}

type TransferAddress

type TransferAddress struct {
	Name      string `json:"name"`
	IBAN      string `json:"iban"`
	AccessID  int64  `json:"bank_access_id,omitempty"`
	AccountID int64  `json:"bank_account_id,omitempty"`
}

type TransferConsent added in v0.6.0

type TransferConsent struct {
	ID          string `json:"id,omitempty"`
	AuthURL     string `json:"auth_url,omitempty"`
	AuthMessage string `json:"auth_message,omitempty"`
}

type TransferIntent

type TransferIntent string
const (
	TransferIntentProvidePIN             TransferIntent = "provide_pin"
	TransferIntentProvideCredentials     TransferIntent = "provide_credentials"
	TransferIntentSelectAuthMethod       TransferIntent = "select_auth_method"
	TransferIntentProvideChallengeAnswer TransferIntent = "provide_challenge_answer"
	TransferIntentConfirmSimilarTransfer TransferIntent = "confirm_similar_transfer"
	TransferIntentConsent                TransferIntent = "consent"
)

type TransferState

type TransferState string
const (
	TransferStateOngoing   TransferState = "ongoing"
	TransferStateSucceeded TransferState = "succeeded"
	TransferStateFailed    TransferState = "failed"
	TransferStateCancelled TransferState = "cancelled"
)

type TransferStep

type TransferStep struct {
	Intent    TransferIntent    `json:"intent,omitempty"`
	Data      *TransferStepData `json:"data,omitempty"`
	Challenge *Challenge        `json:"challenge,omitempty"`
}

type TransferStepData

type TransferStepData struct {
	AuthMethods      []AuthMethod `json:"auth_methods,omitempty"`      // TAN Options
	Challenge        string       `json:"challenge,omitempty"`         // TAN Challenge
	ChallengeMessage string       `json:"challenge_message,omitempty"` // TAN Challenge Message
	TANType          TANType      `json:"tan_type,omitempty"`          // Type of the TAN (optical, itan, unknown)
	Transfers        []Transfer   `json:"transfers,omitempty"`         // Transfer list (similar transfers)
}

type TransferType

type TransferType string
const (
	TransferTypeRecurring TransferType = "recurring"
	TransferTypeRegular   TransferType = "regular"
)

type TransfersService

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

TransfersService provides access to money transfer related API services.

func NewTransfersService

func NewTransfersService(u *UserClient) *TransfersService

func (*TransfersService) Cancel

func (t *TransfersService) Cancel(id string, version int) *CancelTransferReq

Cancel returns a request that may be used to cancel an ongoing money transfer.

func (*TransfersService) Create

Create returns a request that may be used to create a money transfer.

func (*TransfersService) Process

func (t *TransfersService) Process(id string, intent TransferIntent, version int) *ProcessTransferReq

Process returns a request that may be used to update information and answer challenges for a transfer.

type TransfersStats

type TransfersStats struct {
	From     string                `json:"from_date"`
	To       string                `json:"to_date"`
	Domain   string                `json:"domain"`
	TotalOut []StatsMoneyAmount    `json:"total_out"`
	TodayOut []StatsMoneyAmount    `json:"today_out"`
	Stats    []DailyTransfersStats `json:"stats"`
}

type UpdateAccessReq

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

func (*UpdateAccessReq) ChallengeAnswer

func (r *UpdateAccessReq) ChallengeAnswer(answer ChallengeAnswer) *UpdateAccessReq

ChallengeAnswer adds an answer to one of the authorisation challenges required to complete update of the access.

func (*UpdateAccessReq) ClientID

func (r *UpdateAccessReq) ClientID(id string) *UpdateAccessReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*UpdateAccessReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UpdateAccessReq) Send

func (r *UpdateAccessReq) Send() (*Access, error)

type UpdateApplicationReq

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

func (*UpdateApplicationReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*UpdateApplicationReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UpdateApplicationReq) Send

func (r *UpdateApplicationReq) Send() error

type UpdateApplicationSettingsReq

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

func (*UpdateApplicationSettingsReq) BackgroundRefresh

func (r *UpdateApplicationSettingsReq) BackgroundRefresh(value bool) *UpdateApplicationSettingsReq

BackgroundRefresh sets the value of the background_refresh configuration setting.

func (*UpdateApplicationSettingsReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*UpdateApplicationSettingsReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UpdateApplicationSettingsReq) Send

Send sends the request to retrieve the developer's profile.

type UpdateCredentialReq added in v0.4.0

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

func (*UpdateCredentialReq) ClientID added in v0.4.0

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*UpdateCredentialReq) Context added in v0.4.0

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UpdateCredentialReq) Send added in v0.4.0

func (r *UpdateCredentialReq) Send() error

type UpdateRepeatedTransactionReq

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

func (*UpdateRepeatedTransactionReq) ChallengeAnswer

ChallengeAnswer adds an answer to one of the authorisation challenges required to complete the update.

func (*UpdateRepeatedTransactionReq) ClientID

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*UpdateRepeatedTransactionReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UpdateRepeatedTransactionReq) Description

Description sets a human readable description for the transaction.

func (*UpdateRepeatedTransactionReq) Schedule

Schedule sets a recurrence schedule for the transaction.

func (*UpdateRepeatedTransactionReq) Send

Send sends the request to update a repeated transaction. It returns information about the long running recurring transfer job that may be used to track and progress the update.

type UpdateWebhookParams

type UpdateWebhookParams struct {
	URL        string   `json:"url"`
	Events     []string `json:"events"`
	APIVersion int      `json:"api_version"`
}

type UpdateWebhookReq

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

func (*UpdateWebhookReq) ClientID

func (r *UpdateWebhookReq) ClientID(id string) *UpdateWebhookReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*UpdateWebhookReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UpdateWebhookReq) Send

func (r *UpdateWebhookReq) Send() error

type UserClient

type UserClient struct {
	UserID                string
	Accesses              *AccessesService
	Jobs                  *JobsService
	Accounts              *AccountsService
	Transactions          *TransactionsService
	ScheduledTransactions *ScheduledTransactionsService
	RepeatedTransactions  *RepeatedTransactionsService
	Transfers             *TransfersService
	RecurringTransfers    *RecurringTransfersService
	Consents              *ConsentsService
	// contains filtered or unexported fields
}

UserClient is a client used for interacting with services in the context of a registered application and a valid user session. It is safe for concurrent use by multiple goroutines.

func NewUserClient

func NewUserClient(client *http.Client, addr string, userID string, token string, applicationKey string) *UserClient

NewUserClient creates a new user client, ready to use.

func (*UserClient) Delete

func (u *UserClient) Delete(password string) *UserDeleteReq

Delete returns a request that may be used to delete a user account and its associated data. Once this request has been sent the user client is no longer valid and should not be used.

func (*UserClient) Logout

func (u *UserClient) Logout() *UserLogoutReq

Logout returns a request that may be used to log a user out of the Bankrs API. Once this request has been sent the user client is no longer valid and should not be used.

func (*UserClient) SessionToken

func (u *UserClient) SessionToken() string

SessionToken returns the current session token.

type UserCreateReq

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

UserCreateReq is a request that may be used to create a user.

func (*UserCreateReq) ClientID

func (r *UserCreateReq) ClientID(id string) *UserCreateReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*UserCreateReq) Context

func (r *UserCreateReq) Context(ctx context.Context) *UserCreateReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UserCreateReq) Send

func (r *UserCreateReq) Send() (*UserClient, error)

Send sends the request to create the user and returns a client that can be used to access services within the new users's session.

type UserCredentials

type UserCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type UserDeleteReq

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

func (*UserDeleteReq) Context

func (r *UserDeleteReq) Context(ctx context.Context) *UserDeleteReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UserDeleteReq) Send

func (r *UserDeleteReq) Send() (*DeletedUser, error)

Send sends the request to delete a user.

type UserInfo added in v0.6.1

type UserInfo struct {
	PhoneNumber   string     `json:"phone_number,omitempty"`
	LastUpdated   *time.Time `json:"last_updated,omitempty"`
	KYCUpdated    *time.Time `json:"kyc_completed,omitempty"`
	CardActivated *time.Time `json:"card_activated,omitempty"`
	Country       string     `json:"country,omitempty"`
}

UserInfo represents personal information about the user of this access

type UserListPage

type UserListPage struct {
	Users      []string `json:"users,omitempty"`
	NextCursor string   `json:"next,omitempty"`
}

type UserLoginReq

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

func (*UserLoginReq) ClientID

func (r *UserLoginReq) ClientID(id string) *UserLoginReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*UserLoginReq) Context

func (r *UserLoginReq) Context(ctx context.Context) *UserLoginReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UserLoginReq) Send

func (r *UserLoginReq) Send() (*UserClient, error)

Send sends the request to login the user and returns a client that can be used to access services within the new users's session.

type UserLogoutReq

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

func (*UserLogoutReq) ClientID

func (r *UserLogoutReq) ClientID(id string) *UserLogoutReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*UserLogoutReq) Context

func (r *UserLogoutReq) Context(ctx context.Context) *UserLogoutReq

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*UserLogoutReq) Send

func (r *UserLogoutReq) Send() error

type UserToken

type UserToken struct {
	ID    string `json:"id"`    // globally unique identifier for a user
	Token string `json:"token"` // session token
}

type UsersStats

type UsersStats struct {
	From       string            `json:"from_date"`
	To         string            `json:"to_date"`
	Domain     string            `json:"domain"`
	UsersTotal StatsValueChange  `json:"users_total"` // with weekly relative change
	UsersToday StatsValueChange  `json:"users_today"` // with daily relative change
	Stats      []DailyUsersStats `json:"stats"`
}

type ValidateIBANReq

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

ValidateIBANReq is a request that may be used to validate an IBAN.

func (*ValidateIBANReq) ClientID

func (r *ValidateIBANReq) ClientID(id string) *ValidateIBANReq

ClientID sets a client identifier that will be passed to the Bankrs API in the X-Client-Id header.

func (*ValidateIBANReq) Context

Context sets the context to be used during this request. If no context is supplied then the request will use context.Background.

func (*ValidateIBANReq) Send

func (r *ValidateIBANReq) Send() (*IBANDetails, error)

Send sends the request to validate the IBAN and returns details about the IBAN.

type Webhook

type Webhook struct {
	ID          string    `json:"id"`
	URL         string    `json:"url"`
	Events      []string  `json:"events"`
	APIVersion  int       `json:"api_version"`
	Enabled     bool      `json:"enabled"`
	Environment string    `json:"environment"`
	CreatedAt   time.Time `json:"created_at"`
}

type WebhookEventDetail added in v0.4.0

type WebhookEventDetail struct {
	ID          string    `json:"id"`
	Type        string    `json:"type"`
	URL         string    `json:"url"`
	APIVersion  int       `json:"api_version"`
	Environment string    `json:"environment"`
	CreatedAt   time.Time `json:"created_at"`
}

type WebhookPage

type WebhookPage struct {
	Webhooks []Webhook `json:"webhooks,omitempty"`
}

type WebhookPayload added in v0.4.0

type WebhookPayload struct {
	Event WebhookEventDetail     `json:"event"`
	Data  map[string]interface{} `json:"data"`
}

type WebhookTestResponse added in v0.4.0

type WebhookTestResponse struct {
	ID     string `json:"id"`
	Code   int    `json:"code"`
	Status string `json:"status"`
}

type WebhookTestResult

type WebhookTestResult struct {
	Payload  WebhookPayload      `json:"payload"`
	Response WebhookTestResponse `json:"response"`
}

type WebhooksService

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

WebhooksService provides access to webhook related API services.

func NewWebhooksService

func NewWebhooksService(c *DevClient) *WebhooksService

func (*WebhooksService) Create

func (d *WebhooksService) Create(apiVersion int, url string, events []string) *CreateWebhookReq

Create prepares and returns a request to create a new webhook.

func (*WebhooksService) Delete

func (d *WebhooksService) Delete(id string) *DeleteWebhookReq

Delete prepares and returns a request to delete an existing webhook.

func (*WebhooksService) Get

func (d *WebhooksService) Get(id string) *GetWebhookReq

Get prepares and returns a request to get details of an existing webhook.

func (*WebhooksService) List

func (d *WebhooksService) List() *ListWebhookReq

List prepares and returns a request to list details of all webhooks.

func (*WebhooksService) Test

func (d *WebhooksService) Test(id string, event string) *TestWebhookReq

Test prepares and returns a request to test a webhook.

func (*WebhooksService) Update

func (d *WebhooksService) Update(id string, apiVersion int, u string, events []string) *UpdateWebhookReq

Update prepares and returns a request to update an existing webhook.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL