Documentation
¶
Index ¶
- type APIError
- type Account
- type Client
- func (c *Client) CreateSync(ctx context.Context, accountID, subtype string) (*Synchronization, error)
- func (c *Client) GetAccount(ctx context.Context, id string) (*Account, error)
- func (c *Client) GetFinancialInstitution(ctx context.Context, id string) (*FinancialInstitution, error)
- func (c *Client) GetOrganization(ctx context.Context) (*Organization, error)
- func (c *Client) GetSync(ctx context.Context, id string) (*Synchronization, error)
- func (c *Client) GetTransaction(ctx context.Context, accountID, transactionID string) (*Transaction, error)
- func (c *Client) ListAccounts(ctx context.Context) ([]Account, error)
- func (c *Client) ListFinancialInstitutions(ctx context.Context) ([]FinancialInstitution, error)
- func (c *Client) ListPendingTransactions(ctx context.Context, accountID string) ([]PendingTransaction, error)
- func (c *Client) ListSyncs(ctx context.Context, accountID string, limit int) ([]Synchronization, error)
- func (c *Client) ListTransactions(ctx context.Context, accountID string, opts TransactionListOptions) ([]Transaction, error)
- func (c *Client) WaitForSync(ctx context.Context, id string) (*Synchronization, error)
- type DataWrapper
- type FinancialInstitution
- type Links
- type ListMeta
- type ListWrapper
- type Organization
- type Paging
- type PendingTransaction
- type Resource
- type RetryTransport
- type Synchronization
- type Transaction
- type TransactionListOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID string `json:"id"`
Description string `json:"description"`
Reference string `json:"reference"` // IBAN
Product string `json:"product"`
Currency string `json:"currency"`
CurrentBalance float64 `json:"currentBalance"`
AvailableBalance float64 `json:"availableBalance"`
Deprecated bool `json:"deprecated"`
}
Account represents a Ponto account.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Ponto API client.
func NewClientFromContext ¶
NewClientFromContext creates a client from context.
func (*Client) CreateSync ¶
func (c *Client) CreateSync(ctx context.Context, accountID, subtype string) (*Synchronization, error)
CreateSync creates a new synchronization.
func (*Client) GetAccount ¶
GetAccount returns a single account.
func (*Client) GetFinancialInstitution ¶
func (c *Client) GetFinancialInstitution(ctx context.Context, id string) (*FinancialInstitution, error)
GetFinancialInstitution returns a single financial institution.
func (*Client) GetOrganization ¶
func (c *Client) GetOrganization(ctx context.Context) (*Organization, error)
GetOrganization returns the organization info.
func (*Client) GetTransaction ¶
func (c *Client) GetTransaction(ctx context.Context, accountID, transactionID string) (*Transaction, error)
GetTransaction returns a single transaction.
func (*Client) ListAccounts ¶
ListAccounts returns all accounts.
func (*Client) ListFinancialInstitutions ¶
func (c *Client) ListFinancialInstitutions(ctx context.Context) ([]FinancialInstitution, error)
ListFinancialInstitutions returns all financial institutions.
func (*Client) ListPendingTransactions ¶
func (c *Client) ListPendingTransactions(ctx context.Context, accountID string) ([]PendingTransaction, error)
ListPendingTransactions returns pending transactions for an account.
func (*Client) ListSyncs ¶
func (c *Client) ListSyncs(ctx context.Context, accountID string, limit int) ([]Synchronization, error)
ListSyncs returns recent synchronizations for an account.
func (*Client) ListTransactions ¶
func (c *Client) ListTransactions(ctx context.Context, accountID string, opts TransactionListOptions) ([]Transaction, error)
ListTransactions returns transactions for an account.
func (*Client) WaitForSync ¶
WaitForSync waits for a sync to complete.
type DataWrapper ¶
type DataWrapper[T any] struct { Data T `json:"data"` }
DataWrapper wraps a single resource.
type FinancialInstitution ¶
type FinancialInstitution struct {
ID string `json:"id"`
Name string `json:"name"`
Country string `json:"country"`
Status string `json:"status"`
MaintenanceFrom string `json:"maintenanceFrom,omitempty"`
MaintenanceTo string `json:"maintenanceTo,omitempty"`
}
FinancialInstitution represents a bank.
type Links ¶
type Links struct {
First string `json:"first,omitempty"`
Last string `json:"last,omitempty"`
Prev string `json:"prev,omitempty"`
Next string `json:"next,omitempty"`
}
Links for pagination.
type ListMeta ¶
type ListMeta struct {
Paging *Paging `json:"paging,omitempty"`
}
ListMeta contains pagination metadata.
type ListWrapper ¶
type ListWrapper[T any] struct { Data []T `json:"data"` Links *Links `json:"links,omitempty"` Meta *ListMeta `json:"meta,omitempty"` }
ListWrapper wraps a list of resources.
type Organization ¶
Organization represents the user's organization.
type Paging ¶
type Paging struct {
Before string `json:"before,omitempty"`
After string `json:"after,omitempty"`
Limit int `json:"limit,omitempty"`
}
Paging contains cursor info.
type PendingTransaction ¶
type PendingTransaction struct {
ID string `json:"id"`
Amount float64 `json:"amount"`
Currency string `json:"currency"`
Description string `json:"description"`
CounterpartName string `json:"counterpartName"`
CounterpartRef string `json:"counterpartReference"`
RemittanceInfo string `json:"remittanceInformation"`
ValueDate string `json:"valueDate"`
}
PendingTransaction represents a pending transaction.
type Resource ¶
type Resource struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes map[string]any `json:"attributes"`
}
Resource represents a JSON:API resource.
type RetryTransport ¶
type RetryTransport struct {
Base http.RoundTripper
NoRetry bool
BaseDelay time.Duration
}
RetryTransport wraps an http.RoundTripper with retry logic.
func NewRetryTransport ¶
func NewRetryTransport(base http.RoundTripper, noRetry bool) *RetryTransport
NewRetryTransport creates a RetryTransport with defaults.
type Synchronization ¶
type Synchronization struct {
ID string `json:"id"`
Subtype string `json:"subtype"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
Errors []struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"errors,omitempty"`
}
Synchronization represents a sync operation.
type Transaction ¶
type Transaction struct {
ID string `json:"id"`
Amount float64 `json:"amount"`
Currency string `json:"currency"`
Description string `json:"description"`
CounterpartName string `json:"counterpartName"`
CounterpartRef string `json:"counterpartReference"`
RemittanceInfo string `json:"remittanceInformation"`
RemittanceInfoType string `json:"remittanceInformationType"`
EndToEndID string `json:"endToEndId"`
InternalRef string `json:"internalReference"`
BankTransactionCode string `json:"bankTransactionCode"`
ExecutionDate string `json:"executionDate"`
ValueDate string `json:"valueDate"`
}
Transaction represents a Ponto transaction.
type TransactionListOptions ¶
TransactionListOptions for filtering transactions.