forked from braintree-go/braintree-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plan.go
32 lines (29 loc) · 1.34 KB
/
plan.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
package braintree
type Plan struct {
XMLName string `xml:"plan"`
Id string `xml:"id"`
MerchantId string `xml:"merchant-id"`
BillingDayOfMonth string `xml:"billing-day-of-month"` // int
BillingFrequency string `xml:"billing-frequency"` // int
CurrencyISOCode string `xml:"currency-iso-code"`
Description string `xml:"description"`
Name string `xml:"name"`
NumberOfBillingCycles string `xml:"number-of-billing-cycles"` // int
Price float64 `xml:"price"`
TrialDuration string `xml:"trial-duration"` // int
TrialDurationUnit string `xml:"trial-duration-unit"`
TrialPeriod string `xml:"trial-period"` // bool
CreatedAt string `xml:"created-at"`
UpdatedAt string `xml:"updated-at"`
// AddOns []interface{} `xml:"add-ons"`
// Discounts []interface{} `xml:"discounts"`
}
// TODO(eaigner): it is suboptimal that we use string instead of int/bool types here,
// but I see no way around this atm to avoid integer parse errors if the field is empty.
//
// If there is a better method, and it can be unmarshalled directly to the correct type
// without errors, this needs to be changed.
type Plans struct {
XMLName string `xml:"plans"`
Plan []*Plan `xml:"plan"`
}