question

quaidtseng avatar image
quaidtseng asked

[Unity] purchaseSuccessfulEvent( AmazonReceipt ) sometimes returns twice

We found that AmazonIAPManager.purchaseSuccessfulEvent(AmazonReceipt receipt) can sometimes call us back twice. So we end up giving 2 new items to the user. We have looked into the AmazonReceipt.token but it seems the token is the same for the same item, thus it is not able to distinguish the 2 transactions. The only workaround we can think of is to impose a time interval, so if it comes back twice within a seconds then we ignore the second one. But this is a very bad solution. How can we do? Thanks.
iap
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

quaidtseng avatar image
quaidtseng answered
I am sure the button is being clicked once, since I have put a breakpoint in the button and it is triggered only once. But the purchaseSuccessfulEvent( AmazonReceipt ) can still come back twice sometimes.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Guaidtseng, Could you please confirm that you are using the latest plugin?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

quaidtseng avatar image
quaidtseng answered
Yes, I grabbed the latest one (released around Feb 5th, 2014) which has in-app-purchasing-1.0.3.jar.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
We could not reproduce this behavior. But I can assure your that that's not going to happen in the live environment. Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.