17 Commits

Author SHA1 Message Date
4b14f6640f Fix PrintGood.Cnt type: int -> float64 to match API response 2026-03-25 20:53:02 +03:00
d4cad7cb74 Remove warnings field from BaseResponse to fully ignore API warnings 2026-03-18 17:04:48 +03:00
ee08291fc1 Fix warnings deserialization: change type from []string to []Warning struct
Vchasno API returns warnings as array of objects {code, wtxt}, not strings.
This caused unmarshal errors on successful responses with warnings.
2026-03-18 17:01:09 +03:00
23779ad6ad Fix Docno type 2026-01-29 13:13:43 +03:00
f23c4ffd1c Add isDM flag to Client and update FiscalRequest structure for DM support 2026-01-16 02:41:11 +03:00
861a1640d4 Improved error handling in vchasno responses 2026-01-16 02:27:09 +03:00
28a8810ffb set default devicemanager endpoint as /dm/execute. As stated in VCHASNO docs. 2026-01-16 02:23:48 +03:00
3ed7d33b84 Added Verbose mode 2026-01-16 02:21:37 +03:00
3e02c6f2d5 improved error messages 2026-01-16 02:19:24 +03:00
9513c373aa some more tls magic 2026-01-16 02:17:39 +03:00
961b90626f set TLS to version 1.2 2026-01-16 02:14:31 +03:00
81fb8c7e7e changed fiscal endpoint 2026-01-14 18:00:15 +03:00
08c7556960 added device support 2026-01-10 04:47:04 +03:00
d9bfa5ff7f Added custom URL support (DM) 2026-01-08 16:37:02 +03:00
daniel
b70e95ac5c Added null cheque 2025-10-16 04:36:48 +03:00
ac4f4670bb disabled test JSON logging 2025-10-15 10:08:54 +03:00
4a8b5cf0c5 Added comment to clarify JSON request execution in executeRequest function 2025-10-14 11:40:57 +03:00
6 changed files with 375 additions and 102 deletions

View File

@@ -1,17 +1,48 @@
package api package api
import "resty.dev/v3" import (
"crypto/tls"
"resty.dev/v3"
)
type Client struct { type Client struct {
token string token string
resty *resty.Client device string
apiBaseURL string isDM bool
resty *resty.Client
apiBaseURL string
fiscalEndpoint string
} }
func NewClient(token string) *Client { func NewClient(token string) *Client {
return &Client{ return &Client{
token: token, token: token,
resty: resty.New(), isDM: false,
apiBaseURL: "https://kasa.vchasno.ua/api/v3", resty: resty.New(),
apiBaseURL: "https://kasa.vchasno.ua/api/v3",
fiscalEndpoint: "/fiscal/execute",
}
}
func NewDMClient(token, dmURL, device string) *Client {
restyClient := resty.New()
restyClient.SetTLSClientConfig(&tls.Config{
MinVersion: tls.VersionTLS12,
CipherSuites: []uint16{
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
},
})
return &Client{
token: token,
device: device,
isDM: true,
resty: restyClient,
apiBaseURL: dmURL,
fiscalEndpoint: "/dm/execute",
} }
} }

View File

