wallet-samples
wallet-samples copied to clipboard
Creating generic pass with template info using google client library
Hello
Could you please let us know how to create programmatically a generic card pass in .net using google client library? Would like to know to to define the filed path for my texmodules.
Something like this:
GenericObject newObject = new GenericObject
{
TextModulesData = new List<TextModuleData>
{
new TextModuleData
{
Header = eventTicketDTO.NameLabel,
Body = eventTicketDTO.Name,
Id = "nome"
},
new TextModuleData
{
Header = eventTicketDTO.AssociatedLabel,
Body = eventTicketDTO.Associated,
Id = "socio"
},
new TextModuleData
{
Header = eventTicketDTO.BenchLabel,
Body = eventTicketDTO.Bench,
Id = "bancada",
}
}
}
and class like
GenericClass newClass = new GenericClass
{
Id = $"{issuerId}.{classSuffix}",
ClassTemplateInfo = new ClassTemplateInfo
{
CardTemplateOverride = new CardTemplateOverride
{
CardRowTemplateInfos = new List<CardRowTemplateInfo>
{
new CardRowTemplateInfo()
{
OneItem = new CardRowOneItem
{
Item = new TemplateItem
{
FirstValue= new FieldSelector
{
Fields = new List<FieldReference>
{
new FieldReference
{
FieldPath = "object.payload.genericObjects[0].textModulesData[0].id"
}
}
},
SecondValue= new FieldSelector
{
Fields = new List<FieldReference>
{
new FieldReference
{
FieldPath = "object.payload.genericObjects[0].textModulesData[0].id"
}
}
}
}
}
},
}
}
}
For some reason all of my attemps its not working, its not defining a template and referencing the values
Thanks a lot!
@miguelRedit I'm also looking for a way to create a google generic pass using C#, but no results have been found. Have to got anything? Please let me know