-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathorder_edit.go
63 lines (56 loc) · 2.08 KB
/
order_edit.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
package woocommerce
type OrderCreateBilling struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Company string `json:"company"`
Address1 string `json:"address_1"`
Address2 string `json:"address_2"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Country string `json:"country"`
Email string `json:"email"`
Phone string `json:"phone"`
}
type OrderCreateShipping struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Address1 string `json:"address_1"`
Address2 string `json:"address_2"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Country string `json:"country"`
}
type OrderCreateItem struct {
ProductID int `json:"product_id"`
Quantity int `json:"quantity"`
Total Float `json:"total,omitempty"`
MetaData []OrderCreateMetadata `json:"meta_data,omitempty"`
}
type OrderCreateMetadata struct {
Key string `json:"key"`
Value string `json:"value"`
}
type OrderShippingLine struct {
MethodID string `json:"method_id"`
// Total is the total price of the shipping line.
// It is formatted on two decimal with '.' as decimal separator.
Total string `json:"total"`
}
type OrderCreate struct {
CustomerID int `json:"customer_id,omitempty"`
PaymentMethod string `json:"payment_method"`
PaymentMethodTitle string `json:"payment_method_title"`
Currency string `json:"currency"`
SetPaid bool `json:"set_paid"`
Billing OrderCreateBilling `json:"billing"`
Shipping OrderCreateShipping `json:"shipping"`
Items []OrderCreateItem `json:"line_items"`
MetaData []OrderCreateMetadata `json:"meta_data"`
ShippingLines []OrderShippingLine `json:"shipping_lines"`
CouponLines []OrderCoupon `json:"coupon_lines,omitempty"`
}
type OrderUpdate struct {
SetPaid bool `json:"set_paid"`
}