As the topic title suggests, I'm currently having trouble getting the AmazonBuyGoodsRequest call to work properly for my Unity/Android game.
Basically I'm currently using Unity's own IAP plugin along with GameSparks and at the moment I'm working on integrating it with the Amazon Appstore. I've already set up my virtual goods in the developer portal and I've set the Amazon product ids to match the SKUs of the IAP items I've defined for my game on the Amazon apps dashboard (plus I've also set up the Amazon client id and secret for my game in case you were wondering).
I'm also currently using Amazon's App Tester app to test the IAP functionality of my game for their store along with a generated JSON file (downloaded from my Amazon Apps dashboard for my game) on my devices containing information about my IAP items. Whenever I test out the IAP functionality for my game, the Amazon side of the purchase process seems to go through as normal (i.e. I buy the item and I get a message saying my purchase is successful). On the GameSparks side, once the purchase is complete, I fetch the Amazon user and receipt ids using Unity IAP's functions so I can pass them on as the required parameters for the AmazonBuyGoodsRequest call. Normally the expected response would return no errors and the virtual good would be awarded to the player but nothing to seems to be happening and the player does not receive the virtual good (despite making a valid purchase).
I've checked the AmazonBuyGoodRequest call using the player management screen in the developer portal and it turns out that it was returning a Verification Error 2 (invalid receipt id). More specifically, I appear to be getting a http 400 error from Amazon's IAP verification service saying that it's failed to validate the given receipt id with the given user id. I've checked both ids using the Amazon App Tester to make sure I didn't fetch the wrong ids by mistake and everything seems to match up correctly.
I have no idea why this is happening so I'm wondering if anyone has some solution although I have an slight idea why I'm getting this error: I haven't actually submitted my IAP items in the Amazon Apps Dashboard (I've only just created them and downloaded the generated JSON file to my device) i.e. whenever I test IAP using the Amazon App Tester, the items are fetched locally from the generated JSON file but when the AmazonBuyGoodRequest call is made, I think it's trying to look for my items online but since I haven't submitted them, it ends up with an empty result hence returning with the aforementioned verification error (If I'm right with my supposed theory do let me know).
Anyway, apologies for the rather long-winded and probably confusing post but it's about the best I can describe about this problem.
Verification error 2 means the receiptId is not valid for the given userId and secret. All of the AmazonBuyGoodsRequests have this error something isn't right here. Can you try double check that your Amazon Product IDs are correct. Is this happening on a particular good or all of them ?
It seems to be happening on all my virtual goods that have a Amazon Product ID linked to them. I've doubled checked and the ids match the ones I made in the Amazon Apps dashboard (assuming it's in the form of "com.CompanyName.AppName.IAPItemName").