form3

package
v0.0.0-...-382784b Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHost = "http://localhost:8080"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Attributes     *AccountAttributes `json:"attributes,omitempty"`
	ID             string             `json:"id,omitempty"`
	OrganisationID string             `json:"organisation_id,omitempty"`
	Type           string             `json:"type,omitempty"`
	Version        *int64             `json:"version,omitempty"`
}

Represents an account in the form3 org section. See https://api-docs.form3.tech/api.html#organisation-accounts for more information about fields.

type AccountApiResponse

type AccountApiResponse struct {
	Account *Account               `json:"data,omitempty"`
	Links   map[string]interface{} `json:"links,omitempty"`
}

Represents a response sent by the account api

type AccountAttributes

type AccountAttributes struct {
	AccountClassification   *string  `json:"account_classification,omitempty"`
	AccountMatchingOptOut   *bool    `json:"account_matching_opt_out,omitempty"`
	AccountNumber           string   `json:"account_number,omitempty"`
	AlternativeNames        []string `json:"alternative_names,omitempty"`
	BankID                  string   `json:"bank_id,omitempty"`
	BankIDCode              string   `json:"bank_id_code,omitempty"`
	BaseCurrency            string   `json:"base_currency,omitempty"`
	Bic                     string   `json:"bic,omitempty"`
	Country                 *string  `json:"country,omitempty"`
	Iban                    string   `json:"iban,omitempty"`
	JointAccount            *bool    `json:"joint_account,omitempty"`
	Name                    []string `json:"name,omitempty"`
	SecondaryIdentification string   `json:"secondary_identification,omitempty"`
	Status                  *string  `json:"status,omitempty"`
	Switched                *bool    `json:"switched,omitempty"`
}

Contains important attributes of an account

type AccountService

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

AccountService exposes the account related functions in the Form3 API

Form3 API docs: https://www.api-docs.form3.tech/api/tutorials/getting-started/introduction/form3-api

func (*AccountService) Create

func (a *AccountService) Create(ctx context.Context, createAccountRequest CreateAccountRequest) CreateAccountResult

Creates a new account using the information provided in the request body

Form3 API docs: https://www.api-docs.form3.tech/api/tutorials/getting-started/introduction/form3-api

func (*AccountService) Delete

func (a *AccountService) Delete(ctx context.Context, deleteAccountRequest DeleteAccountRequest) DeleteAccountResult

Delete an account by ID

Form3 API docs: https://www.api-docs.form3.tech/api/tutorials/getting-started/introduction/form3-api

func (*AccountService) FetchById

func (a *AccountService) FetchById(ctx context.Context, fetchAccountRequest FetchAccountRequest) FetchAccountResult

Fetches an account by its ID

Form3 API docs: https://www.api-docs.form3.tech/api/tutorials/getting-started/introduction/form3-api

type Client

type Client struct {
	BaseURL  *url.URL        // The base url for the API call
	Accounts *AccountService // The Account Service is used for talking to the Account related parts of the API.
	// contains filtered or unexported fields
}

The Client communicates with the Form3 API.

func NewClient

func NewClient() *Client

Creates a new client instance.

func (*Client) Client

func (c *Client) Client() *http.Client

Returns the http client that is used by the Form3 client

func (*Client) HandleRequest

func (c *Client) HandleRequest(ctx context.Context, request *http.Request, body interface{}) (*http.Response, error)

Sends an API request and receives the AP?I response. The response is encoded as a JSON, and is contained in the address pointed to by the 'body' parameter.

func (*Client) NewAPIRequest

func (c *Client) NewAPIRequest(requestType string, url string, body interface{}) (*http.Request, error)

Creates a new API request.

type CreateAccountRequest

type CreateAccountRequest struct {
	Account *Account `json:"data,omitempty"`
}

Represents a request for creating a new account

type CreateAccountResult

type CreateAccountResult struct {
	Account  *Account       `json:"data,omitempty"`
	Response *http.Response `json:"response,omitempty"`
	Error    error          `json:"error,omitempty"`
}

Represents the result of an account creation operation

type DeleteAccountRequest

type DeleteAccountRequest struct {
	ID string `json:"id,omitempty"`
}

Represents a request for deleting an account

type DeleteAccountResult

type DeleteAccountResult struct {
	Response *http.Response `json:"response,omitempty"`
	Error    error          `json:"error,omitempty"`
}

Represents the result of a delete account operation

type FetchAccountRequest

type FetchAccountRequest struct {
	ID string `json:"id,omitempty"`
}

Represents a request for fetching an account

type FetchAccountResult

type FetchAccountResult struct {
	Account  *Account       `json:"data,omitempty"`
	Response *http.Response `json:"response,omitempty"`
	Error    error          `json:"error,omitempty"`
}

Represents the result of an fetch account operation

Jump to

Keyboard shortcuts

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