[Closed] Unity IAP not clearing Products after a purchase

Somewhat similar to [Solved] Unity IAP not clearing/refreshing the app receipt after a purchase (iOS) - Unity Services - Unity Discussions

I’m not sure if this is a bug, but after purchasing an IAP, the receipt property of the Product stays populated. Purchase multiple, and each Product holds a receipt string.

Does this pose a problem? E.g. if a subsequent purchase doesn’t work, will Unity IAP assume it has because there’s a valid receipt in the Product?

I believe this is answered here.

Hi Banderous,

Thanks for the reply, but I don’t think it’s the same - this is purely during the lifetime of the app.

If I have the following code to print out the products:

foreach( Product p in this.m_controller.products.all )
Debug.Log( “[” + p.definition.id + “,transID:” + p.transactionID + “,hasReceipt:” + p.hasReceipt + “]” );

When I start the application, it prints this:

[PRODUCT1, transID: , hasReceipt: False]
[PRODUCT2, transID: , hasReceipt: False]

If I purchase PRODUCT1, it prints this:

[PRODUCT1, transID: 1000000212383605, hasReceipt: True]
[PRODUCT2, transID: , hasReceipt: False]

If I then purchase PRODUCT2, it prints this:

[PRODUCT1, transID: 1000000212383605, hasReceipt: True]
[PRODUCT2, transID: 1000000212383631, hasReceipt: True]

If I then refresh the receipt manually, it prints this:

[PRODUCT1, transID: 1000000212383605, hasReceipt: True]
[PRODUCT2, transID: 1000000212383631, hasReceipt: True]

(all transactions are gone from the receipt though, as it should be).

They’re only cleared when the app is relaunched, so it’s a local data thing (the same Product is used throughout the lifetime of the app). This was my question. Is the fact that the Products aren’t cleaned after a purchase a bug, or could it pose a problem (e.g. for a subsequent purchase of PRODUCT1 that doesn’t work, will it still have a valid receipt stored)?

I can send a test project if desired.