tinkoff

package module
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 12 Imported by: 1

README

tinkoff-api

Go Reference Go Report Go Coverage CodeQL

Клиент для веб-API Тинькофф-банка.

Возможности:

  • авторизация
  • получение информации о счетах, операциях и кассовых чеках
  • получение информации о брокерских счетах и операциях

Пример

Демонстрация авторизации и выполнения всего доступного функционала с выводом данных в консоль.

Код для авторизации будет запрошен из стандартного ввода.

Переменная TINKOFF_SESSIONS_FILE должна содержать путь к файлу (несуществующему) для кэширования информации о сессии (и потенциального дальнейшего переиспользования).

TINKOFF_PHONE="+79999999999" TINKOFF_PASSWORD="123456" TINKOFF_SESSIONS_FILE="/tmp/tinkoff-sessions.json" go run example/main.go 

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoDataFound = errors.New("no data found")
)

Functions

func WithAuthorizer

func WithAuthorizer(ctx context.Context, authorizer Authorizer) context.Context

Types

type Account

type Account struct {
	Id                    string            `json:"id"`
	Currency              *Currency         `json:"currency,omitempty"`
	CreditLimit           *MoneyAmount      `json:"creditLimit,omitempty"`
	MoneyAmount           *MoneyAmount      `json:"moneyAmount,omitempty"`
	DebtBalance           *MoneyAmount      `json:"debtBalance,omitempty"`
	CurrentMinimalPayment *MoneyAmount      `json:"currentMinimalPayment,omitempty"`
	ClientUnverifiedFlag  *string           `json:"clientUnverifiedFlag,omitempty"`
	IdentificationState   *string           `json:"identificationState,omitempty"`
	Status                *string           `json:"status,omitempty"`
	EmoneyFlag            *bool             `json:"emoneyFlag,omitempty"`
	NextStatementDate     *Milliseconds     `json:"nextStatementDate,omitempty"`
	DueDate               *Milliseconds     `json:"dueDate,omitempty"`
	Cards                 []Card            `json:"cards,omitempty"`
	MultiCardCluster      *MultiCardCluster `json:"multiCardCluster,omitempty"`
	LoyaltyId             *string           `json:"loyaltyId,omitempty"`
	MoneyPotFlag          *bool             `json:"moneyPotFlag,omitempty"`
	PartNumber            *string           `json:"partNumber,omitempty"`
	PastDueDebt           *MoneyAmount      `json:"pastDueDebt,omitempty"`
	Name                  string            `json:"name"`
	AccountType           string            `json:"accountType"`
	Hidden                bool              `json:"hidden"`
	SharedByMeFlag        *bool             `json:"sharedByMeFlag,omitempty"`
	Loyalty               *Loyalty          `json:"loyalty,omitempty"`
	CreationDate          *Milliseconds     `json:"creationDate,omitempty"`
	DebtAmount            *MoneyAmount      `json:"debtAmount,omitempty"`
	LastStatementDate     *Milliseconds     `json:"lastStatementDate,omitempty"`
	DueColor              *int              `json:"dueColor,omitempty"`
	LinkedAccountNumber   *string           `json:"linkedAccountNumber,omitempty"`
	IsKidsSaving          *bool             `json:"isKidsSaving,omitempty"`
	IsCrowdfunding        *bool             `json:"isCrowdfunding,omitempty"`
	Shared                *AccountShared    `json:"shared,omitempty"`
}

type AccountRequisitesIn added in v1.0.0

type AccountRequisitesIn struct {
	Account string `url:"account" validate:"required"`
}

type AccountRequisitesOut added in v1.0.0

type AccountRequisitesOut struct {
	CardImage                  string `json:"cardImage"`
	CardLine1                  string `json:"cardLine1"`
	CardLine2                  string `json:"cardLine2"`
	Recipient                  string `json:"recipient"`
	BeneficiaryInfo            string `json:"beneficiaryInfo"`
	BeneficiaryBank            string `json:"beneficiaryBank"`
	RecipientExternalAccount   string `json:"recipientExternalAccount"`
	CorrespondentAccountNumber string `json:"correspondentAccountNumber"`
	BankBik                    string `json:"bankBik"`
	Name                       string `json:"name"`
	Inn                        string `json:"inn"`
	Kpp                        string `json:"kpp"`
}

