-
Notifications
You must be signed in to change notification settings - Fork 0
/
orders.go
92 lines (82 loc) · 2.95 KB
/
orders.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//********************************************************************************************************************//
//
// Copyright (C) 2018 - 2022 J&J Ideenschmiede GmbH <info@jj-ideenschmiede.de>
//
// This file is part of gotradebyte.
// All code may be used. Feel free and maybe code something better.
//
// Author: Jonas Kwiedor (aka gowizzard)
//
//********************************************************************************************************************//
package gotradebyte
// OrdersBody is to decode xml data
type OrdersBody struct {
Order []OrdersBodyOrder `xml:"ORDER"`
}
type OrdersBodyOrder struct {
OrderData OrdersBodyOrderData `xml:"ORDER_DATA"`
SellTo OrdersBodySellTo `xml:"SELL_TO"`
ShipTo OrdersBodyShipTo `xml:"SHIP_TO"`
Shipment OrdersBodyShipment `xml:"SHIPMENT"`
Payment OrdersBodyPayment `xml:"PAYMENT"`
Items OrdersBodyItems `xml:"ITEMS"`
}
type OrdersBodyOrderData struct {
OrderDate string `xml:"ORDER_DATE"`
TbId int `xml:"TB_ID"`
ChannelSign string `xml:"CHANNEL_SIGN"`
ChannelId string `xml:"CHANNEL_ID"`
ChannelNo string `xml:"CHANNEL_NO"`
Approved int `xml:"APPROVED"`
ItemCount int `xml:"ITEM_COUNT"`
TotalItemAmount string `xml:"TOTAL_ITEM_AMOUNT"`
DateCreated string `xml:"DATE_CREATED"`
}
type OrdersBodySellTo struct {
TbId int `xml:"TB_ID"`
ChannelNo string `xml:"CHANNEL_NO"`
FirstName string `xml:"FIRSTNAME"`
LastName string `xml:"LASTNAME"`
StreetNo string `xml:"STREET_NO"`
StreetExtension string `xml:"STREET_EXTENSION"`
Zip string `xml:"ZIP"`
City string `xml:"CITY"`
Country string `xml:"COUNTRY"`
PhonePrivate string `xml:"PHONE_PRIVATE"`
Email string `xml:"EMAIL"`
}
type OrdersBodyShipTo struct {
TbId int `xml:"TB_ID"`
ChannelNo string `xml:"CHANNEL_NO"`
FirstName string `xml:"FIRSTNAME"`
LastName string `xml:"LASTNAME"`
StreetNo string `xml:"STREET_NO"`
StreetExtension string `xml:"STREET_EXTENSION"`
Zip string `xml:"ZIP"`
City string `xml:"CITY"`
Country string `xml:"COUNTRY"`
PhonePrivate string `xml:"PHONE_PRIVATE"`
Email string `xml:"EMAIL"`
}
type OrdersBodyShipment struct {
Price float64 `xml:"PRICE"`
}
type OrdersBodyPayment struct {
Type string `xml:"TYPE"`
Costs float64 `xml:"COSTS"`
DirectDebit interface{} `xml:"DIRECTDEBIT"`
}
type OrdersBodyItems struct {
Item []OrdersBodyItem `xml:"ITEM"`
}
type OrdersBodyItem struct {
TbId int `xml:"TB_ID"`
ChannelId string `xml:"CHANNEL_ID"`
Sku int `xml:"SKU"`
ChannelSku string `xml:"CHANNEL_SKU"`
Quantity int `xml:"QUANTITY"`
BillingText string `xml:"BILLING_TEXT"`
TransferPrice float64 `xml:"TRANSFER_PRICE"`
ItemPrice float64 `xml:"ITEM_PRICE"`
DateCreated string `xml:"DATE_CREATED"`
}