/
general_types.go
64 lines (52 loc) · 1.61 KB
/
general_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package acquiring
// MerchantPaymInfo - інформація про платіж
type MerchantPaymInfo struct {
Reference string `json:"reference"`
Destination string `json:"destination"`
Comment string `json:"comment"`
CustomerEmails []string `json:"customerEmails"`
BasketOrder []*BasketOrder `json:"basketOrder"`
}
// BasketOrder - товари в чеку
type BasketOrder struct {
Name string `json:"name"`
Qty float64 `json:"qty"`
Sum int64 `json:"sum"`
Icon string `json:"icon"`
Unit string `json:"unit"`
Code string `json:"code"`
Barcode string `json:"barcode"`
Header string `json:"header"`
Footer string `json:"footer"`
Tax []int `json:"tax"`
UKTZED string `json:"uktzed"`
Discounts []*Discount `json:"discounts"`
}
type DiscountType string
const (
// DiscountTypeDiscount - знижка
DiscountTypeDiscount DiscountType = "DISCOUNT"
// DiscountTypeExtraCharge - надбавка
DiscountTypeExtraCharge DiscountType = "EXTRA_CHARGE"
)
type DiscountMode string
const (
// DiscountModePercent - відсоток
DiscountModePercent DiscountMode = "PERCENT"
// DiscountModeValue - сума
DiscountModeValue DiscountMode = "VALUE"
)
type Discount struct {
Type DiscountType `json:"type"`
Mode DiscountMode `json:"mode"`
Value float64 `json:"value"`
}
type SaveCardData struct {
SaveCard bool `json:"saveCard"`
WalletID string `json:"walletId"`
}
type PaymentType string
const (
Debit PaymentType = "debit"
Hold PaymentType = "hold"
)