type AccountShared

type AccountShared struct {
	Scopes     []string     `json:"scopes"`
	StartDate  Milliseconds `json:"startDate"`
	OwnerName  string       `json:"ownerName"`
	SharStatus string       `json:"sharStatus"`
}

type AccountsLightIbOut

type AccountsLightIbOut = []Account

type AdditionalInfo

type AdditionalInfo struct {
	FieldName  string `json:"fieldName"`
	FieldValue string `json:"fieldValue"`
}

type Authorizer

type Authorizer interface {
	GetConfirmationCode(ctx context.Context, phone string) (string, error)
}

type Brand

type Brand struct {
	Name          string  `json:"name"`
	BaseTextColor *string `json:"baseTextColor,omitempty"`
	Id            string  `json:"id"`
	BaseColor     *string `json:"baseColor,omitempty"`
	LogoFile      *string `json:"logoFile,omitempty"`
	Link          *string `json:"link,omitempty"`
	SvgLogoFile   *string `json:"svgLogoFile"`
}

type Card

type Card struct {
	Id               string            `json:"id"`
	StatusCode       string            `json:"statusCode"`
	Status           string            `json:"status"`
	PinSet           bool              `json:"pinSet"`
	Expiration       Milliseconds      `json:"expiration"`
	CardDesign       string            `json:"cardDesign"`
	Ucid             string            `json:"ucid"`
	PaymentSystem    string            `json:"paymentSystem"`
	FrozenCard       bool              `json:"frozenCard"`
	HasWrongPins     bool              `json:"hasWrongPins"`
	Value            string            `json:"value"`
	IsEmbossed       bool              `json:"isEmbossed"`
	IsVirtual        bool              `json:"isVirtual"`
	CreationDate     Milliseconds      `json:"creationDate"`
	MultiCardCluster *MultiCardCluster `json:"multiCardCluster,omitempty"`
	Name             string            `json:"name"`
	IsPaymentDevice  bool              `json:"isPaymentDevice"`
	Primary          bool              `json:"primary"`
	CardIssueType    string            `json:"cardIssueType"`
	SharedResourceId *string           `json:"sharedResourceId,omitempty"`
}

type Category

type Category struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type Client

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

func NewClient added in v1.0.0

func NewClient(params ClientParams) (*Client, error)

func (*Client) AccountRequisites added in v1.0.0

func (c *Client) AccountRequisites(ctx context.Context, in *AccountRequisitesIn) (*AccountRequisitesOut, error)

func (*Client) AccountsLightIb

func (c *Client) AccountsLightIb(ctx context.Context) (AccountsLightIbOut, error)

func (*Client) ClientOfferEssences added in v0.1.0

func (c *Client) ClientOfferEssences(ctx context.Context) (ClientOfferEssencesOut, error)

func (*Client) InvestAccounts

func (c *Client) InvestAccounts(ctx context.Context, in *InvestAccountsIn) (*InvestAccountsOut, error)

func (*Client) InvestCandles added in v1.0.0

func (c *Client) InvestCandles(ctx context.Context, in *InvestCandlesIn) (*InvestCandlesOut, error)

func (*Client) InvestOperationTypes

func (c *Client) InvestOperationTypes(ctx context.Context) (*InvestOperationTypesOut, error)

func (*Client) InvestOperations

func (c *Client) InvestOperations(ctx context.Context, in *InvestOperationsIn) (*InvestOperationsOut, error)

func (*Client) Operations

func (c *Client) Operations(ctx context.Context, in *OperationsIn) (OperationsOut, error)

func (*Client) Ping added in v1.0.0

func (c *Client) Ping(ctx context.Context)

func (*Client) ShoppingReceipt

func (c *Client) ShoppingReceipt(ctx context.Context, in *ShoppingReceiptIn) (*ShoppingReceiptOut, error)

func (*Client) Statements

func (c *Client) Statements(ctx context.Context, in *StatementsIn) (StatementsOut, error)

type ClientOfferEssence added in v0.1.0

