When Purchase transaction fails, the event.transaction.productIdentifier is nil?

We ran into  a really weird behavior where if the transaction fails, the callback event doesn’t contain the productIdentifier. Is this a bug or expected behavior? This is triggering issues in our code (that we may be able to work around), but want to check first. Here is the trace we get from the device while testing:

I/Corona  (32489): DEBUG: txn.state failed
I/Corona  (32489): DEBUG: txn.date nil
I/Corona  (32489): DEBUG: txn.identifier df4893df-efb4-4fb9-baac-592eea1d1ee7
I/Corona  (32489): DEBUG: txn.productIdentifier nil
I/Corona  (32489): DEBUG: txn.receipt nil
I/Corona  (32489): DEBUG: txn.originalDate: nil
I/Corona  (32489): DEBUG: txn.originalID nil
I/Corona  (32489): DEBUG: txn.originalReceipt nil
I/Corona  (32489): DEBUG: txn.errorType FAILED
I/Corona  (32489): DEBUG: txn.errorString FAILED
I/Corona  (32489): DEBUG: txn.userIdDefaultTestUser

We also noticed that if you try to do a purchase on a SKU that the user already owns, the system will call back with a “restored” event but no productIdentifier.

We also noticed that if you try to do a purchase on a SKU that the user already owns, the system will call back with a “restored” event but no productIdentifier.

I’ve also seen this…  Is there any solution to this?   Or do we need to try to keep track of the last productID ourselves and use that in the event of it being nil?

I’ve also seen this…  Is there any solution to this?   Or do we need to try to keep track of the last productID ourselves and use that in the event of it being nil?

Hello,

Sorry for the massive delay on this, missed this thread somehow.

Both of these situations(failed transaction only containing the identifier and buying something the user already owns giving a restored purchase with no other information) are both directly from the underlying Amazon IAP java SDK. The Amazon IAP Corona plugin is simply passing the available information back to you.Unfortunately I’m not sure there is a way to address these situations better from the plugin perspective.

thanks @tamkinp. Yeah, we ended up keeping track of the productID ourselves. 

When a Google Play transaction fails it also doesn’t contain the productIdentifier so I do the same and keep track of it myself

Hello,

Sorry for the massive delay on this, missed this thread somehow.

Both of these situations(failed transaction only containing the identifier and buying something the user already owns giving a restored purchase with no other information) are both directly from the underlying Amazon IAP java SDK. The Amazon IAP Corona plugin is simply passing the available information back to you.Unfortunately I’m not sure there is a way to address these situations better from the plugin perspective.

thanks @tamkinp. Yeah, we ended up keeping track of the productID ourselves. 

When a Google Play transaction fails it also doesn’t contain the productIdentifier so I do the same and keep track of it myself