Why my PassBook isn't valid or outdate? - ruby-on-rails

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:
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!

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.

Related

Does POST /reviews-v1 using Crucible REST API allow us to add reviewers?

Is there a way to add reviewers when creating a code review through the REST API? I tried adding "reviewers" with an array of usernames but that didn't work. Got an error
Unrecognized field "reviewers" (Class com.atlassian.crucible.spi.data.ReviewData), not marked as ignorable
The request body example on their api docs is below:
{
"reviewData" : {
"projectKey" : "CR-FOO",
"name" : "Example review.",
"description" : "Description or statement of objectives for this example review.",
"author" : {
"userName" : "auth",
"displayName" : "Jane Authy",
},
"moderator" : {
"userName" : "scott",
"displayName" : "Scott the Moderator",
},
"creator" : {
"userName" : "joe",
"displayName" : "Joe Krustofski",
},
"permaId" : {
"id" : "CR-FOO-21"
},
"summary" : "some review summary.",
"state" : "Review",
"type" : "REVIEW",
"allowReviewersToJoin" : true,
"metricsVersion" : 4,
"createDate" : "2022-06-20T09:37:11.621+0000",
"dueDate" : "2022-06-23T09:37:11.621+0000",
"reminderDate" : "2022-06-21T09:37:11.621+0000",
"linkedIssues" : [ "DEF-456", "ABC-123", "GHI-789" ],
"jiraIssueKey" : "ABC-123"
},
"patch" : "Index: emptytests/notempty/a.txt\n===================================================================\ndiff -u -N -r1.31 -r1.32\n--- emptytests/notempty/a.txt\t22 Sep 2004 00:38:15 -0000\t1.31\n+++ emptytests/notempty/a.txt\t5 Dec 2004 01:04:25 -0000\t1.32\n## -4,4 +4,5 ##\n hello there :D\n CRU-123\n http://madbean.com/blog/\n-!\n\\ No newline at end of file\n+!\n+foobie\n\\ No newline at end of file\nIndex: test/a.txt\n===================================================================\ndiff -u -N -r1.31 -r1.32\n--- test/a.txt\t22 Sep 2004 00:38:15 -0000\t1.31\n+++ test/a.txt\t5 Dec 2004 01:04:25 -0000\t1.32\n## -4,4 +4,5 ##\n hello there :D\n CRU-123\n http://madbean.com/blog/\n-!\n\\ No newline at end of file\n+!\n+foobie\n\\ No newline at end of file",
"anchor" : {
"anchorPath" : "/",
"anchorRepository" : "REPO",
"stripCount" : 2
},
"changesets" : {
"changesetData" : [ {
"id" : "63452"
} ],
"repository" : "REPO"
}
}

How to fix issue regarding pkpass not working after dragging to ios simulator?

I am currently creating a passcard for my app but unfortunately, it is not working. Passcard is not showing in the simulator when dragging it or event downloading it from my email. My pass.json codes are below.
"formatVersion" : 1,
"passTypeIdentifier" : "pass.com.example",
"serialNumber" : "0000000",
"teamIdentifier" : "xxxxxxxx",
"barcode" : {
"message" : "123456789",
"format" : "PKBarcodeFormatPDF417",
"messageEncoding" : "iso-8859-1",
},
"organizationName" : "companyname",
"description" : "companytagline",
"logoText" : "companyname",
"foregroundColor" : "rgb(255,255,255)",
"backgroundColor": "rgb(0,100,0)",
"generic" : {
"auxiliaryFields" : [
{
"key" : "patientName",
"label" : "NAME",
"value" : "Retail Pharmacy 1, Test Patient"
},
{
"key" : "gender",
"label" : "GENDER",
"value" : "Female"
}
],
}
}
This is what I have in my Terminal
hopprlabs-iMac:Desktop developer1$ ./signpass -p healthpass.raw/
2019-02-19 10:10:39.483 signpass[2096:231781] {
".DS_Store" = df2fbeb1400acda0909a32c1cf6bf492f1121e07;
"Icon.png" = 295cb779e5e185efefd6c5e9a2a94c3352e51b2a;
"Icon#2x.png" = 987db966ddc28a72d6bfd15a6565d191be06d0f0;
"pass.json" = 3e66cf17f758939547932654c3394e42470d1c94;
"thumbnail.png" = 2a616d4490d1e12d81ddb0610df6b992ad79aeca;
}
Thanks for emailing that through. Having looked at the package, it seems there is a problem with your icon file.
The iPhone reports this error like this:
Invalid data error reading pass pass.com./0000000. Pass does not contain icon.png/icon#2x.png/icon#3x.png
I suggest making your icon file names lower case, so icon.png instead of Icon.png.
I would also include the #3x size file too.

Spring Data Neo4j corrupted json