type ClientOfferEssence struct {
	Name         string   `json:"name"`
	Description  string   `json:"description"`
	BusinessType uint     `json:"businessType"`
	IsActive     bool     `json:"isActive"`
	BaseColor    string   `json:"baseColor"`
	MccCodes     []string `json:"mccCodes,omitempty"`
	ExternalCode string   `json:"externalCode"`
	ExternalId   string   `json:"externalId"`
	Id           string   `json:"id"`
	Percent      uint     `json:"percent"`
}

type ClientOfferEssences added in v0.1.0

type ClientOfferEssences struct {
	TypeCode              string                        `json:"typeCode"`
	AvailableEssenceCount uint                          `json:"availableEssenceCount"`
	ActiveTo              Milliseconds                  `json:"activeTo"`
	Attributes            ClientOfferEssencesAttributes `json:"attributes"`
	ActiveFrom            Milliseconds                  `json:"activeFrom"`
	Essences              []ClientOfferEssence          `json:"essences"`
	DisplayTo             Milliseconds                  `json:"displayTo"`
	AccountIds            []string                      `json:"accountIds"`
	DisplayFrom           Milliseconds                  `json:"displayFrom"`
	Id                    string                        `json:"id"`
}

type ClientOfferEssencesAttributes added in v0.1.0

type ClientOfferEssencesAttributes struct {
	NotificationFlag bool `json:"notificationFlag"`
}

type ClientOfferEssencesOut added in v0.1.0

type ClientOfferEssencesOut = []ClientOfferEssences

type ClientParams added in v1.0.0

type ClientParams struct {
	Clock          based.Clock    `validate:"required"`
	Credential     Credential     `validate:"required"`
	SessionStorage SessionStorage `validate:"required"`

	Transport http.RoundTripper
}

type Credential

type Credential struct {
	Phone    string
	Password string
}

type Currency

type Currency struct {
	Code    uint   `json:"code"`
	Name    string `json:"name"`
	StrCode string `json:"strCode"`
}

type Date

type Date time.Time

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (Date) Time

func (d Date) Time() time.Time

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

type DateTime

type DateTime time.Time

func (DateTime) MarshalJSON

func (dt DateTime) MarshalJSON() ([]byte, error)

func (DateTime) Time

func (dt DateTime) Time() time.Time

func (*DateTime) UnmarshalJSON

func (dt *DateTime) UnmarshalJSON(data []byte) error

type DateTimeMilliOffset

type DateTimeMilliOffset time.Time

func (DateTimeMilliOffset) MarshalJSON

func (dt DateTimeMilliOffset) MarshalJSON() ([]byte, error)

func (DateTimeMilliOffset) Time

func (dt DateTimeMilliOffset) Time() time.Time

func (*DateTimeMilliOffset) UnmarshalJSON

func (dt *DateTimeMilliOffset) UnmarshalJSON(data []byte) error

type InvestAccount

type InvestAccount struct {
	BrokerAccountId   string `json:"brokerAccountId"`
	BrokerAccountType string `json:"brokerAccountType"`
	Name              string `json:"name"`
	OpenedDate        Date   `json:"openedDate"`
	Order             int    `json:"order"`
	Status            string `json:"status"`
	IsVisible         bool   `json:"isVisible"`
	Organization      string `json:"organization"`
	BuyByDefault      bool   `json:"buyByDefault"`
	MarginEnabled     bool   `json:"marginEnabled"`
	AutoApp           bool   `json:"autoApp"`

	InvestTotals
}

type InvestAccounts

type InvestAccounts struct {
	Count int             `json:"count"`
	List  []InvestAccount `json:"list"`
}

type InvestAccountsIn

type InvestAccountsIn struct {
	Currency string `url:"currency" validate:"required"`
}

type InvestAccountsOut

type InvestAccountsOut struct {
	Accounts InvestAccounts `json:"accounts"`
	Totals   InvestTotals   `json:"totals"`
}

type InvestAmount

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

type InvestCandle added in v1.0.0

type InvestCandle struct {
	O    float64          `json:"o"`
	C    float64          `json:"c"`
	H    float64          `json:"h"`
	L    float64          `json:"l"`
	V    float64          `json:"v"`
	Date InvestCandleDate `json:"date"`
}

type InvestCandleDate added in v1.0.0

type InvestCandleDate time.Time

func (InvestCandleDate) MarshalJSON added in v1.0.0

