diff --git a/ecs.go b/ecs.go index b878d48..3c1d24e 100644 --- a/ecs.go +++ b/ecs.go @@ -108,15 +108,21 @@ func purchaseTitle(e *Envelope) { } func listPurchaseHistory(e *Envelope) { - e.AddCustomType(Transactions{ - TransactionId: "12345678", - Date: e.Timestamp(), - Type: "SERVICE", - TotalPaid: "7", - Currency: "POINTS", - ItemId: "17", - ItemPricing: "7", - Limits: LimitStruct(DR), + e.AddCustomType([]Transactions{ + { + TransactionId: "12345678", + Date: e.Timestamp(), + Type: "SERVICE", + TotalPaid: "7", + Currency: "POINTS", + ItemId: "000100014843494A", + TitleId: "000100014843494A", + ItemPricing: []Limits{ + LimitStruct(DR), + }, + ReferenceId: 1, + ReferenceValue: 19224, + }, }) e.AddKVNode("ListResultTotalSize", "1") diff --git a/structure.go b/structure.go index 31615f1..4044767 100644 --- a/structure.go +++ b/structure.go @@ -133,8 +133,8 @@ func LimitStruct(kind LimitKinds) Limits { // Limits represents a common XML structure for transaction information. type Limits struct { XMLName xml.Name `xml:"Limits"` - Limits LimitKinds `xml:"Limits"` - LimitKind string `xml:"LimitKind"` + Limits LimitKinds `xml:"Limits,omitempty"` + LimitKind string `xml:"LimitKind,omitempty"` } // Transactions represents a common XML structure. @@ -146,12 +146,12 @@ type Transactions struct { TotalPaid string `xml:"TotalPaid"` Currency string `xml:"Currency"` ItemId string `xml:"ItemId"` - ItemPricing string `xml:"ItemPricing"` - Limits Limits `xml:"Limits"` + // TODO: Is this correct? getComplex is called and then limits are queried + ItemPricing []Limits `xml:"ItemPricing"` TitleId string `xml:"TitleId,omitempty"` ItemCode int `xml:"ItemCode,omitempty"` ReferenceId int `xml:"ReferenceId,omitempty"` - ReferenceValue string `xml:"ReferenceValue,omitempty"` + ReferenceValue int `xml:"ReferenceValue,omitempty"` } // Tickets represents the format to inform a console of available titles for its consumption.