Documentation
¶
Index ¶
- type AdditionalInfo
- type Advance
- type AdvanceReturn
- type Article
- type Buyer
- type Cash
- type CheckDocumentStatusResponse
- type ConfirmDocumentResponse
- type Container
- type ContainerReturn
- type Currency
- type DeleteDocumentResponse
- type DeleteQueueResponse
- type Device
- type DeviceControl
- type DiscountMarkup
- type Document
- type EDocument
- type Error
- type ErrorResponse
- type Info
- type Invoice
- type NovitusClient
- func (n *NovitusClient) CheckDocumentStatus(objectType, requestId string) (CheckDocumentStatusResponse, error)
- func (n *NovitusClient) Confirm(objectType, requestId string) (SendDocumentResponse, error)
- func (n *NovitusClient) DeleteDocument(objectType, requestId string) (DeleteDocumentResponse, error)
- func (n *NovitusClient) DeleteQueue() (DeleteQueueResponse, error)
- func (n *NovitusClient) GetQueueStatus() (QueueResponse, error)
- func (n *NovitusClient) ObtainToken() (TokenResponse, error)
- func (n *NovitusClient) RefreshIfNeeded() error
- func (n *NovitusClient) RefreshToken() error
- func (n *NovitusClient) SendDocument(documentType string, document Document) (SendDocumentResponse, error)
- func (n *NovitusClient) SendInvoice(invoice *Invoice, confirm bool) (CheckDocumentStatusResponse, error)
- func (n *NovitusClient) SendNFPrintout(printout *Printout, confirm bool) (CheckDocumentStatusResponse, error)
- func (n *NovitusClient) SendReceipt(receipt *Receipt, confirm bool) (CheckDocumentStatusResponse, error)
- type Options
- type Printout
- type PrintoutLine
- type PrintoutOptions
- type QueueResponse
- type Receipt
- type Request
- type SendDocumentResponse
- type Summary
- type SystemInfo
- type TextLine
- type TokenResponse
- type TransactionSide
- type TypicalPaymentMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdditionalInfo ¶
type Advance ¶
type Advance struct {
Description string `json:"description,omitempty"` // Required: true, e.g. "Advance Payment"
PTU string `json:"ptu"` // Enum: "A" - "G" Required: true https://www.posnet.com.pl/gdzie-kupic
Value string `json:"value"` // Value in currency, e.g. "100.00" Required: true
}
type AdvanceReturn ¶
type AdvanceReturn struct {
Description string `json:"description,omitempty"` // Required: true, e.g. "Advance Return"
PTU string `json:"ptu"` // Enum: "A" - "G" Required: true https://www.posnet.com.pl/gdzie-kupic
Value string `json:"value"` // Value in currency, e.g. "50.00" Required: true
}
func (*AdvanceReturn) Validate ¶
func (a *AdvanceReturn) Validate() error
type Article ¶
type Article struct {
Name string `json:"name"` // Required: true
PTU string `json:"ptu"` // Enum: "A" - "G" Required: true https://www.posnet.com.pl/gdzie-kupic
Quantity string `json:"quantity"` // Quantity in units, e.g. "1.00" Required: true
Price string `json:"price"` // Price in currency, e.g. "1.00" Required: true
Value string `json:"value"` // Total value for the item, e.g. "1.00" Required: true
Unit string `json:"unit,omitempty"` // Enum: "szt" - "kg", etc.
DiscountMarkup *DiscountMarkup `json:"discount_markup,omitempty"` // Optional, e.g. "0.00"
Code string `json:"code,omitempty"` // Optional, e.g. "1234567890123" Can be set only if Description is not Set
Description string `json:"description,omitempty"` // Optional, e.g. "Sample Item"
}
type Cash ¶
type Cash struct {
Value string `json:"value"` // Value in currency, e.g. "100.00" Required: true
}
type ConfirmDocumentResponse ¶
type ConfirmDocumentResponse struct {
Request `json:"request"`
}
type Container ¶
type Container struct {
Name string `json:"name,omitempty"` // e.g. "Container Name"
Number string `json:"number,omitempty"` // e.g. "12345"
Quantity string `json:"quantity,omitempty"` // Quantity in units, e.g. "10.00"
Value string `json:"value"` // Total value for the container, e.g. "100.00" Required: true
}
type ContainerReturn ¶
type ContainerReturn struct {
Name string `json:"name"` // e.g. "Container Name"
Number string `json:"number"` // e.g. "12345"
Quantity string `json:"quantity"` // Quantity in units, e.g. "10.00"
Value string `json:"value"` // Total value for the container, e.g. "100.00" Required: true
}
func (*ContainerReturn) Validate ¶
func (cr *ContainerReturn) Validate() error
type Currency ¶
type Currency struct {
Course string `json:"course"` // e.g. "1.00" Required: true
CurrencyValue string `json:"currency_value"` // e.g. "USD" Required: true
LocalValue string `json:"local_value"` // e.g. "100.00" Required: true
IsChange bool `json:"is_change"` // true if this is a change, false otherwise Required: true
Name string `json:"name"` // e.g. "USD" Required: true
}
type DeleteDocumentResponse ¶
type DeleteDocumentResponse struct {
Request `json:"request"`
}
type DeleteQueueResponse ¶
type DeleteQueueResponse struct {
Status string `json:"status"`
}
type DeviceControl ¶
type DiscountMarkup ¶
type ErrorResponse ¶
type ErrorResponse struct {
Exception Error `json:"exception"`
}
type Invoice ¶
type Invoice struct {
Info `json:"info"` // Required: true
Buyer `json:"buyer"` // Required: true
Recipient *TransactionSide `json:"recipient,omitempty"`
Seller *TransactionSide `json:"seller,omitempty"`
Options `json:"options"`
Items []interface{} `json:"items"` // Required: true
Payments []interface{} `json:"payments,omitempty"`
Summary `json:"summary"` // Required: true
PrintoutLines []interface{} `json:"printout_lines,omitempty"`
AdditionalInfo []AdditionalInfo `json:"additional_info,omitempty"`
DeviceControl `json:"device_control,omitempty"`
SystemInfo `json:"system_info,omitempty"`
}
type NovitusClient ¶
type NovitusClient struct {
// contains filtered or unexported fields
}
func NewNovitusClient ¶
func NewNovitusClient(host, token string) (*NovitusClient, error)
func (*NovitusClient) CheckDocumentStatus ¶
func (n *NovitusClient) CheckDocumentStatus(objectType, requestId string) (CheckDocumentStatusResponse, error)
func (*NovitusClient) Confirm ¶
func (n *NovitusClient) Confirm(objectType, requestId string) (SendDocumentResponse, error)
func (*NovitusClient) DeleteDocument ¶
func (n *NovitusClient) DeleteDocument(objectType, requestId string) (DeleteDocumentResponse, error)
func (*NovitusClient) DeleteQueue ¶
func (n *NovitusClient) DeleteQueue() (DeleteQueueResponse, error)
func (*NovitusClient) GetQueueStatus ¶
func (n *NovitusClient) GetQueueStatus() (QueueResponse, error)
func (*NovitusClient) ObtainToken ¶
func (n *NovitusClient) ObtainToken() (TokenResponse, error)
func (*NovitusClient) RefreshIfNeeded ¶
func (n *NovitusClient) RefreshIfNeeded() error
func (*NovitusClient) RefreshToken ¶
func (n *NovitusClient) RefreshToken() error
func (*NovitusClient) SendDocument ¶
func (n *NovitusClient) SendDocument(documentType string, document Document) (SendDocumentResponse, error)
func (*NovitusClient) SendInvoice ¶
func (n *NovitusClient) SendInvoice(invoice *Invoice, confirm bool) (CheckDocumentStatusResponse, error)
func (*NovitusClient) SendNFPrintout ¶
func (n *NovitusClient) SendNFPrintout(printout *Printout, confirm bool) (CheckDocumentStatusResponse, error)
func (*NovitusClient) SendReceipt ¶
func (n *NovitusClient) SendReceipt(receipt *Receipt, confirm bool) (CheckDocumentStatusResponse, error)
type Options ¶
type Options struct {
SkipDescriptionValueToPay bool `json:"skip_description_value_to_pay"`
SkipBlockGrossValueInAccountingTax bool `json:"skip_block_gross_value_in_accounting_tax"`
BuyerBold bool `json:"buyer_bold"`
SellerBold bool `json:"seller_bold"`
BuyerNipBold bool `json:"buyer_nip_bold"`
SellerNipBold bool `json:"seller_nip_bold"`
PrintLabelDescriptionSymbolInInvoiceHeader bool `json:"print_label_description_symbol_in_invoice_header"`
PrintPositionNumberInInvoiceHeader bool `json:"print_position_number_in_invoice_header"`
PrintPositionNumberInvoice bool `json:"print_position_number_invoice"`
ToPayLabelBeforeAcountingTaxBlock bool `json:"to_pay_label_before_acounting_tax_block"`
PrintCentsInWords bool `json:"print_cents_in_words"`
DontPrintSellDateIfEqualCreateDate bool `json:"dont_print_sell_date_if_equal_create_date"`
DontPrintSellerDataInHeader bool `json:"dont_print_seller_data_in_header"`
DontPrintSellItemsDescription bool `json:"dont_print_sell_items_description"`
EnablePaymentForm bool `json:"enable_payment_form"`
DontPrintCustomerData bool `json:"dont_print_customer_data"`
PrintPaydInCash bool `json:"print_payd_in_cash"`
SkipSellerLabel bool `json:"skip_seller_label"`
PrintInvoiceTaxLabel bool `json:"print_invoice_tax_label"`
}
type Printout ¶
type Printout struct {
Options *PrintoutOptions `json:"options,omitempty"`
Lines []interface{} `json:"lines"` // Required: true
*EDocument `json:"e_document,omitempty"`
*SystemInfo `json:"system_info,omitempty"`
*DeviceControl `json:"device_control,omitempty"`
}
type PrintoutLine ¶
type PrintoutLine struct {
Text string `json:"text"` // The text to be printed, e.g. "Sample Text" Required: true
Masked bool `json:"masked"` // true if the text should be masked, false otherwise Required: true
}
func (*PrintoutLine) Validate ¶
func (p *PrintoutLine) Validate() error
type PrintoutOptions ¶
type QueueResponse ¶
type QueueResponse struct {
RequestsInQueue int `json:"requests_in_queue"`
}
type Receipt ¶
type Receipt struct {
Items []interface{} `json:"items,omitempty"` // Required: true
Payments []interface{} `json:"payments,omitempty"`
Summary `json:"summary,omitempty"` // Required: true
PrintoutLines []interface{} `json:"printout_lines,omitempty"`
Buyer *Buyer `json:"buyer,omitempty"`
SystemInfo *SystemInfo `json:"system_info,omitempty"`
DeviceControl *DeviceControl `json:"device_control,omitempty"`
}
type SendDocumentResponse ¶
type SendDocumentResponse struct {
Request `json:"request"`
}
type Summary ¶
type Summary struct {
DiscountMarkup *DiscountMarkup `json:"discount_markup,omitempty"`
Total string `json:"total,omitempty"`
PayIn string `json:"pay_in,omitempty"`
Change string `json:"change,omitempty"`
}
type SystemInfo ¶
type TextLine ¶
type TextLine struct {
Bold bool `json:"bold,omitempty"` // true if the text should be bold, false otherwise
Invers bool `json:"invers,omitempty"` // true if the text should be inverted, false otherwise
Center bool `json:"center,omitempty"` // true if the text should be centered, false otherwise
FontNumber int `json:"font_number,omitempty"` // Font number, e.g. 1, 2, 3
Big bool `json:"big,omitempty"` // true if the text should be big, false otherwise
Height int `json:"height,omitempty"` // Height of the text in points, e.g. 12
Width int `json:"width,omitempty"` // Width of the text in points, e.g. 100
Text string `json:"text"` // The text to be printed, e.g. "Sample Text" Required: true
Masked bool `json:"masked"` // true if the text should be masked, false otherwise Required: true
}
type TokenResponse ¶
type TransactionSide ¶
type TransactionSide struct {
Name string `json:"name,omitempty"`
PrintInfo string `json:"print_info,omitempty"` // Enum: "place_for_signature" "name_and_place_for_signature" "none"
}
func (*TransactionSide) Validate ¶
func (ts *TransactionSide) Validate() error
type TypicalPaymentMethod ¶
type TypicalPaymentMethod struct {
Name string `json:"name,omitempty"` // enum "card", cheque, coupon, other, credit, account, transfer, mobile, voucher
Value string `json:"value"` // Value in currency, e.g. "100.00" Required: true
}
func (*TypicalPaymentMethod) Validate ¶
func (t *TypicalPaymentMethod) Validate() error
Click to show internal directories.
Click to hide internal directories.