passkit-generator: Can't generate boarding pass
Hi,
I’ve hit a problem trying to generate a boarding pass.
I have managed to generate a sample event type pass with no problem at all. It’s just the boarding pass that is giving me problems.
I’m seeing this error:
Schema validation failed due to error: "transitType" is not allowed +0ms
I do have transitType in the boadingPass object as you can see in my JSON
{
"formatVersion": 1,
"organizationName": "Hazardous Frog LTD",
"passTypeIdentifier": "pass.com.hazardousfrog.xxxxx",
"serialNumber": "placeholder",
"teamIdentifier": "AAAAAAAAAAA",
"description": "HF Rail Ticket",
"relevantDate": "2019-12-08T13:00-08:00",
"locations": [
{
"longitude": -122.3748889,
"latitude": 37.6189722
},
{
"longitude": -122.03118,
"latitude": 37.33182
}
],
"barcodes": [{
"message": "06FB3SHXG3Y00R1JTETQMAUZYHXLALMCRDZPWTFPFWKKBDSZSQEQTVYWSZZWWWNXSSUAXCDJDQTZMGODMFIRJCEWEKACPBNOUGZCDRESKGTKFTZNYDURPFILJFCVAHTQFHELJCXPYBCJJIIJPIRCVECCLQWFMGROBHRGFIRKPNJVKOOYCXTHRAIFSFXQQUVCARZROCACWBEGEWUVFKTDKNSQCACSGWUDBVDHMJMGH",
"format": "PKBarcodeFormatAztec",
"messageEncoding": "iso-8859-1"
}],
"logoText": "...Logo...",
"foregroundColor": "rgb(0, 0, 0)",
"backgroundColor": "rgb(255, 248, 242)",
"boardingPass": {
"transitType": "PKTransitTypeTrain",
"headerFields": [
{
"label": "journey",
"key": "journey",
"value": "Field E0001",
"textAlignment": "PKTextAlignmentLeft"
}
],
"primaryFields": [
{
"key": "depart",
"label": "depart",
"value": "27/11/2019",
"textAlignment": "PKTextAlignmentLeft"
},
{
"key": "arrive",
"label": "arrive",
"value": "27/11/2019",
"textAlignment": "PKTextAlignmentRight"
}
],
"secondaryFields": [
{
"key": "status",
"label": "status",
"value": "ADULT",
"textAlignment": "PKTextAlignmentLeft"
},
{
"key": "validuntil",
"label": "valid until",
"value": "27/11/2019",
"textAlignment": "PKTextAlignmentRight"
}
],
"auxiliaryFields": [
{
"key": "tickettype",
"label": "ticket type",
"value": "SOS",
"textAlignment": "PKTextAlignmentLeft"
},
{
"key": "route",
"label": "route",
"value": "Any Permitted",
"textAlignment": "PKTextAlignmentRight"
}
],
"backFields": [
{
"key": "itinerary",
"label": "itinerary",
"value": "itinerary goes here..."
},
{
"key": "freeinformation",
"value": "Field E0044"
},
{
"key": "contactinformation",
"label": "Contact Details",
"value": "Field E0022"
}
]
}
}
if I omit transitTyoe (as a test) I get this error instead:
UnhandledPromiseRejectionWarning: Error: Error: Cannot proceed with pass creation. transitType field is required for boardingPasses.
I’m using v 1.6.4 with Node 8.10.0
Do you have any idea what I am doing wrong here?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 27 (26 by maintainers)
@ianbale excuse me sir, are you sending up to 20 (or more) Tickets to the same device? May it be an option to send only one and update it accordingly?