func (d InvestCandleDate) MarshalJSON() ([]byte, error)

func (InvestCandleDate) Time added in v1.0.0

func (d InvestCandleDate) Time() time.Time

func (*InvestCandleDate) UnmarshalJSON added in v1.0.0

func (d *InvestCandleDate) UnmarshalJSON(data []byte) error

type InvestCandlesIn added in v1.0.0

type InvestCandlesIn struct {
	From       time.Time `url:"from" layout:"2006-01-02T15:04:05+00:00" validate:"required"`
	To         time.Time `url:"to" layout:"2006-01-02T15:04:05+00:00" validate:"required"`
	Resolution any       `url:"resolution" validate:"required"`
	Ticker     string    `url:"ticker" validate:"required"`
}

type InvestCandlesOut added in v1.0.0

type InvestCandlesOut struct {
	Candles []InvestCandle `json:"candles"`
}

type InvestChildOperation

type InvestChildOperation struct {
	Currency       string       `json:"currency"`
	Id             string       `json:"id"`
	InstrumentType string       `json:"instrumentType"`
	InstrumentUid  string       `json:"instrumentUid"`
	LogoName       string       `json:"logoName"`
	Payment        InvestAmount `json:"payment"`
	ShowName       string       `json:"showName"`
	Ticker         string       `json:"ticker"`
	Type           string       `json:"type"`
	Value          float64      `json:"value"`
}

type InvestOperation

type InvestOperation struct {
	AccountName                   string                 `json:"accountName"`
	AssetUid                      *string                `json:"assetUid,omitempty"`
	BestExecuted                  bool                   `json:"bestExecuted"`
	BrokerAccountId               string                 `json:"brokerAccountId"`
	ClassCode                     *string                `json:"classCode,omitempty"`
	Cursor                        string                 `json:"cursor"`
	Date                          DateTimeMilliOffset    `json:"date"`
	Description                   string                 `json:"description"`
	Id                            *string                `json:"id,omitempty"`
	InstrumentType                *string                `json:"instrumentType,omitempty"`
	InstrumentUid                 *string                `json:"instrumentUid,omitempty"`
	InternalId                    string                 `json:"internalId"`
	IsBlockedTradeClearingAccount *bool                  `json:"isBlockedTradeClearingAccount,omitempty"`
	Isin                          *string                `json:"isin,omitempty"`
	LogoName                      *string                `json:"logoName,omitempty"`
	Name                          *string                `json:"name,omitempty"`
	Payment                       InvestAmount           `json:"payment"`
	PaymentEur                    InvestAmount           `json:"paymentEur"`
	PaymentRub                    InvestAmount           `json:"paymentRub"`
	PaymentUsd                    InvestAmount           `json:"paymentUsd"`
	PositionUid                   *string                `json:"positionUid,omitempty"`
	ShortDescription              *string                `json:"shortDescription,omitempty"`
	ShowName                      *string                `json:"showName,omitempty"`
	Status                        string                 `json:"status"`
	TextColor                     *string                `json:"textColor,omitempty"`
	Ticker                        *string                `json:"ticker,omitempty"`
	Type                          string                 `json:"type"`
	AccountId                     *string                `json:"accountId,omitempty"`
	DoneRest                      *int                   `json:"doneRest,omitempty"`
	Price                         *InvestAmount          `json:"price,omitempty"`
	Quantity                      *int                   `json:"quantity,omitempty"`
	TradesInfo                    *TradesInfo            `json:"tradesInfo,omitempty"`
	ParentOperationId             *string                `json:"parentOperationId,omitempty"`
	ChildOperations               []InvestChildOperation `json:"childOperations,omitempty"`
	Commission                    *InvestAmount          `json:"commission,omitempty"`
	Yield                         *InvestAmount          `json:"yield,omitempty"`
	YieldRelative                 *float64               `json:"yieldRelative,omitempty"`
	CancelReason                  *string                `json:"cancelReason,omitempty"`
	QuantityRest                  *int                   `json:"quantityRest,omitempty"`
	WithdrawDateTime              *DateTime              `json:"withdrawDateTime,omitempty"`
}

type InvestOperationType

type InvestOperationType struct {
	Category      string `json:"category"`
	OperationName string `json:"operationName"`
	OperationType string `json:"operationType"`
}

