orders

package
v0.0.0-...-b5784f9 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type AdditionalOfdParams

type AdditionalOfdParams struct {
	AgentInfoType                   int      `json:"agent_info.type"`
	AgentInfoPayingOperation        string   `json:"agent_info.paying.operation,omitempty"`
	AgentInfoPayingPhones           []string `json:"agent_info.paying.phones,omitempty"`
	AgentInfoPaymentsOperatorPhones []string `json:"agent_info.paymentsOperator.phones,omitempty"`
	AgentInfoMTOperatorAddress      string   `json:"agent_info.MTOperator.address,omitempty"`
	AgentInfoMTOperatorInn          string   `json:"agent_info.MTOperator.inn,omitempty"`
	AgentInfoMTOperatorName         string   `json:"agent_info.MTOperator.name,omitempty"`
	AgentInfoMTOperatorPhones       []string `json:"agent_info.MTOperator.phones,omitempty"`
	SupplierInfoPhones              []string `json:"supplier_info.phones,omitempty"`
	Cashier                         string   `json:"cashier,omitempty"`
	AdditionalCheckProps            string   `json:"additional_check_props,omitempty"`
	AdditionalUserPropsName         string   `json:"additional_user_props.name,omitempty"`
	AdditionalUserPropsValue        string   `json:"additional_user_props.value,omitempty"`
	CashierInn                      string   `json:"cashier_inn,omitempty"`
	ClientAddress                   string   `json:"client.address,omitempty"`
	ClientBirthDate                 string   `json:"client.birth_date,omitempty"`
	ClientCitizenship               string   `json:"client.citizenship,omitempty"`
	ClientDocumentCode              string   `json:"client.document_code,omitempty"`
	ClientPassportNumber            string   `json:"client.passport_number,omitempty"`
	ClientMail                      string   `json:"client.email,omitempty"`
	ClientPhone                     string   `json:"client.phone,omitempty"`
	ClientInn                       string   `json:"client.inn,omitempty"`
	ClientName                      string   `json:"client.name,omitempty"`
	OperatingCheckPropsName         string   `json:"operatingCheckProps.name,omitempty"`
	OperatingCheckPropsTimestamp    string   `json:"operatingCheckProps.timestamp,omitempty"`
	OperatingCheckPropsValue        string   `json:"operatingCheckProps.value,omitempty"`
	SectoralCheckPropsDate          string   `json:"sectoralCheckProps.date,omitempty"`
	SectoralCheckPropsFederalId     string   `json:"sectoralCheckProps.federalId,omitempty"`
	SectoralCheckPropsNumber        string   `json:"sectoralCheckProps.number,omitempty"`
	SectoralCheckPropsValue         string   `json:"sectoralCheckProps.value,omitempty"`
}

type AgentInterest

type AgentInterest struct {
	InterestType  string `json:"interestType"`
	InterestValue string `json:"interestValue"`
}

func (AgentInterest) Validate

func (agentInterest AgentInterest) Validate() error

type Attributes

type Attributes struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

func (Attributes) Validate

func (attributes Attributes) Validate() error

type CartItems

type CartItems struct {
	Items []Item `json:"items"`
}

type Client

type Client struct {
	API acquiring.API
}

type CustomerDetails

type CustomerDetails struct {
	Contact  string `json:"contact,omitempty"`
	Email    string `json:"email"`
	FullName string `json:"fullName,omitempty"`
	Passport string `json:"passport,omitempty"`
	Inn      string `json:"inn,omitempty"`

	Phone        string       `json:"phone,omitempty"`
	DeliveryInfo DeliveryInfo `json:"delivery_info,omitempty"`
}

func (CustomerDetails) Validate

func (customerDetails CustomerDetails) Validate() error

type DeliveryInfo

type DeliveryInfo struct {
	DeliveryType    string `json:"delivery_type,omitempty"`
	DeliveryCountry string `json:"delivery_country"`
	DeliveryCity    string `json:"delivery_city"`
	PostAddress     string `json:"post_address"`
}

func (DeliveryInfo) Validate

func (deliveryInfo DeliveryInfo) Validate() error

type Discount

type Discount struct {
	DiscountType  string `json:"discountType"`
	DiscountValue string `json:"discountValue"`
}

Discount structure

func (Discount) Validate

func (discount Discount) Validate() error

Validate Validates Discount struct

type Item

type Item struct {
	PositionId     string            `json:"positionId"`
	Name           string            `json:"name"`
	ItemDetails    ItemDetailsParams `json:"itemDetails,omitempty"`
	Quantity       Quantity          `json:"quantity"`
	ItemAmount     int               `json:"itemAmount,omitempty"`
	ItemCurrency   int               `json:"itemCurrency,omitempty"`
	ItemCode       string            `json:"itemCode"`
	ItemPrice      string            `json:"itemPrice"`
	ItemAttributes ItemAttributes    `json:"itemAttributes,omitempty"`
	Discount       Discount          `json:"discount,omitempty"`
	AgentInterest  AgentInterest     `json:"agentInterest,omitempty"`
	Tax            Tax               `json:"tax,omitempty"`
}

func (Item) Validate

func (item Item) Validate() error

type ItemAttributes

type ItemAttributes struct {
	Attributes []Attributes `json:"attributes"`
}

func (ItemAttributes) Validate

func (itemAttributes ItemAttributes) Validate() error

type ItemDetails

type ItemDetails struct {
	ItemDetailsParams []ItemDetailsParams `json:"itemDetailsParams"`
}

func (ItemDetails) Validate

func (itemDetails ItemDetails) Validate() error

type ItemDetailsParams

type ItemDetailsParams struct {
	Value string `json:"value"`
	Name  string `json:"name"`
}

func (ItemDetailsParams) Validate

func (itemDetailsParams ItemDetailsParams) Validate() error

type Order

type Order struct {
	OrderNumber         string
	Amount              int
	ReturnURL           string
	FailURL             string
	Description         string
	PageView            string
	MerchantLogin       string
	ExpirationDate      string
	BindingID           string
	OrderBundle         OrderBundle
	AdditionalOfdParams AdditionalOfdParams
	Features            string
	JSONParams          map[string]string
}

Order is used to carry data related that passed to acquiring api requests.

"OrderNumber" used to pass orderId to api "Amount" is amount of money (in pennies) "ReturnURL" in response "FailURL" in response "Description" check API Docs "PageView" custom pageview "MerchantLogin" check API Docs "ExpirationDate" check API Docs "BindingID" used in binding API "OrderBundle" OrderBundle data (cart to be consistent with 84 law and OFD 1.05) "AdditionalOfdParams" AdditionalOfdParams extra data (for OFD 1.05 and up) "Features" used in some endpoints of API "JSONParams" different json data that can be stored on api side

func (Order) Validate

func (order Order) Validate() error

type OrderBundle

type OrderBundle struct {
	OrderCreationDate string           `json:"orderCreationDate,omitempty"`
	CustomerDetails   *CustomerDetails `json:"customerDetails,omitempty"`
	CartItems         CartItems        `json:"cartItems"`
}

func (OrderBundle) Validate

func (orderBundle OrderBundle) Validate() error

type Quantity

type Quantity struct {
	Value   int    `json:"value"`
	Measure string `json:"measure"`
}

func (Quantity) Validate

func (quantity Quantity) Validate() error

type Tax

type Tax struct {
	TaxType int `json:"taxType,omitempty"`
	TaxSum  int `json:"taxSum,omitempty"`
}

func (Tax) Validate

func (tax Tax) Validate() error

Jump to

Keyboard shortcuts

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