Hello,
I am working on making a purchasable item and the big long base64 encoded receipt is failing verification. iTunes responds with the 21002[1] code: "data in the receipt-data property was malformed".
What is odd is that I have another "good" receipt I test /verifyReceipt with and there is a difference between the two. I base64 decoded the receipts to get the binary form and ran it through strings to pull out any human readable strings.
good-receipt.txt has a valid receipt that passes /verifyReceipt
$ base64 -d good-receipt.txt | strings
...
http://crl.apple.com/root.crl0
m:Y\
k[<=
Apple Inc.1&0$
Apple Certification Authority1
Apple Root CA0
060425214036Z
350209214036Z0b1
Apple Inc.1&0$
Apple Certification Authority1
Apple Root CA0
, op
https://www.apple.com/appleca/0
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.0
=&g
Sj[d
uu!1
Apple Inc.1,0*
#Apple Worldwide Developer Relations1D0B
;Apple Worldwide Developer Relations Certification Authority
bad-receipt.txt is a malformed receipt that returns 21002 from /verifyReceipt
$ base64 -d bad-receipt.txt | strings
...
4000-12-31T19:00:00-0500
StoreKit1
StoreKit1
StoreKit1
StoreKit0
200401175235Z
400327175235Z0_1
StoreKit1
StoreKit1
StoreKit1
StoreKit0
uw[S
_P+\)
;090 V,
v7R
0d0_1
StoreKit1
StoreKit1
StoreKit1
StoreKit
<=D D1
In^FVw
In the good receipt it looks like it has some embedded cert information. In the bad receipt it doesn't look like that exists. My guess is that is what is making it fail verification.
Does anyone know why that is missing?
[1] https://developer.apple.com/documentation/appstorereceipts/status