type InvestOperationTypesOut

type InvestOperationTypesOut struct {
	OperationsTypes []InvestOperationType `json:"operationsTypes"`
}

type InvestOperationsIn

type InvestOperationsIn struct {
	From               time.Time `url:"from,omitempty" layout:"2006-01-02T15:04:05.999Z"`
	To                 time.Time `url:"to,omitempty" layout:"2006-01-02T15:04:05.999Z"`
	BrokerAccountId    string    `url:"brokerAccountId,omitempty"`
	OvernightsDisabled *bool     `url:"overnightsDisabled,omitempty"`
	Limit              int       `url:"limit,omitempty"`
	Cursor             string    `url:"cursor,omitempty"`
}

type InvestOperationsOut

type InvestOperationsOut struct {
	HasNext    bool              `json:"hasNext"`
	Items      []InvestOperation `json:"items"`
	NextCursor string            `json:"nextCursor"`
}

type InvestTotals

type InvestTotals struct {
	ExpectedYield                InvestAmount `json:"expectedYield"`
	ExpectedYieldRelative        float64      `json:"expectedYieldRelative"`
	ExpectedYieldPerDay          InvestAmount `json:"expectedYieldPerDay"`
	ExpectedYieldPerDayRelative  float64      `json:"expectedYieldPerDayRelative"`
	ExpectedAverageYield         InvestAmount `json:"expectedAverageYield"`
	ExpectedAverageYieldRelative float64      `json:"expectedAverageYieldRelative"`
	TotalAmount                  InvestAmount `json:"totalAmount"`
}

type Location

type Location struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type Loyalty

type Loyalty struct {
	ProgramName            string   `json:"programName"`
	ProgramCode            string   `json:"programCode"`
	AccountBackgroundColor string   `json:"accountBackgroundColor"`
	CashbackProgram        bool     `json:"cashbackProgram"`
	CoreGroup              string   `json:"coreGroup"`
	LoyaltyPointsId        uint8    `json:"loyaltyPointsId"`
	AccrualBonuses         *float64 `json:"accrualBonuses,omitempty"`
	LinkedBonuses          *string  `json:"linkedBonuses,omitempty"`
	TotalAvailableBonuses  *float64 `json:"totalAvailableBonuses,omitempty"`
	AvailableBonuses       *float64 `json:"availableBonuses,omitempty"`
}

type LoyaltyAmount

type LoyaltyAmount struct {
	Value               float64 `json:"value"`
	LoyaltyProgramId    string  `json:"loyaltyProgramId"`
	Loyalty             string  `json:"loyalty"`
	Name                string  `json:"name"`
	LoyaltySteps        uint8   `json:"loyaltySteps"`
	LoyaltyPointsId     uint8   `json:"loyaltyPointsId"`
	LoyaltyPointsName   string  `json:"loyaltyPointsName"`
	LoyaltyImagine      bool    `json:"loyaltyImagine"`
	PartialCompensation bool    `json:"partialCompensation"`
}

type LoyaltyBonus

type LoyaltyBonus struct {
	Description      string        `json:"description"`
	Icon             string        `json:"icon"`
	LoyaltyType      string        `json:"loyaltyType"`
	Amount           LoyaltyAmount `json:"amount"`
	CompensationType string        `json:"compensationType"`
}

type LoyaltyBonusSummary

type LoyaltyBonusSummary struct {
	Amount float64 `json:"amount"`
}

type LoyaltyPayment

type LoyaltyPayment struct {
	Amount   LoyaltyPaymentAmount `json:"amount"`
	Status   string               `json:"status"`
	SoldTime *Milliseconds        `json:"soldTime"`
}

type LoyaltyPaymentAmount

type LoyaltyPaymentAmount struct {
	LoyaltyAmount
	Price float64 `json:"price"`
}

type Merchant

type Merchant struct {
	Name   string  `json:"name"`
	Region *Region `json:"region,omitempty"`
}

type Milliseconds

type Milliseconds time.Time

func (Milliseconds) MarshalJSON

func (ms Milliseconds) MarshalJSON() ([]byte, error)

func (Milliseconds) Time

func (ms Milliseconds) Time() time.Time

func (*Milliseconds) UnmarshalJSON

