Anatomy of an #IAP Receipt
After a In app purchase is made, then you get a digital receipt from Apple if you call storekit.loadReceipts – Which is effectively a double-encoded Base 64 string, When you encode once you get this:
{
“signature” = “… data …”;
“purchase-info” = “… data …”;
“environment” = “Sandbox”;
“pod” = “100”;
“signing-status” = “0”;
}
Where Signature and purchase-info are base64 encoded. Signature is effectively binary data, but you can make out some text that belies its contents
Apple Inc. Apple Worldwide Developer Relations
Apple Worldwide Developer Relations Certification Authority
Mac App Store and iTunes Store Receipt Signing,
Apple Worldwide Developer Relations
Apple Inc
http://ocsp.apple.com/ocsp03-wwdr
Reliance on this certificate by any party assumes acceptance of the then applicable standard terms and conditions of use, certificate policy and certification practice statements.
The purchase-info field is more JSON, which is more useful.
{
“original-purchase-date-pst” = “2017-03-21 13:25:40 America/Los_Angeles”;
“purchase-date-ms” = “1490127939469”;
“unique-identifier” = “d2c92e2ce1f259f623d66e6df364b4ed6da1b2cd”;
“original-transaction-id” = “1000000283718133”;
“expires-date” = “1490128239469”;
“transaction-id” = “1000000283718133”;
“original-purchase-date-ms” = “1490127940017”;
“web-order-line-item-id” = “1000000034637027”;
“bvrs” = “1.2.0”;
“unique-vendor-identifier” = “06FFEBC2-47F3-4848-AFB2-A45211674A81”;
“expires-date-formatted-pst” = “2017-03-21 13:30:39 America/Los_Angeles”;
“item-id” = “1215609502”;
“expires-date-formatted” = “2017-03-21 20:30:39 Etc/GMT”;
“product-id” = “CloudAnsweringMachineSubscription”;
“purchase-date” = “2017-03-21 20:25:39 Etc/GMT”;
“original-purchase-date” = “2017-03-21 20:25:40 Etc/GMT”;
“bid” = “ie.infiniteloop.cloudansweringmachine”;
“purchase-date-pst” = “2017-03-21 13:25:39 America/Los_Angeles”;
“quantity” = “1”;
}
Next step is to add a receipt verification feature: based on https://github.com/alxmsl/AppStoreClient/blob/master/source/Client.php and https://searchcode.com/codesearch/view/31620982/
LikeLike