-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcart_types.go
138 lines (123 loc) · 6.72 KB
/
cart_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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package magento2
import "fmt"
type ItemNotFoundError struct {
ItemID int
}
func (a *ItemNotFoundError) Error() string {
return fmt.Sprintf("itemID '%d' is non-existent", a.ItemID)
}
type Cart struct {
ID int `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
ConvertedAt string `json:"converted_at"`
IsActive bool `json:"is_active"`
IsVirtual bool `json:"is_virtual"`
Items []CartItem `json:"items"`
ItemsCount int `json:"items_count"`
ItemsQty int `json:"items_qty"`
Customer Customer `json:"customer"`
BillingAddress *BillingAddress `json:"billing_address"`
ReservedOrderID int `json:"reserved_order_id"`
OrigOrderID int `json:"orig_order_id"`
Currency Currency `json:"currency"`
CustomerIsGuest bool `json:"customer_is_guest"`
CustomerNote string `json:"customer_note"`
CustomerNoteNotify bool `json:"customer_note_notify"`
CustomerTaxClassID int `json:"customer_tax_class_id"`
StoreID int `json:"store_id"`
ExtensionAttributes map[string]interface{} `json:"extension_attributes"`
}
type CartItem struct {
ItemID int `json:"item_id,omitempty"`
Sku string `json:"sku"`
Qty float64 `json:"qty"`
Name string `json:"name,omitempty"`
Price float64 `json:"price,omitempty"`
ProductType string `json:"product_type,omitempty"`
QuoteID string `json:"quote_id"`
ProductOption CartProductOption `json:"product_option,omitempty"`
ExtensionAttributes map[string]interface{} `json:"extension_attributes,omitempty"`
}
type CartProductOption struct {
ExtensionAttributes map[string]interface{} `json:"extension_attributes,omitempty"`
}
type Customer struct {
ID int `json:"id,omitempty"`
GroupID int `json:"group_id,omitempty"`
DefaultBilling string `json:"default_billing,omitempty"`
DefaultShipping string `json:"default_shipping,omitempty"`
Confirmation string `json:"confirmation,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
CreatedIn string `json:"created_in,omitempty"`
Dob string `json:"dob,omitempty"`
Email string `json:"email,omitempty"`
Firstname string `json:"firstname,omitempty"`
Lastname string `json:"lastname,omitempty"`
Middlename string `json:"middlename,omitempty"`
Prefix string `json:"prefix,omitempty"`
Suffix string `json:"suffix,omitempty"`
Gender int `json:"gender,omitempty"`
StoreID int `json:"store_id,omitempty"`
Taxvat string `json:"taxvat,omitempty"`
WebsiteID int `json:"website_id,omitempty"`
Addresses []Address `json:"addresses,omitempty"`
DisableAutoGroupChange int `json:"disable_auto_group_change,omitempty"`
ExtensionAttributes map[string]interface{} `json:"extension_attributes,omitempty"`
CustomAttributes []map[string]interface{} `json:"custom_attributes,omitempty"`
}
type Currency struct {
GlobalCurrencyCode string `json:"global_currency_code,omitempty"`
BaseCurrencyCode string `json:"base_currency_code,omitempty"`
StoreCurrencyCode string `json:"store_currency_code,omitempty"`
QuoteCurrencyCode string `json:"quote_currency_code,omitempty"`
StoreToBaseRate int `json:"store_to_base_rate,omitempty"`
StoreToQuoteRate int `json:"store_to_quote_rate,omitempty"`
BaseToGlobalRate int `json:"base_to_global_rate,omitempty"`
BaseToQuoteRate int `json:"base_to_quote_rate,omitempty"`
ExtensionAttributes map[string]interface{} `json:"extension_attributes,omitempty"`
}
type AddressInformation struct {
ShippingAddress *ShippingAddress `json:"shipping_address"`
BillingAddress *BillingAddress `json:"billing_address"`
ShippingMethodCode string `json:"shipping_method_code"`
ShippingCarrierCodes string `json:"shipping_carrier_code"`
ExtensionAttributes map[string]interface{} `json:"extension_attributes,omitempty"`
CustomAttributes []map[string]interface{} `json:"custom_attributes,omitempty"`
}
type PaymentMethodCode struct {
Method string `json:"method"`
}
type Region struct {
RegionCode string `json:"region_code,omitempty"`
Region string `json:"region,omitempty"`
RegionID int `json:"region_id,omitempty"`
ExtensionAttributes map[string]interface{} `json:"extension_attributes,omitempty"`
}
type Shipping struct {
Address Address `json:"address,omitempty"`
Method string `json:"method,omitempty"`
ExtensionAttributes map[string]interface{} `json:"extension_attributes,omitempty"`
}
type ShippingAssignments struct {
Shipping Shipping `json:"shipping,omitempty"`
Items []Item `json:"items,omitempty"`
ExtensionAttributes map[string]interface{} `json:"extension_attributes,omitempty"`
}
type PaymentMethod struct {
Code string `json:"code"`
Title string `json:"title"`
}
type Carrier struct {
CarrierCode string `json:"carrier_code"`
MethodCode string `json:"method_code"`
CarrierTitle string `json:"carrier_title"`
MethodTitle string `json:"method_title"`
Amount float64 `json:"amount"`
BaseAmount float64 `json:"base_amount"`
Available bool `json:"available"`
ErrorMessage string `json:"error_message,omitempty"`
PriceExclTax float64 `json:"price_excl_tax"`
PriceInclTax float64 `json:"price_incl_tax"`
}