Documentation
¶
Index ¶
- func SanitizeURL(token string, u *url.URL) *url.URL
- type ByPeriodOptions
- type Client
- type ErrorResponse
- type ExportFormat
- type ExportOptions
- type ExportStatementOptions
- type GetStatementOptions
- type SetLastDownloadDateOptions
- type SetLastDownloadIDOptions
- type StatementInfo
- type Transaction
- type TransactionsResponse
- type TransactionsService
- func (s *TransactionsService) ByPeriod(ctx context.Context, opts ByPeriodOptions) (*TransactionsResponse, error)
- func (s *TransactionsService) Export(ctx context.Context, opts ExportOptions, w io.Writer) error
- func (s *TransactionsService) ExportStatement(ctx context.Context, opts ExportStatementOptions, w io.Writer) error
- func (s *TransactionsService) GetStatement(ctx context.Context, opts GetStatementOptions) (*TransactionsResponse, error)
- func (s *TransactionsService) SetLastDownloadDate(ctx context.Context, opts SetLastDownloadDateOptions) error
- func (s *TransactionsService) SetLastDownloadID(ctx context.Context, opts SetLastDownloadIDOptions) error
- func (s *TransactionsService) SinceLastDownload(ctx context.Context) (*TransactionsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ByPeriodOptions ¶
ByPeriodOptions represents options passed to ByPeriod.
type Client ¶
type Client struct { Token string BaseURL *url.URL Transactions *TransactionsService // contains filtered or unexported fields }
Client is fio http api client.
type ErrorResponse ¶
ErrorResponse wraps http response errors.
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type ExportFormat ¶
type ExportFormat string
ExportFormat represents export formats supported by Export.
const ( JSONFormat ExportFormat = "json" XMLFormat ExportFormat = "xml" CSVFormat ExportFormat = "csv" GPCFormat ExportFormat = "gpc" HTMLFormat ExportFormat = "html" OFXFormat ExportFormat = "ofx" )
Supported ExportFormat types.
type ExportOptions ¶
type ExportOptions struct { DateFrom time.Time DateTo time.Time Format ExportFormat }
ExportOptions represents options passed to Export.
type ExportStatementOptions ¶
type ExportStatementOptions struct { Year int ID int Format ExportFormat }
type GetStatementOptions ¶
GetStatementOptions represents options passed to GetStatement.
type SetLastDownloadDateOptions ¶
SetLastDownloadDateOptions represents options passed to SetLastDownloadDate.
type SetLastDownloadIDOptions ¶
type SetLastDownloadIDOptions struct {
ID int
}
SetLastDownloadIDOptions represents options passed to SetLastDownloadID.
type StatementInfo ¶
type StatementInfo struct { AccountID int64 BankID string Currency string IBAN string BIC string OpeningBalance decimal.Decimal ClosingBalance decimal.Decimal DateStart time.Time DateEnd time.Time YearList int64 IDFrom int64 IDTo int64 IDLastDownload int64 IDList int64 }
StatementInfo represents account statement info.
type Transaction ¶
type Transaction struct { ID int64 Date time.Time Amount decimal.Decimal Currency string Account string AccountName string BankName string BankCode string ConstantSymbol string VariableSymbol string SpecificSymbol string UserIdentification string RecipientMessage string Type string Specification string Comment string BIC string OrderID string PayerReference string }
Transaction represents transaction.
type TransactionsResponse ¶
type TransactionsResponse struct { Info StatementInfo Transactions []Transaction }
TransactionsResponse represents response transactions.
type TransactionsService ¶
type TransactionsService struct {
// contains filtered or unexported fields
}
TransactionsService is a service for working with transactions.
func (*TransactionsService) ByPeriod ¶
func (s *TransactionsService) ByPeriod(ctx context.Context, opts ByPeriodOptions) (*TransactionsResponse, error)
ByPeriod returns transactions in date period.
func (*TransactionsService) Export ¶
func (s *TransactionsService) Export(ctx context.Context, opts ExportOptions, w io.Writer) error
Export writes transactions in date period to provided writer.
func (*TransactionsService) ExportStatement ¶
func (s *TransactionsService) ExportStatement(ctx context.Context, opts ExportStatementOptions, w io.Writer) error
ExportStatement writes statement by its year/id to provided writer.
func (*TransactionsService) GetStatement ¶
func (s *TransactionsService) GetStatement(ctx context.Context, opts GetStatementOptions) (*TransactionsResponse, error)
GetStatement returns statement by its year/id.
func (*TransactionsService) SetLastDownloadDate ¶
func (s *TransactionsService) SetLastDownloadDate(ctx context.Context, opts SetLastDownloadDateOptions) error
SetLastDownloadDate sets the last download date of statement.
func (*TransactionsService) SetLastDownloadID ¶
func (s *TransactionsService) SetLastDownloadID(ctx context.Context, opts SetLastDownloadIDOptions) error
SetLastDownloadID sets the last downloaded id of statement.
func (*TransactionsService) SinceLastDownload ¶
func (s *TransactionsService) SinceLastDownload(ctx context.Context) (*TransactionsResponse, error)
SinceLastDownload returns transactions since last download.