func (ms *Milliseconds) UnmarshalJSON(data []byte) error

type MoneyAmount

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

type MultiCardCluster

type MultiCardCluster struct {
	Id string `json:"id"`
}

type Operation

type Operation struct {
	IsDispute              bool                 `json:"isDispute"`
	IsOffline              bool                 `json:"isOffline"`
	HasStatement           bool                 `json:"hasStatement"`
	IsSuspicious           bool                 `json:"isSuspicious"`
	AuthorizationId        *string              `json:"authorizationId,omitempty"`
	IsInner                bool                 `json:"isInner"`
	Id                     string               `json:"id"`
	Status                 string               `json:"status"`
	OperationTransferred   bool                 `json:"operationTransferred"`
	IdSourceType           string               `json:"idSourceType"`
	HasShoppingReceipt     *bool                `json:"hasShoppingReceipt,omitempty"`
	Type                   string               `json:"type"`
	Locations              []Location           `json:"locations,omitempty"`
	LoyaltyBonus           []LoyaltyBonus       `json:"loyaltyBonus,omitempty"`
	CashbackAmount         MoneyAmount          `json:"cashbackAmount"`
	AuthMessage            *string              `json:"authMessage,omitempty"`
	Description            string               `json:"description"`
	IsTemplatable          bool                 `json:"isTemplatable"`
	Cashback               float64              `json:"cashback"`
	Brand                  *Brand               `json:"brand,omitempty"`
	Amount                 MoneyAmount          `json:"amount"`
	OperationTime          Milliseconds         `json:"operationTime"`
	SpendingCategory       SpendingCategory     `json:"spendingCategory"`
	IsHce                  bool                 `json:"isHce"`
	Mcc                    uint                 `json:"mcc"`
	Category               Category             `json:"category"`
	AdditionalInfo         []AdditionalInfo     `json:"additionalInfo,omitempty"`
	VirtualPaymentType     uint8                `json:"virtualPaymentType"`
	Account                string               `json:"account"`
	Ucid                   *string              `json:"ucid,omitempty"`
	Merchant               *Merchant            `json:"merchant,omitempty"`
	Card                   *string              `json:"card,omitempty"`
	LoyaltyPayment         []LoyaltyPayment     `json:"loyaltyPayment,omitempty"`
	TrancheCreationAllowed bool                 `json:"trancheCreationAllowed"`
	Group                  *string              `json:"group,omitempty"`
	MccString              string               `json:"mccString"`
	CardPresent            bool                 `json:"cardPresent"`
	IsExternalCard         bool                 `json:"isExternalCard"`
	CardNumber             *string              `json:"cardNumber,omitempty"`
	AccountAmount          MoneyAmount          `json:"accountAmount"`
	LoyaltyBonusSummary    *LoyaltyBonusSummary `json:"loyaltyBonusSummary,omitempty"`
	TypeSerno              *uint                `json:"typeSerno"`
	Payment                *Payment             `json:"payment,omitempty"`
	OperationPaymentType   *string              `json:"operationPaymentType,omitempty"`
	Subgroup               *Subgroup            `json:"subgroup,omitempty"`
	DebitingTime           *Milliseconds        `json:"debitingTime,omitempty"`
	PosId                  *string              `json:"posId,omitempty"`
	Subcategory            *string              `json:"subcategory,omitempty"`
	SenderAgreement        *string              `json:"senderAgreement,omitempty"`
	PointOfSaleId          *uint64              `json:"pointOfSaleId,omitempty"`
	Compensation           *string              `json:"compensation,omitempty"`
	InstallmentStatus      *string              `json:"installmentStatus,omitempty"`
	SenderDetails          *string              `json:"senderDetails,omitempty"`
	PartnerType            *string              `json:"partnerType,omitempty"`
	Nomination             *string              `json:"nomination,omitempty"`
	Message                *string              `json:"message,omitempty"`
	TrancheId              *string              `json:"trancheId,omitempty"`
}

type OperationsIn

