Documentation ¶
Index ¶
- func CheckResponse(r *http.Response) ([]byte, error)
- type Account
- type AccountAttributes
- type AccountData
- type AccountResponse
- type AccountResponseData
- type AccountsService
- func (s *AccountsService) CreateAccount(ctx context.Context, body *Account) (*AccountResponse, *Response, error)
- func (s *AccountsService) DeleteAccount(ctx context.Context, options *DeleteOptions) (*Response, error)
- func (s *AccountsService) GetAccount(ctx context.Context, id string) (*AccountResponse, *Response, error)
- type Client
- type DeleteOptions
- type ErrorResponse
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct {
Data *AccountData `json:"data"`
}
Account represents an account.
type AccountAttributes ¶
type AccountAttributes struct { AccountClassification string `json:"account_classification"` AccountMatchingOptOut bool `json:"account_matching_opt_out"` AccountNumber string `json:"account_number"` AlternativeNames []string `json:"alternative_names"` BankID string `json:"bank_id"` BankIDCode string `json:"bank_id_code"` BaseCurrency string `json:"base_currency"` Bic string `json:"bic"` Country string `json:"country"` Iban string `json:"iban"` JointAccount bool `json:"joint_account"` Name []string `json:"name"` SecondaryIdentification string `json:"secondary_identification"` Status *string `json:"status,omitempty"` Switched bool `json:"switched"` }
AccountAttributes represents account attributes for an account.
type AccountData ¶
type AccountData struct { Attributes *AccountAttributes `json:"attributes"` ID string `json:"id"` OrganisationID string `json:"organisation_id"` Type string `json:"type"` Version int64 `json:"version"` }
AccountData represents data related to an account.
type AccountResponse ¶
type AccountResponse struct { Account *AccountResponseData `json:"data"` Self string `json:"self"` }
AccountResponse represents the response for a fetched account.
type AccountResponseData ¶
type AccountResponseData struct { Attributes *AccountAttributes `json:"attributes"` CreatedOn time.Time `json:"created_on"` ID string `json:"id"` ModifiedOn time.Time `json:"modified_on"` OrganisationID string `json:"organisation_id"` Type string `json:"type"` Version int `json:"version"` }
AccountResponseData represents the response data related to a fetched account.
type AccountsService ¶
type AccountsService service
AccountsService handles communication with the Account resource methods of the Form3 API.
Form3 API docs: https://www.api-docs.form3.tech/api/schemes/bacs/accounts/resource-types
func (*AccountsService) CreateAccount ¶
func (s *AccountsService) CreateAccount(ctx context.Context, body *Account) (*AccountResponse, *Response, error)
CreateAccount creates an account.
Form3 API docs: https://www.api-docs.form3.tech/api/schemes/bacs/accounts/create-an-account
func (*AccountsService) DeleteAccount ¶
func (s *AccountsService) DeleteAccount(ctx context.Context, options *DeleteOptions) (*Response, error)
DeleteAccount deletes an account.
Form3 API docs: https://www.api-docs.form3.tech/api/schemes/bacs/accounts/delete-an-account
func (*AccountsService) GetAccount ¶
func (s *AccountsService) GetAccount(ctx context.Context, id string) (*AccountResponse, *Response, error)
GetAccount fetches an account.
Form3 API docs: https://www.api-docs.form3.tech/api/schemes/bacs/accounts/fetch-an-account
type Client ¶
type Client struct { BaseUrl *url.URL Accounts *AccountsService // contains filtered or unexported fields }
Client manages communication with the Form3 API.
type DeleteOptions ¶
DeleteOptions represents URL parameters for the DELETE endpoint.
type ErrorResponse ¶
ErrorResponse represents an error response with a status code and an error message.
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
Error formats the ErrorResponse.