SKPaymentTransaction originalTransaction.transactionReceipt nil for non-consumable recovery

After calling restoreCompletedTransactions, for non-consumable, the returned SKPaymentTransactions seem to have a null value in the originalTransaction.transactionReceipt property. This is where the documentation says we should find the original transactionReceipt:

https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/MakingaPurchase/MakingaPurchase.html#//apple_ref/doc/uid/TP40008267-CH3-SW2

Has anyone really got this to be non-zero - and if so, how?

In the returned SKPaymentTransactions, it appears as if the actual valid transactional connection belongs to the transactionReceipt property (and not the originalTransaction.transactionReceipt property).

+3


source to share


2 answers


It happened to me.

It's strange, but even if Apple states in its documentation what transactionReceipt

is in originalTransaction

, I found transactionReceipt

in the original class SKPaymentTransaction

.



So, I set up a little check before choosing which transaction to go next:

SKPaymentTransaction *passedTransaction = nil;
if (transaction.transactionReceipt) {
    passedTransaction = transaction;
} else if (transaction.originalTransaction.transactionReceipt) {
    passedTransaction = transaction.originalTransaction;
}
      

+3


source


I also faced the same problem. It would seem transactionReceipt

to originalTransaction

will always return zero when restoring purchases. From the discussion in apple docs for transactionReceipt

:

Discussion The
content of this property is undefined unless it is transactionState

set to SKPaymentTransactionStateRestored

.



Since it is transactionState

always set to during restore (consumable item) SKPaymentTransactionStatePurchased

, the property originalTransaction.transactionReceipt

will always be nil.

+2


source







All Articles