type OperationsIn struct {
	Account                string     `url:"account" validate:"required"`
	Start                  time.Time  `url:"start,unixmilli" validate:"required"`
	End                    *time.Time `url:"end,unixmilli,omitempty"`
	OperationId            *string    `url:"operationId,omitempty"`
	TrancheCreationAllowed *bool      `url:"trancheCreationAllowed,omitempty"`
	LoyaltyPaymentProgram  *string    `url:"loyaltyPaymentProgram,omitempty"`
	LoyaltyPaymentStatus   *string    `url:"loyaltyPaymentStatus,omitempty"`
}

type OperationsOut

type OperationsOut = []Operation

type Payment

type Payment struct {
	SourceIsQr         bool           `json:"sourceIsQr"`
	BankAccountId      string         `json:"bankAccountId"`
	PaymentId          string         `json:"paymentId"`
	ProviderGroupId    *string        `json:"providerGroupId,omitempty"`
	PaymentType        string         `json:"paymentType"`
	FeeAmount          *MoneyAmount   `json:"feeAmount,omitempty"`
	ProviderId         string         `json:"providerId"`
	HasPaymentOrder    bool           `json:"hasPaymentOrder"`
	Comment            string         `json:"comment"`
	IsQrPayment        bool           `json:"isQrPayment"`
	FieldsValues       map[string]any `json:"fieldsValues"`
	Repeatable         bool           `json:"repeatable"`
	CardNumber         string         `json:"cardNumber"`
	TemplateId         *string        `json:"templateId,omitempty"`
	TemplateIsFavorite *bool          `json:"templateIsFavorite,omitempty"`
}

type Receipt

type Receipt struct {
	RetailPlace             *string         `json:"retailPlace,omitempty"`
	RetailPlaceAddress      *string         `json:"retailPlaceAddress,omitempty"`
	CreditSum               *float64        `json:"creditSum,omitempty"`
	ProvisionSum            *float64        `json:"provisionSum,omitempty"`
	FiscalDriveNumber       *uint64         `json:"fiscalDriveNumber,omitempty"`
	OperationType           uint8           `json:"operationType"`
	CashTotalSum            float64         `json:"cashTotalSum"`
	ShiftNumber             uint            `json:"shiftNumber"`
	KktRegId                string          `json:"kktRegId"`
	Items                   []ReceiptItem   `json:"items"`
	TotalSum                float64         `json:"totalSum"`
	EcashTotalSum           float64         `json:"ecashTotalSum"`
	Nds10                   *float64        `json:"nds10,omitempty"`
	Nds18                   *float64        `json:"nds18,omitempty"`
	UserInn                 string          `json:"userInn"`
	DateTime                ReceiptDateTime `json:"dateTime"`
	TaxationType            uint8           `json:"taxationType"`
	PrepaidSum              *float64        `json:"prepaidSum,omitempty"`
	FiscalSign              uint64          `json:"fiscalSign"`
	RequestNumber           uint            `json:"requestNumber"`
	Operator                *string         `json:"operator,omitempty"`
	AppliedTaxationType     uint8           `json:"appliedTaxationType"`
	FiscalDocumentNumber    uint64          `json:"fiscalDocumentNumber"`
	User                    *string         `json:"user,omitempty"`
	FiscalDriveNumberString string          `json:"fiscalDriveNumberString"`
}

type ReceiptDateTime added in v1.0.0

type ReceiptDateTime time.Time

func (ReceiptDateTime) MarshalJSON added in v1.0.0

func (dt ReceiptDateTime) MarshalJSON() ([]byte, error)

func (ReceiptDateTime) Time added in v1.0.0

func (dt ReceiptDateTime) Time() time.Time

func (*ReceiptDateTime) UnmarshalJSON added in v1.0.0

func (dt *ReceiptDateTime) UnmarshalJSON(data []byte) error

type ReceiptItem

type ReceiptItem struct {
	Name     string   `json:"name"`
	Price    float64  `json:"price"`
	Sum      float64  `json:"sum"`
	Quantity float64  `json:"quantity"`
	NdsRate  *uint8   `json:"ndsRate,omitempty"`
	Nds      *uint8   `json:"nds,omitempty"`
	Nds10    *float64 `json:"nds10,omitempty"`
	Nds18    *float64 `json:"nds18,omitempty"`
	BrandId  uint64   `json:"brand_id,omitempty"`
	GoodId   uint64   `json:"good_id,omitempty"`
}

type Region

