Attempt something

I honestly forget what I was doing, but it's pending and I'll change it later anyway
This commit is contained in:
Spotlight 2021-09-28 16:11:33 -05:00
parent bd48515bf9
commit ca3eabab27
No known key found for this signature in database
GPG Key ID: 874AA355B3209BDC
2 changed files with 20 additions and 14 deletions

24
ecs.go
View File

@ -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")

View File

@ -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.