We're seeing a few issues with how transactions are being recorded in the receipt. I've looked at when originalTransactionId and transactionId are assigned and changed as they don't seem to be working as expected/documented.
Here are the two cases we are seeing:
Case 1:
1) User subscribes for 1 month.
2) User auto renews for second month.
3) At the beginning of the second month there is a cancellation (from Apple).
4) A few days later in that second month user subscribes again.
Expected:
Receipt for second month in 4) should have a transaction id and a new original transaction id
Receipt should contain two chains of transactions - one for first month, with second month cancellation; second for 4) new subscription
Actual:
Receipt contains one chain of transactions with first month subscription, second month cancelation and second month subscription all with same original transaction id
Case 2:
1) User subscribes for 1 month with product id plus_subscription_999
2) User auto-renews for second month
Expected:
Receipt has chain of transactions that have the same original transaction id
Actual:
Receipt has two chains of transactions: one for the first month with one original transaction id , and a second one for the second month; both with different originalTransactionId
By chain of transactions, I mean several transactions that share the same original transaction id as documented here: https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html
Is there any documentation on what to expect for these two cases, it was certainly unexpected and we had to work around these cases.