type Region struct {
	Country    *string `json:"country,omitempty"`
	City       *string `json:"city,omitempty"`
	Address    *string `json:"address,omitempty"`
	Zip        *string `json:"zip,omitempty"`
	AddressRus *string `json:"addressRus,omitempty"`
}

type Session

type Session struct {
	ID string
}

type SessionStorage

type SessionStorage interface {
	LoadSession(ctx context.Context, phone string) (*Session, error)
	UpdateSession(ctx context.Context, phone string, session *Session) error
}

type ShoppingReceiptIn

type ShoppingReceiptIn struct {
	OperationId   string     `url:"operationId" validate:"required"`
	OperationTime *time.Time `url:"operationTime,unixmilli,omitempty"`
	IdSourceType  *string    `url:"idSourceType,omitempty"`
	Account       *string    `url:"account,omitempty"`
}

type ShoppingReceiptOut

type ShoppingReceiptOut struct {
	OperationDateTime Milliseconds `json:"operationDateTime"`
	OperationId       string       `json:"operationId"`
	Receipt           Receipt      `json:"receipt"`
}

type SpendingCategory

type SpendingCategory struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type Statement

type Statement struct {
	OverdraftFee           *MoneyAmount    `json:"overdraftFee,omitempty"`
	Expense                MoneyAmount     `json:"expense"`
	OverLimitDebt          *MoneyAmount    `json:"overLimitDebt,omitempty"`
	PeriodEndBalance       MoneyAmount     `json:"periodEndBalance"`
	ArrestAmount           *MoneyAmount    `json:"arrestAmount,omitempty"`
	OtherBonus             *MoneyAmount    `json:"otherBonus,omitempty"`
	CreditLimit            *MoneyAmount    `json:"creditLimit,omitempty"`
	TranchesMonthlyPayment *MoneyAmount    `json:"tranchesMonthlyPayment,omitempty"`
	BilledDebt             *MoneyAmount    `json:"billedDebt,omitempty"`
	Cashback               MoneyAmount     `json:"cashback"`
	Balance                MoneyAmount     `json:"balance"`
	HighCashback           *MoneyAmount    `json:"highCashback,omitempty"`
	PeriodStartBalance     MoneyAmount     `json:"periodStartBalance"`
	LowCashback            *MoneyAmount    `json:"lowCashback,omitempty"`
	AvailableLimit         *MoneyAmount    `json:"availableLimit,omitempty"`
	Id                     string          `json:"id"`
	InterestBonus          *MoneyAmount    `json:"interestBonus,omitempty"`
	Interest               MoneyAmount     `json:"interest"`
	Date                   Milliseconds    `json:"date"`
	Income                 MoneyAmount     `json:"income"`
	CreditBonus            *MoneyAmount    `json:"creditBonus,omitempty"`
	LastPaymentDate        *Milliseconds   `json:"lastPaymentDate,omitempty"`
	OtherCashback          *MoneyAmount    `json:"otherCashback,omitempty"`
	MinimalPaymentAmount   *MoneyAmount    `json:"minimalPaymentAmount,omitempty"`
	PastDueDebt            *MoneyAmount    `json:"pastDueDebt,omitempty"`
	Period                 StatementPeriod `json:"period"`
	NoOverdue              *bool           `json:"noOverdue,omitempty"`
	Repaid                 *string         `json:"repaid,omitempty"`
}

type StatementPeriod

type StatementPeriod struct {
	Start Milliseconds `json:"start"`
	End   Milliseconds `json:"end"`
}

type StatementsIn

type StatementsIn struct {
	Account    string `url:"account" validate:"required"`
	ItemsOrder string `url:"itemsOrder,omitempty"`
}

type StatementsOut

type StatementsOut = []Statement

type Subgroup

type Subgroup struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type Trade

type Trade struct {
	Date          DateTimeMilliOffset `json:"date"`
	Num           string              `json:"num"`
	Price         InvestAmount        `json:"price"`
	Quantity      int                 `json:"quantity"`
	Yield         *InvestAmount       `json:"yield,omitempty"`
	YieldRelative *float64            `json:"yieldRelative,omitempty"`
}

type TradesInfo

type TradesInfo struct {
	Trades     []Trade `json:"trades"`
	TradesSize int     `json:"tradesSize"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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