I'm using neo4j with spring data, when I store an object with inside a relation I get as a result of the findAll a corrupted json. I never get this error when I query the objects one at time.
Even more strange the first one in the list is correct but the second has this error. The error is at the edge field. Any idea?
[{
"uuid" : "e5c90af5-6259-4ddf-ae1f-c0cff5a41296",
"name" : "test",
"createdBy" : {
"uuid" : "319535cc-288f-4a23-bc02-a3b01bf6e93f",
"createdAt" : "2017-03-10T02:06:55.925+0000",
"user" : {
"uuid" : "9e91032e-a54d-4297-8a6a-1506589b7529",
},
"edge" : { "id" : 6514
},
"graphId" : 664
}
},
{
"uuid" : "e5c90af5-6259-4ddf-ae1f-c0cff5a41296",
"name" : "test",
"createdBy" : {
"uuid" : "319535cc-288f-4a23-bc02-a3b01bf6e93f",
"createdAt" : "2017-03-10T02:06:55.925+0000",
"user" : {
"uuid" : "9e91032e-a54d-4297-8a6a-1506589b7529",
},
"edge" : { : 6514
},
"graphId" : 664
}
}]

Is it possible to create Salesreceipt without product/service value through QBO API?

Is it possible to create Salesreceipt without product/service value through QBO API? I have tried through API but it's not reflecting rate value and storing description value only.
If I remove ItemRef attribute(in request body) then it's reflecting rate and amount values and it's assigning some default and random product/service.
It is possible directly in QBO UI.
Request body where only description value storing:
{
"TxnDate" : "2016-05-27",
"Line" : [ {
"Amount" : 2222.00,
"Description" : "hi chk",
"DetailType" : "ItemReceiptLineDetail",
"ItemReceiptLineDetail" : {
"ItemRef" : { },
"Qty" : 1,
"UnitPrice" : 2222
} }
],
"CustomerRef" : {
"value" : "67"
},
"CustomerMemo" : {
"value" : "Thanks for your business! We appreciate referrals!"
},
"TotalAmt": 2222.00,
"PrivateNote" : "",
"CustomField" : [ {
"DefinitionId" : "1",
"Type" : "StringType",
"StringValue" : ""
} ]
}
Request body where default product/service assigning:
{
"TxnDate" : "2016-05-27",
"Line" : [ {
"Amount" : 2222.00,
"Description" : "hi chk",
"DetailType" : "ItemReceiptLineDetail",
"ItemReceiptLineDetail" : {
"Qty" : 1,
"UnitPrice" : 2222
} }
],
"CustomerRef" : {
"value" : "67"
},
"CustomerMemo" : {
"value" : "Thanks for your business! We appreciate referrals!"
},
"TotalAmt": 2222.00,
"PrivateNote" : "",
"CustomField" : [ {
"DefinitionId" : "1",
"Type" : "StringType",
"StringValue" : ""
} ]
}
No.
QuickBooks Online does not support this.

How to make projections of selected attributes in mongoid?

I have Coordinate model with many markers embedded_in User model. How to extract attributes without _ids so that on output display only each lng and lat?
structure:
{ "_id" : ObjectId( "4e9f418f1e7bf20fbc000009" ),
"name" : "test",
"coordinates" : [
{ "lng" : 16.86783310009764,
"lat" : 52.38353842845282,
"_id" : ObjectId( "4e9f418f1e7bf20fbc00000a" ) },
{ "lng" : 16.85787674023436,
"lat" : 52.40972501601293,
"_id" : ObjectId( "4e9f418f1e7bf20fbc00000b" ) },
{ "lng" : 16.92276474072264,
"lat" : 52.40071858320756,
"_id" : ObjectId( "4e9f418f1e7bf20fbc00000c" ) },
{ "lng" : 16.90182205273436,
"lat" : 52.38270020105396,
"_id" : ObjectId( "4e9f418f1e7bf20fbc00000d" ) },
{ "lng" : 16.96705337597655,
"lat" : 52.410661698108,
"_id" : ObjectId( "4e9f418f1e7bf20fbc00000e" ) },
{ "lng" : 16.89495559765624,
"lat" : 52.42773236584494,
"_id" : ObjectId( "4e9f418f1e7bf20fbc00000f" ) } ] }
e.g.
= debug #user.coordinates.to_json
gives:
--- ! '[{"_id":"4e9f418f1e7bf20fbc00000a","lat":52.383538428452816,"lng":16.86783310009764},{"_id":"4e9f418f1e7bf20fbc00000b","lat":52.40972501601293,"lng":16.85787674023436},{"_id":"4e9f418f1e7bf20fbc00000c","lat":52.40071858320756,"lng":16.92276474072264},{"_id":"4e9f418f1e7bf20fbc00000d","lat":52.382700201053964,"lng":16.90182205273436},{"_id":"4e9f418f1e7bf20fbc00000e","lat":52.410661698108,"lng":16.967053375976548},{"_id":"4e9f418f1e7bf20fbc00000f","lat":52.42773236584494,"lng":16.894955597656235}]'
expected:
--- ! '[{"lat":52.383538428452816,"lng":16.86783310009764},{"lat":52.40972501601293,"lng":16.85787674023436},{"lat":52.40071858320756,"lng":16.92276474072264},{"lat":52.382700201053964,"lng":16.90182205273436},{"lat":52.410661698108,"lng":16.967053375976548},{"lat":52.42773236584494,"lng":16.894955597656235}]'
Try using except
#user.coordinates.to_json(:except => '_id')
the accepted answer returns data you wished. I would suggest though to use without against mongoid query so you actually do not fetch the data from DB, which is ideal.
#user.coordinates.without('_id').to_json(:except => '_id')

Resources