I've been struggling with this for some days now. I hope I get it now, but I wanted to check it with you.
For every transaction there is a SKPaymentTransaction. In a regular purchase, the property Original Transaction is empty. In a restore or auto renewal, Original transaction is the original transaction SKPaymentTransaction.
The tricky part in my opinion is the receipt received. So every transaction in the receipt contains a transaction_id and a original_transaction_id. In a one time purchase they are the same, in a subscription, the original_transaction_id is the transaction_id of the first transaction the user subscribed.
So my first question: If I want to check the validity of a purchase in the receipt -> The transactionID of the SKPayment transaction appears ONLY in the receipt, if it is not a restore or renewal. Otherwise the SKPaymentTransaction transactionID is NOT in the receipt. But since in these cases the SKPaymentTransaction has a property originalTransaction, originalTransaction.transactionID appears in the receipt. Correct?
And now the thing I have been struggling with, 2nd question: So the originalTransaction property of the SKPaymentTransaction has not necessarily anything to do with the original_transaction_id in the receipt, correct? I mean for a subscription with several renewals - If I restore them I get a SKPaymentTransaction with a transaction ID, which isn't in the receipt. Then I take instead the originalTransaction.transactionID of this SKPaymentTransaction and look for it in the receipt, but NOT in the original_transaction_id field but in the transaction_id field of the receipt, correct?
I hope I get it now..I really think the documentation is rather confusing here from Apple..