Receipt Validation Programming Guide / Receipt Fields documentation about "purchase_date" field must be fixed.

Originator:s.pankevich
Number:rdar://32812991 Date Originated:16-Jun-2017 1:50 PM
Status:Open Resolved:
Product:StoreKit Product Version:Xcode Version 8.3.2 (8E2002)
Classification:Serious Bug Reproducible:Always
 
Area:
StoreKit

Summary:
https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html

This is the text for `purchase_date` field:
"
This value corresponds to the transaction’s transactionDate property.

For a transaction that restores a previous transaction, the purchase date is the same as the original purchase date. Use Original Purchase Date to get the date of the original transaction.

In an auto-renewable subscription receipt, this is always the date when the subscription was purchased or renewed, regardless of whether the transaction has been restored.
"

From our testing we clearly see that the following is not correct:

"For a transaction that restores a previous transaction, the purchase date is the same as the original purchase date."

It is exactly the opposite "for a transaction that does not restore a previous transaction, the purchase date is the same as the original purchase date."

If transaction does not restore, the dates `original_purchase_date` and `purchase_date` are equal, otherwise `purchase_date` is the date of a transaction that restores original transaction.

Steps to Reproduce:
- Purchase a subscription product, look at the corresponding Receipt, record the evidence that `original_purchase_date` is equal to `purchase_date`.
- Restore this product later, record the evidence that Receipt that restores this product now has `original_purchase_date` equal to original purchase date and `purchase_date` equal to the current date of when transaction is being restored.

Expected Results:
We expect the documentation to correspond to what actually happens.

Observed Results:
We expect the documentation to correspond to what actually happens.

Version:
Xcode 8.3.2

Notes:


Configuration:

Comments

Response from Stanislav Pankevich

Stanislaw Pankevich September 20 2017, 11:33 PM Thanks for looking into this. "The first line “For a transaction that restores a previous transaction, the purchase date is the same as the original purchase date”, applies to non-subscription purchases." <--- We would kindly ask you to update this sentence to reflect the fact that it only applies to non-subscription purchases because it was completely unclear to us developers and was our main source of confusion that made us to write this report. Thanks.

By s.pankevich at Sept. 20, 2017, 9:38 p.m. (reply...)

Response from Apple

Engineering has provided the following information regarding this issue: This is working as designed. From the attached files: Before restore: "purchase_date_pst":"2017-08-04 11:41:19 America/Los_Angeles"
"original_purchase_date_pst":"2017-08-04 11:41:21 America/Los_Angeles" After restore:
"purchase_date_pst":"2017-08-04 11:44:19 America/Los_Angeles"
"original_purchase_date_pst":"2017-08-04 11:41:21 America/Los_Angeles" In our documentation we say that- “In an auto-renewable subscription receipt, the purchase date is the date when the subscription was either purchased or renewed (with or without a lapse)” This is true even in the case when a subscription was restored (from the dates above). The first line “For a transaction that restores a previous transaction, the purchase date is the same as the original purchase date”, applies to non-subscription purchases.

By s.pankevich at Sept. 20, 2017, 9:38 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!