diff --git a/add_ons.go b/add_ons.go index 72f4952..d33748e 100644 --- a/add_ons.go +++ b/add_ons.go @@ -71,12 +71,13 @@ type UnitAmount struct { GBP int `xml:"GBP,omitempty"` CAD int `xml:"CAD,omitempty"` AUD int `xml:"AUD,omitempty"` + INR int `xml:"INR,omitempty"` } // MarshalXML ensures UnitAmount is not marshaled unless one or more currencies // has a value greater than zero. func (u UnitAmount) MarshalXML(e *xml.Encoder, start xml.StartElement) error { - if u.USD > 0 || u.EUR > 0 || u.CAD > 0 || u.GBP > 0 || u.AUD > 0 { + if u.USD > 0 || u.EUR > 0 || u.CAD > 0 || u.GBP > 0 || u.AUD > 0 || u.INR > 0 { type uaAlias UnitAmount e.EncodeElement(uaAlias(u), start) } diff --git a/add_ons_test.go b/add_ons_test.go index a904b87..6d4905a 100644 --- a/add_ons_test.go +++ b/add_ons_test.go @@ -244,6 +244,15 @@ func TestUnitAmount(t *testing.T) { `), }, + {v: s{Amount: recurly.UnitAmount{INR: 500}}, + expected: MustCompactString(` + + + 500 + + + `), + }, } buf := new(bytes.Buffer)