-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpreference.model.go
84 lines (81 loc) · 3.54 KB
/
preference.model.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
package mercadopago
// Preference is the data struct for payment checkouts
type Preference struct {
Items []Item `json:"items,omitempty"`
Payer struct {
Name string `json:"name,omitempty"`
Surname string `json:"surname,omitempty"`
Email string `json:"email,omitempty"`
Phone struct {
AreaCode string `json:"area_code,omitempty"`
Number string `json:"number,omitempty"`
} `json:"phone,omitempty"`
Identification struct {
Type string `json:"type,omitempty"`
Number string `json:"number,omitempty"`
} `json:"identification,omitempty"`
Address struct {
ZipCode string `json:"zip_code,omitempty"`
Street string `json:"street,omitempty"`
Number int `json:"number,omitempty"`
} `json:"address,omitempty"`
DateCreated string `json:"date_created,omitempty"`
} `json:"payer,omitempty"`
PaymentMethods struct {
ExcludedPaymentMethods []ID `json:"excluded_payment_methods,omitempty"`
ExcludedPaymentTypes []ID `json:"excluded_payment_types,omitempty"`
DefaultPaymentMethodID string `json:"default_payment_method_id,omitempty"`
Installments int `json:"installments,omitempty"`
DefaultInstallments int `json:"default_installments,omitempty"`
} `json:"payment_methods,omitempty"`
Shipments struct {
Mode string `json:"mode,omitempty"`
LocalPickup bool `json:"local_pickup,omitempty"`
Dimensions string `json:"dimensions,omitempty"`
DefaultShippingMethod int `json:"default_shipping_method,omitempty"`
FreeMethods []ID `json:"free_methods,omitempty"`
Cost float32 `json:"cost,omitempty"`
FreeShipping bool `json:"free_shipping,omitempty"`
ReceiverAddress struct {
ZipCode string `json:"zip_code,omitempty"`
StreetName string `json:"street_name,omitempty"`
StreetNumber int `json:"street_number,omitempty"`
Floor string `json:"floor,omitempty"`
Apartment string `json:"apartment,omitempty"`
} `json:"receiver_address,omitempty"`
} `json:"shipments,omitempty"`
BackUrls struct {
Success string `json:"success,omitempty"`
Pending string `json:"pending,omitempty"`
Failure string `json:"failure,omitempty"`
} `json:"back_urls,omitempty"`
NotificationURL string `json:"notification_url,omitempty"`
ID string `json:"id,omitempty"`
InitPoint string `json:"init_point,omitempty"`
SandboxInitPoint string `json:"sandbox_init_point,omitempty"`
DateCreated string `json:"date_created,omitempty"`
OperationType string `json:"operation_type,omitempty"`
AdditionalInfo string `json:"additional_info,omitempty"`
AutoReturn string `json:"auto_return,omitempty"`
ExternalReference string `json:"external_reference,omitempty"`
Expires bool `json:"expires,omitempty"`
ExpirationDateFrom string `json:"expiration_date_from,omitempty"`
ExpirationDateTo string `json:"expiration_date_to,omitempty"`
CollectorID int `json:"collector_id,omitempty"`
ClientID string `json:"client_id,omitempty"`
}
// Item information
type Item struct {
ID string `json:"id,omitempty"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
PictureURL string `json:"picture_url,omitempty"`
CategoryID string `json:"category_id,omitempty"`
Quantity int `json:"quantity,omitempty"`
CurrencyID string `json:"currency_id,omitempty"`
UnitPrice float32 `json:"unit_price,omitempty"`
}
// ID generic struct
type ID struct {
ID string `json:"id,omitempty"`
}