@@ -5,40 +5,69 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"log"
) )
type APIError struct {
Code int
Message string
}
func (e *APIError) Error() string {
return fmt.Sprintf("vchasno api error %d: %s", e.Code, e.Message)
}
func (c *Client) executeRequest(ctx context.Context, request FiscalRequest, response interface{}) error { func (c *Client) executeRequest(ctx context.Context, request FiscalRequest, response interface{}) error {
request.Device = c.device
if c.isDM {
request.Ver = 6
request.Type = 1
}
reqJson, err := json.Marshal(request) reqJson, err := json.Marshal(request)
if err != nil { if err != nil {
return fmt.Errorf("failed to marshal request: %w", err) return fmt.Errorf("failed to marshal request: %w", err)
} }
fmt.Println(string(reqJson))
url := c.apiBaseURL + c.fiscalEndpoint
log.Printf("[VCHASNO] POST %s", url)
log.Printf("[VCHASNO] Request: %s", string(reqJson))
resp, err := c.resty.R(). resp, err := c.resty.R().
SetContext(ctx). SetContext(ctx).
SetHeader("Authorization", c.token). SetHeader("Authorization", c.token).
SetHeader("Content-Type", "application/json").
SetBody(reqJson). SetBody(reqJson).
Post(c.apiBaseURL + "/fiscal/execute") Post(url)
if err != nil { if err != nil {
return fmt.Errorf("request failed: %w", err) return fmt.Errorf("request failed: %w", err)
} }
if resp.IsError() {
return fmt.Errorf("api error: %v", resp.Error())
}
if resp.StatusCode() != 200 {
return fmt.Errorf("unexpected status code: %d", resp.StatusCode())
}
body, err := io.ReadAll(resp.Body) body, err := io.ReadAll(resp.Body)
if err != nil { if err != nil {
return fmt.Errorf("failed to read response: %w", err) return fmt.Errorf("failed to read response: %w", err)
} }
log.Printf("[VCHASNO] Response (status %d): %s", resp.StatusCode(), string(body))
if resp.StatusCode() != 200 {
return fmt.Errorf("api error (status %d): %s", resp.StatusCode(), string(body))
}
if err := json.Unmarshal(body, response); err != nil { if err := json.Unmarshal(body, response); err != nil {
return fmt.Errorf("failed to unmarshal response: %w", err) return fmt.Errorf("failed to unmarshal response: %w, body: %s", err, string(body))
}
var baseResp BaseResponse
if err := json.Unmarshal(body, &baseResp); err == nil {
if baseResp.HasError() {
return &APIError{
Code: baseResp.Res,
Message: baseResp.Errortxt,
}
}
} }
return nil return nil
@@ -47,8 +76,7 @@ func (c *Client) executeRequest(ctx context.Context, request FiscalRequest, resp
func (c *Client) OpenShift(ctx context.Context, cashier string) (*SellResponse, error) { func (c *Client) OpenShift(ctx context.Context, cashier string) (*SellResponse, error) {
request := FiscalRequest{ request := FiscalRequest{
Fiscal: Fiscal{ Fiscal: Fiscal{
Task: TaskOpenShift, Task: TaskOpenShift,
Cashier: cashier,
}, },
} }
@@ -63,8 +91,7 @@ func (c *Client) OpenShift(ctx context.Context, cashier string) (*SellResponse,
func (c *Client) CloseShift(ctx context.Context, cashier string) (*ZReportResponse, error) { func (c *Client) CloseShift(ctx context.Context, cashier string) (*ZReportResponse, error) {
request := FiscalRequest{ request := FiscalRequest{
Fiscal: Fiscal{ Fiscal: Fiscal{
Task: TaskZReport, Task: TaskZReport,
Cashier: cashier,
}, },
} }
@@ -101,12 +128,6 @@ func (c *Client) Sell(ctx context.Context, params SellParams) (*SellResponse, er
request.Userinfo = *params.Userinfo request.Userinfo = *params.Userinfo
} }
reqJson, err := json.Marshal(request)
if err != nil {
return nil, err
}
fmt.Println(string(reqJson))
var response SellResponse var response SellResponse
if err := c.executeRequest(ctx, request, &response); err != nil { if err := c.executeRequest(ctx, request, &response); err != nil {
return nil, err return nil, err

View File

@@ -1,7 +1,11 @@
package api package api
type FiscalRequest struct { type FiscalRequest struct {
Source string `json:"source"` Ver int `json:"ver,omitempty"`
Source string `json:"source,omitempty"`
Device string `json:"device,omitempty"`
Tag string `json:"tag,omitempty"`
Type int `json:"type,omitempty"`
Userinfo Userinfo `json:"userinfo,omitempty"` Userinfo Userinfo `json:"userinfo,omitempty"`
Fiscal Fiscal `json:"fiscal"` Fiscal Fiscal `json:"fiscal"`
} }
@@ -13,7 +17,7 @@ type Userinfo struct {
type Fiscal struct { type Fiscal struct {
Task int `json:"task"` Task int `json:"task"`
Cashier string `json:"cashier"` Cashier string `json:"cashier,omitempty"`
Receipt *Receipt `json:"receipt,omitempty"` Receipt *Receipt `json:"receipt,omitempty"`
} }

View File

@@ -4,36 +4,178 @@ type BaseResponse struct {
Task int `json:"task"` Task int `json:"task"`
Type int `json:"type"` Type int `json:"type"`
Ver int `json:"ver"` Ver int `json:"ver"`
RespVer int `json:"resp_ver"`
Source string `json:"source"` Source string `json:"source"`
Device string `json:"device"` Device string `json:"device"`
Tag string `json:"tag"` Tag string `json:"tag"`
TaskStatus int `json:"task_status"`
Dt string `json:"dt"` Dt string `json:"dt"`
Res int `json:"res"` Res int `json:"res"`
ResAction int `json:"res_action"` ResAction int `json:"res_action"`
Errortxt string `json:"errortxt"` Errortxt string `json:"errortxt"`
Warnings []string `json:"warnings"` AqErrortxt string `json:"aq_errortxt"`
ErrorExtra interface{} `json:"error_extra"` ErrorExtra interface{} `json:"error_extra"`
} }
func (r *BaseResponse) HasError() bool {
return r.Res != 0
}
func (r *BaseResponse) Error() string {
if r.Errortxt != "" {
return r.Errortxt
}
return ""
}
type SellResponse struct { type SellResponse struct {
BaseResponse BaseResponse
Info SellInfo `json:"info"` Info SellInfo `json:"info"`
} }
type SellInfo struct { type SellInfo struct {
Task int `json:"task"` Task int `json:"task"`
Fisid string `json:"fisid"` Fisid string `json:"fisid"`
Dataid int `json:"dataid"` Dataid int `json:"dataid"`
Doccode string `json:"doccode"` Doccode string `json:"doccode"`
Dt string `json:"dt"` Docno interface{} `json:"docno"`
Cashier string `json:"cashier"` Dt string `json:"dt"`
Dtype int `json:"dtype"` Cashier string `json:"cashier"`
Isprint int `json:"isprint"` Dtype int `json:"dtype"`
Isoffline bool `json:"isoffline"` Isprint int `json:"isprint"`
Safe float64 `json:"safe"` Ispay int `json:"ispay"`
ShiftLink int `json:"shift_link"` Isoffline bool `json:"isoffline"`
Docno int `json:"docno"` Safe float64 `json:"safe"`
Cancelid string `json:"cancelid,omitempty"` SafeStartShift float64 `json:"safe_start_shift"`
ShiftLink int `json:"shift_link"`
ShiftPrevLink int `json:"shift_prev_link"`
ShiftID string `json:"shift_id"`
OpenShiftDt string `json:"open_shift_dt"`
Cancelid string `json:"cancelid,omitempty"`
VacantOffNums int `json:"vacant_off_nums"`
Devinfo string `json:"devinfo"`
DfsLocalNumber string `json:"dfs_local_number"`
Userdata1 string `json:"userdata1"`
Userdata2 string `json:"userdata2"`
Userdata3 string `json:"userdata3"`
QR string `json:"qr"`
QR1 string `json:"qr1"`
Billing *Billing `json:"billing,omitempty"`
Printheader *Printheader `json:"printheader,omitempty"`
Printinfo *Printinfo `json:"printinfo,omitempty"`
}
type Billing struct {
PaidDateTo string `json:"paid_date_to"`
EnoughToRenewSubscription int `json:"enough_to_renew_subscription"`
}
type Printheader struct {
Name string `json:"name"`
Shopname string `json:"shopname"`
Shoptype string `json:"shoptype"`
Shopad string `json:"shopad"`
VatCode string `json:"vat_code"`
FisCode string `json:"fis_code"`
Dt string `json:"dt"`
OpenShiftDt string `json:"open_shift_dt"`
IsOffline bool `json:"isOffline"`
Fisid string `json:"fisid"`
Manuf string `json:"manuf"`
Cashier string `json:"cashier"`
Task int `json:"task"`
DfsLocalNumber string `json:"dfs_local_number"`
}
type Printinfo struct {
Name string `json:"name"`
Shopname string `json:"shopname"`
Shoptype string `json:"shoptype"`
Shopad string `json:"shopad"`
VatCode string `json:"vat_code"`
FisCode string `json:"fis_code"`
DfsLocalNumber string `json:"dfs_local_number"`
Fisn string `json:"fisn"`
Dt string `json:"dt"`
OpenShiftDt string `json:"open_shift_dt"`
QR string `json:"qr"`
QR1 string `json:"qr1"`
IsOffline bool `json:"isOffline"`
Mac string `json:"mac"`
Fisid string `json:"fisid"`
Manuf string `json:"manuf"`
Cashier string `json:"cashier"`
Task int `json:"task"`
Subtask int `json:"subtask"`
FcId string `json:"fcId"`
Fisdoctype string `json:"fisdoctype"`
CommentDown string `json:"comment_down"`
CommentUp string `json:"comment_up"`
Safe float64 `json:"safe"`
SafeStartShift float64 `json:"safe_start_shift"`
Docno string `json:"docno"`
Userdata1 string `json:"userdata1"`
Userdata2 string `json:"userdata2"`
Userdata3 string `json:"userdata3"`
Crc32 int `json:"crc32"`
SumReceipt float64 `json:"sum_receipt"`
SumTopay float64 `json:"sum_topay"`
Round float64 `json:"round"`
Goods []PrintGood `json:"goods"`
Pays []PrintPay `json:"pays"`
Taxes []PrintTax `json:"taxes"`
}
type PrintGood struct {
Name string `json:"name"`
Code string `json:"code"`
Code1 string `json:"code1"`
Code2 string `json:"code2"`
CodeA string `json:"code_a"`
CodeAa []string `json:"code_aa"`
Cnt float64 `json:"cnt"`
Price float64 `json:"price"`
Cost float64 `json:"cost"`
CostAfterDisc float64 `json:"cost_after_disc"`
Disc float64 `json:"disc"`
DiscType int `json:"disc_type"`
Taxgrp int `json:"taxgrp"`
Taxlit string `json:"taxlit"`
Comment string `json:"comment"`
Commission float64 `json:"commission"`
}
type PrintPay struct {
PayClass int `json:"pay_class"`
IsTerminal bool `json:"is_terminal"`
Type int `json:"type"`
Typen string `json:"typen"`
Sum float64 `json:"sum"`
SumOrig float64 `json:"sum_orig"`
Commission float64 `json:"commission"`
Currency string `json:"currency"`
OperType string `json:"oper_type"`
ShowAdditionalInfo bool `json:"show_additional_info"`
Info string `json:"info"`
Comment string `json:"comment"`
ReceivedSum float64 `json:"received_sum"`
Change float64 `json:"change"`
}
type PrintTax struct {
GrCode int `json:"gr_code"`
BaseSum float64 `json:"base_sum"`
TaxName string `json:"tax_name"`
TaxFname string `json:"tax_fname"`
TaxLit string `json:"tax_lit"`
TaxPercent float64 `json:"tax_percent"`
BaseTaxSum float64 `json:"base_tax_sum"`
TaxSum float64 `json:"tax_sum"`
ExName string `json:"ex_name"`
ExPercent float64 `json:"ex_percent"`
BaseExSum float64 `json:"base_ex_sum"`
ExSum float64 `json:"ex_sum"`
ActivationDt string `json:"activation_dt"`
} }
type ZReportResponse struct { type ZReportResponse struct {
@@ -42,74 +184,119 @@ type ZReportResponse struct {
} }
type ZReportInfo struct { type ZReportInfo struct {
Task int `json:"task"` Task int `json:"task"`
Fisid string `json:"fisid"` Fisid string `json:"fisid"`
Dataid int `json:"dataid"` Dataid int `json:"dataid"`
Doccode string `json:"doccode"` Doccode string `json:"doccode"`
Dt string `json:"dt"` Docno interface{} `json:"docno"`
Cashier string `json:"cashier"` Dt string `json:"dt"`
Dtype int `json:"dtype"` OpenShiftDt string `json:"open_shift_dt"`
Isprint int `json:"isprint"` Cashier string `json:"cashier"`
Isoffline bool `json:"isoffline"` Dtype int `json:"dtype"`
Safe float64 `json:"safe"` Isprint int `json:"isprint"`
ShiftLink int `json:"shift_link"` Ispay int `json:"ispay"`
Docno int `json:"docno"` Isoffline bool `json:"isoffline"`
Receipt ZReportReceipt `json:"receipt"` Safe float64 `json:"safe"`
Summary ZReportSummary `json:"summary"` SafeStartShift float64 `json:"safe_start_shift"`
Taxes []ZReportTax `json:"taxes"` ShiftLink int `json:"shift_link"`
Pays []ZReportPay `json:"pays"` ShiftPrevLink int `json:"shift_prev_link"`
Money []ZReportMoney `json:"money"` VacantOffNums int `json:"vacant_off_nums"`
Cash []ZReportMoney `json:"cash"` Devinfo string `json:"devinfo"`
MoneyTransfer []interface{} `json:"money_transfer"` DfsLocalNumber string `json:"dfs_local_number"`
Userdata1 string `json:"userdata1"`
Userdata2 string `json:"userdata2"`
Userdata3 string `json:"userdata3"`
Receipt ZReportReceipt `json:"receipt"`
Summary ZReportSummary `json:"summary"`
Taxes []ZReportTax `json:"taxes"`
Pays []ZReportPay `json:"pays"`
Money []ZReportMoney `json:"money"`
Cash []ZReportMoney `json:"cash"`
MoneyTransfer []interface{} `json:"money_transfer"`
Income []ZReportMoney `json:"income"`
Lastcheck *Lastcheck `json:"lastcheck,omitempty"`
Reports []interface{} `json:"reports"`
Receipts []interface{} `json:"receipts"`
Billing *Billing `json:"billing,omitempty"`
Printheader *Printheader `json:"printheader,omitempty"`
}
type Lastcheck struct {
Packnum int `json:"packnum"`
Docnum int `json:"docnum"`
Fisnum string `json:"fisnum"`
Packtype int `json:"packtype"`
} }
type ZReportReceipt struct { type ZReportReceipt struct {
CountP int `json:"count_p"` CountP int `json:"count_p"`
CountM int `json:"count_m"` CountM int `json:"count_m"`
Count14 int `json:"count_14"` Count14 int `json:"count_14"`
Count15 int `json:"count_15"`
Count16 int `json:"count_16"`
CountTransfer int `json:"count_transfer"` CountTransfer int `json:"count_transfer"`
LastDocnoP int `json:"last_docno_p"` LastDocnoP int `json:"last_docno_p"`
LastDocnoM int `json:"last_docno_m"` LastDocnoM int `json:"last_docno_m"`
} }
type ZReportSummary struct { type ZReportSummary struct {
BaseP float64 `json:"base_p"` BaseP float64 `json:"base_p"`
BaseM float64 `json:"base_m"` BaseM float64 `json:"base_m"`
TaxexP float64 `json:"taxex_p"` TaxexP float64 `json:"taxex_p"`
TaxexM float64 `json:"taxex_m"` TaxexM float64 `json:"taxex_m"`
DiscP float64 `json:"disc_p"` DiscP float64 `json:"disc_p"`
DiscM float64 `json:"disc_m"` DiscM float64 `json:"disc_m"`
DiscPSale float64 `json:"disc_p_sale"`
DiscPRef float64 `json:"disc_p_ref"`
DiscMSale float64 `json:"disc_m_sale"`
DiscMRef float64 `json:"disc_m_ref"`
Disc0P float64 `json:"disc0_p"`
Disc0M float64 `json:"disc0_m"`
CalcP float64 `json:"calc_p"`
CalcM float64 `json:"calc_m"`
IncomeP float64 `json:"income_p"`
} }
type ZReportTax struct { type ZReportTax struct {
GrCode int `json:"gr_code"` GrCode int `json:"gr_code"`
BaseSumP float64 `json:"base_sum_p"` BaseSumP float64 `json:"base_sum_p"`
BaseSumM float64 `json:"base_sum_m"` BaseSumM float64 `json:"base_sum_m"`
BaseTaxSumP float64 `json:"base_tax_sum_p"` BaseSumLinkP float64 `json:"base_sum_link_p"`
BaseTaxSumM float64 `json:"base_tax_sum_m"` BaseSumLinkM float64 `json:"base_sum_link_m"`
BaseExSumP float64 `json:"base_ex_sum_p"` TaxSumLinkP float64 `json:"tax_sum_link_p"`
BaseExSumM float64 `json:"base_ex_sum_m"` TaxSumLinkM float64 `json:"tax_sum_link_m"`
TaxName string `json:"tax_name"` BaseTaxSumP float64 `json:"base_tax_sum_p"`
TaxFname string `json:"tax_fname"` BaseTaxSumM float64 `json:"base_tax_sum_m"`
TaxLit string `json:"tax_lit"` BaseExSumP float64 `json:"base_ex_sum_p"`
TaxPercent float64 `json:"tax_percent"` BaseExSumM float64 `json:"base_ex_sum_m"`
TaxSumP float64 `json:"tax_sum_p"` TaxName string `json:"tax_name"`
TaxSumM float64 `json:"tax_sum_m"` TaxFname string `json:"tax_fname"`
ExName string `json:"ex_name"` TaxLit string `json:"tax_lit"`
ExPercent float64 `json:"ex_percent"` TaxPercent float64 `json:"tax_percent"`
ExSumP float64 `json:"ex_sum_p"` TaxSumP float64 `json:"tax_sum_p"`
ExSumM float64 `json:"ex_sum_m"` TaxSumM float64 `json:"tax_sum_m"`
ExName string `json:"ex_name"`
ExPercent float64 `json:"ex_percent"`
ExSumP float64 `json:"ex_sum_p"`
ExSumM float64 `json:"ex_sum_m"`
ActivationDt string `json:"activation_dt"`
TaxNotIncl int `json:"tax_not_incl"`
TaxAlg int `json:"tax_alg"`
TaxLink int `json:"tax_link"`
} }
type ZReportPay struct { type ZReportPay struct {
Type int `json:"type"` Type int `json:"type"`
Name string `json:"name"` Name string `json:"name"`
SumP float64 `json:"sum_p"` SumP float64 `json:"sum_p"`
SumM float64 `json:"sum_m"` SumM float64 `json:"sum_m"`
RoundPu float64 `json:"round_pu"` RoundPu float64 `json:"round_pu"`
RoundPd float64 `json:"round_pd"` RoundPd float64 `json:"round_pd"`
RoundMu float64 `json:"round_mu"` RoundMu float64 `json:"round_mu"`
RoundMd float64 `json:"round_md"` RoundMd float64 `json:"round_md"`
CommissionP float64 `json:"commission_p"`
CommissionM float64 `json:"commission_m"`
SumTaxM float64 `json:"sum_tax_m"`
} }
type ZReportMoney struct { type ZReportMoney struct {

View File

@@ -7,9 +7,10 @@ import (
func ExampleBasicUsage() { func ExampleBasicUsage() {
client := NewClient(Config{ client := NewClient(Config{
Token: "your-token", Token: "your-token",
Cashier: "Иванов", Cashier: "Иванов",
Source: "parking", Source: "parking",
CustomURL: "DM URL/",
}) })
ctx := context.Background() ctx := context.Background()

View File

@@ -26,10 +26,12 @@ type Client struct {
} }
type Config struct { type Config struct {
Token string Token string
Cashier string Cashier string
Source string Source string
Defaults *DefaultParams Defaults *DefaultParams
CustomURL string
Device string
} }
type DefaultParams struct { type DefaultParams struct {
@@ -65,8 +67,15 @@ func NewClient(config Config) *Client {
defaults.DefaultTimeout = 30 * time.Second defaults.DefaultTimeout = 30 * time.Second
} }
var apicfg *api.Client
if config.CustomURL == "" {
apicfg = api.NewClient(config.Token)
} else {
apicfg = api.NewDMClient(config.Token, config.CustomURL, config.Device)
}
return &Client{ return &Client{
api: api.NewClient(config.Token), api: apicfg,
cashier: config.Cashier, cashier: config.Cashier,
source: config.Source, source: config.Source,
defaults: defaults, defaults: defaults,
@@ -274,3 +283,23 @@ func (c *Client) QuickSellNamed(ctx context.Context, name string, price float64)
Price: price, Price: price,
}) })
} }
func (c *Client) ZeroReceipt(ctx context.Context) (*api.SellResponse, error) {
return c.api.Sell(ctx, api.SellParams{
Cashier: c.cashier,
Source: c.source,
Rows: []api.ReceiptRow{},
Pays: []api.ReceiptPay{},
CommentUP: "Нульовий чек",
})
}
func (c *Client) ZeroReceiptWithTimeout(timeout time.Duration) (*api.SellResponse, error) {
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
return c.ZeroReceipt(ctx)
}
func (c *Client) ZeroReceiptDefault() (*api.SellResponse, error) {
return c.ZeroReceiptWithTimeout(c.defaults.DefaultTimeout)
}