Properly handle ListPurchaseHistory

This commit is contained in:
Sketch 2022-10-20 13:16:28 -04:00
parent 479edf4534
commit 58f9612429
2 changed files with 25 additions and 19 deletions

19
ecs.go
View File

@ -167,20 +167,27 @@ func purchaseTitle(e *Envelope) {
}
func listPurchaseHistory(e *Envelope) {
// TODO(SketchMaster2001) Query database for transactions
e.AddCustomType([]Transactions{
{
TransactionId: "00000000",
Date: e.Timestamp(),
Type: string(SERVICE),
// Is timestamp in milliseconds, placeholder one is Wed Oct 19 2022 18:02:46
Date: "1666202566218",
Type: "PURCHGAME",
TotalPaid: 0,
Currency: "POINTS",
ItemId: 0,
TitleId: "000100014843494A",
ItemPricing: []Limits{
LimitStruct(DR),
ItemPricing: Prices{
ItemId: 0,
Price: Price{
Amount: 0,
Currency: "POINTS",
},
Limits: LimitStruct(PR),
LicenseKind: PERMANENT,
},
TitleId: "000101006843494A",
ReferenceId: "01234567890123456789012345678912",
ReferenceValue: 1,
},
})

View File

@ -117,8 +117,7 @@ type Transactions struct {
TotalPaid int `xml:"TotalPaid"`
Currency string `xml:"Currency"`
ItemId int `xml:"ItemId"`
// TODO: Is this correct? getComplex is called and then limits are queried
ItemPricing []Limits `xml:"ItemPricing"`
ItemPricing Prices `xml:"ItemPricing"`
TitleId string `xml:"TitleId,omitempty"`
ItemCode int `xml:"ItemCode,omitempty"`
ReferenceId string `xml:"ReferenceId,omitempty"`