Add isDM flag to Client and update FiscalRequest structure for DM support

This commit is contained in:
2026-01-16 02:41:11 +03:00
parent 861a1640d4
commit f23c4ffd1c
3 changed files with 15 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ import (
type Client struct {
token string
device string
isDM bool
resty *resty.Client
apiBaseURL string
fiscalEndpoint string
@@ -17,6 +18,7 @@ type Client struct {
func NewClient(token string) *Client {
return &Client{
token: token,
isDM: false,
resty: resty.New(),
apiBaseURL: "https://kasa.vchasno.ua/api/v3",
fiscalEndpoint: "/fiscal/execute",
@@ -38,6 +40,7 @@ func NewDMClient(token, dmURL, device string) *Client {
return &Client{
token: token,
device: device,
isDM: true,
resty: restyClient,
apiBaseURL: dmURL,
fiscalEndpoint: "/dm/execute",