Amazon In-App Purchase Test

Hi, i tried to test the amazon in-app purchase plugin and it works fine, but after i purchased the item, the storeListener is not calling and i can not do anything to give the item when it is purchased. The Listener is not called because i saw it in the adb.

Here’s the listener:

local store function storeListener( event ) local transaction = event.transaction if ( transaction.state == "purchased" ) then local buttonsound = audio.play( Sound4 ) print( "product identifier", transaction.productIdentifier ) print( "receipt", transaction.receipt ) print( "transaction identifier", transaction.identifier ) print( "user who made purchase", transaction.userId ) ----------------------give 1000 coins elseif ( transaction.state == "revoked" ) then print( "product identifier", transaction.productIdentifier ) print( "receipt", transaction.receipt ) print( "transaction identifier", transaction.identifier ) print( "user who revoked purchase", transaction.userId ) elseif ( transaction.state == "failed" ) then print( "transaction failed", transaction.errorType, transaction.errorString ) else print( "(unknown event)" ) end store.finishTransaction(transaction) end 

if someone has any idea about it, please help me.

Here’s also the function i used for button to buy the item:

local function handleButtonEventCpu() store = require( "plugin.amazon.iap" ) store.init( storeListener ) print( "logged in user is", store.getUserId() ) store.restore() if ( store.isSandboxMode() == true ) then store.purchase( "my\_sku" ) else store.purchase( "my\_sku" ) end end

Maybe it is because i use the sendboxMode and when the app will be published it will works but i dont know

Hi, it’s better to load the plugin and call store.init() before you press the button, a good place would be somewhere at the top of the main.lua file.

Also move store.restore() into a separate button.

As of your problem - it could be due to the sandbox mode. That’s an issue with the Amazon’s App Tester. Sometimes it stops working correctly.

Please try Live App Testing instead, it’s more reliable.
https://developer.amazon.com/public/resources/development-tools/live-app-testing

Thanks,

Sergey

I have the same issue with an app that is Live Tested. After the store.purchase call there is no transaction callback. Using 2016.2861

It looks like this is a permissions issue, i think i haven’t added the right permissions to use this plugin, but i don’t know which, when i try to use the live testing i have an issue:

Issue : Incorrect usage of Amazon IAP

Your app or game has not implemented receiver component or mandatory 

Seems have same bug. 2 days ago updated our game with amazon iap plugin v2, and there are no in-app purchases since yesterday (usually 4-7 everyday). Today, after reading this post, trying to purchase in-app in this game by myself - payment pass, but no transaction callback. Tried ‘Restore purchase’ - works fine.
So may confirm - no transaction callback on store.purchase (), there is transaction callback on store.restore ().

I had this issue at first. It was fixed by building with 2016.2861 instead of the latest public release.

Can you post your build.setting with waht type of permissions are you using?

usesPermissions = { "android.permission.READ\_PHONE\_STATE", "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "com.android.vending.BILLING", "com.android.vending.CHECK\_LICENSE", "android.permission.WRITE\_EXTERNAL\_STORAGE", "android.permission.ACCESS\_WIFI\_STATE", "android.permission.GET\_ACCOUNTS", "android.permission.RECEIVE\_BOOT\_COMPLETED", "com.google.android.c2dm.permission.RECEIVE", ".permission.C2D\_MESSAGE", },

No way, the problem remains, now i updated the app tester and every time i purchase the item it go fine, but i receive the notification about:

Implementation Problem Detected

“my_sku” failed to call Purc…

so i think there isn’t any callback after the purchase

any idea?

Oh to be clear. I am still having the problem with not getting a transaction callback. I was referring to the issue for the Amazon Live Test upload.

Yeah same problem, hope in someone help

Guys, I am looking into it and I think I’ve found the problem, working on it.
You don’t need to specify any extra permissions for amazon IAPs, it’s handled automatically by the plugin.

No way, still have Implementation Problem from App Tester and no callback

Here’s  the error i have with app tester:

Implementation Problem Detected

it.stany2011.newgame.pro failed to call PurchasingService.getPurchaseUpdates() to retrieve delayed receips

Does anyone know when this will be fixed?

Guys, can you please try now? Build a fresh version of your app.

I don’t know what you done, but now it works perfectly,… for me, thanks much

Great! Thanks for testing it and confirming that it has been resolved.