Documentation
¶
Index ¶
- func Deposit(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- func GetOrderStatus(ctx context.Context, order Order) (*schema.OrderStatusResponse, *http.Response, error)
- func RefundOrder(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- func RegisterOrder(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- func RegisterOrderPreAuth(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- func ReverseOrder(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- type AdditionalOfdParams
- type AgentInterest
- type Attributes
- type CartItems
- type Client
- func (c Client) Deposit(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- func (c Client) GetOrderStatus(ctx context.Context, order Order) (*schema.OrderStatusResponse, *http.Response, error)
- func (c Client) RefundOrder(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- func (c Client) RegisterOrder(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- func (c Client) RegisterOrderPreAuth(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- func (c Client) ReverseOrder(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
- type CustomerDetails
- type DeliveryInfo
- type Discount
- type Item
- type ItemAttributes
- type ItemDetails
- type ItemDetailsParams
- type Order
- type OrderBundle
- type Quantity
- type Tax
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deposit ¶
Deposit request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:deposit
func GetOrderStatus ¶
func GetOrderStatus(ctx context.Context, order Order) (*schema.OrderStatusResponse, *http.Response, error)
GetOrderStatus request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:getorderstatusextended
func RefundOrder ¶
RefundOrder request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:refund
func RegisterOrder ¶
RegisterOrder request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:register
func RegisterOrderPreAuth ¶
func RegisterOrderPreAuth(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
RegisterOrderPreAuth request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:registerpreauth
func ReverseOrder ¶
ReverseOrder request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:reverse
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 ¶
func (Attributes) Validate ¶
func (attributes Attributes) Validate() error
type Client ¶
func (Client) Deposit ¶
func (c Client) Deposit(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
Deposit request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:deposit
func (Client) GetOrderStatus ¶
func (c Client) GetOrderStatus(ctx context.Context, order Order) (*schema.OrderStatusResponse, *http.Response, error)
GetOrderStatus request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:getorderstatusextended
func (Client) RefundOrder ¶
func (c Client) RefundOrder(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
RefundOrder request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:refund
func (Client) RegisterOrder ¶
func (c Client) RegisterOrder(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
RegisterOrder request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:register
func (Client) RegisterOrderPreAuth ¶
func (c Client) RegisterOrderPreAuth(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
RegisterOrderPreAuth request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:registerpreauth
func (Client) ReverseOrder ¶
func (c Client) ReverseOrder(ctx context.Context, order Order) (*schema.OrderResponse, *http.Response, error)
ReverseOrder request see https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:reverse
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
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"` }
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 ¶
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
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