Why my PassBook isn't valid or outdate?

330 Views Asked by At

I generate one passbook using this gem in rails and it seen that works but when I open the passbook .pkpass file I see this message:

Invalid Passbook

It's in spanish but basically it says that this card isn't valid anymore.

Here is my JSON:

{
  "formatVersion" : 1,
  "passTypeIdentifier" : "{MY PASS ID HERE}",
  "serialNumber" : "E5982H-I2",
  "teamIdentifier" : "{MY TEAM ID HERE}",
  "webServiceURL" : "https://example.com/passes/",
  "authenticationToken" : "vxwxd7J8AlNNFPS8k0a0FfUFtq0ewzFdc",
  "barcode" : {
    "message" : "123456789",
    "format" : "PKBarcodeFormatPDF417",
    "messageEncoding" : "iso-8859-1"
  },
  "locations" : [
    {
      "longitude" : -122.3748889,
      "latitude" : 37.6189722
    },
    {
      "longitude" : -122.03118,
      "latitude" : 37.33182
    }
  ],
  "organizationName" : "CROCANTICKETS SL",
  "description" : "Paw Planet Coupon",
  "logoText" : "Paw Planet",
  "foregroundColor" : "rgb(255, 255, 255)",
  "backgroundColor" : "#FF4B33",
  "coupon" : {
    "primaryFields" : [
      {
        "key" : "offer",
        "label" : "Any premium dog food",
        "value" : "20% off"
      }
    ],
    "auxiliaryFields" : [
      {
        "key" : "expires",
        "label" : "EXPIRES",
        "value" : "2016-04-24T10:00-05:00",
        "isRelative" : true,
        "dateStyle" : "PKDateStyleShort"
      }
    ]
  }
}

Any idea? Thanks!

1

There are 1 best solutions below

0
On

According to the Expiration Keys in the Passbook Package Format Reference check the expirationDate and voided keys. Since you do not have those in your JSON, it might be added by the gem you are using.