Amazon IAP rejection

I unfortunately don’t own a Kindle and am trying to avoid breaking down and buying one… so for now I’m hopeful that someone out there might spot some issue with my code and may be able to help fix it.  I have a feeling it’s something dumb…

Here’s my code:

 store = require( "store" ) if store.target == "amazon" then store = require "plugin.amazon.iap" store.init( \_transactionCallback ) store.loadProducts({"com.lhg.games.noahsarkhd.unlockminigamesmin","com.lhg.games.noahsarkhd.unlockminigameswood","com.lhg.games.noahsarkhd.unlockminigamessilver","com.lhg.games.noahsarkhd.unlockminigamesgold","com.lhg.games.noahsarkhd.unlockminigamesdiamond"}, \_loadProductsListener) else if store.target == "apple" then -- and not \_settings:get("miniGamesPaid") timer.performWithDelay(1000, function() store.init( "apple", \_transactionCallback); end) end if store.target == "google" then -- and not \_settings:get("miniGamesPaid") timer.performWithDelay( 1000, function() store.init( "google", \_transactionCallback ); end ) end end --- then purchase function iapObj:purchase( productId ) if (debugOn) then print( "\_IAP - purchase( " .. productId .. " )" ) end store.purchase( { productId } ) end iapObj:purchase( "com.lhg.games.noahsarkhd.unlockminigamesmin" )

 When testing IAP on Google Play, the change I made was to make the variable passed a table, instead of just the product id:

so:

-- was store.purchase( productId ) -- Didn't work on Google Play -- changed to store.purchase( { productId } ) -- worked

Not sure if that’s the problem… but I have confirmed that the failure does occur on this call…  so not sure if there’s different syntax for Amazon vs Google Play… 

Thanks in advance!

Scott D Brooks

I resubmitted the app after double checking the docs.

For some odd reason, what store.purchase accepts for Amazon is different from the regular store API:

http://docs.coronalabs.com/api/library/store/purchase.html#TOC

store.purchase( {“com.coronalabs.NewExampleInAppPurchase.NonConsumableTier1”} )

http://docs.coronalabs.com/daily/plugin/amazon.iap/#functions

store.purchase(“my_test_sku”)

One takes a table of strings, the other just a single string.   We’ll see if that gets the app accepted.
 

Amazon documented this when they built the plugin.  Unlike Apple and Google which expects an array of products, Amazon can only take one item at a time, so they take a string, not a table.

Rob

Thanks Rob.  Looks like I missed that as a part of your tutorial:

http://www.coronalabs.com/blog/2013/09/03/tutorial-understanding-in-app-purchases/

I knew it was something minor that I missed.  ;)

Did it pass?

@JonPM, it’s still under review (it’s the weekend).  I’ll hit the thread when I hear back.

I resubmitted the app after double checking the docs.

For some odd reason, what store.purchase accepts for Amazon is different from the regular store API:

http://docs.coronalabs.com/api/library/store/purchase.html#TOC

store.purchase( {“com.coronalabs.NewExampleInAppPurchase.NonConsumableTier1”} )

http://docs.coronalabs.com/daily/plugin/amazon.iap/#functions

store.purchase(“my_test_sku”)

One takes a table of strings, the other just a single string.   We’ll see if that gets the app accepted.
 

Amazon documented this when they built the plugin.  Unlike Apple and Google which expects an array of products, Amazon can only take one item at a time, so they take a string, not a table.

Rob

Thanks Rob.  Looks like I missed that as a part of your tutorial:

http://www.coronalabs.com/blog/2013/09/03/tutorial-understanding-in-app-purchases/

I knew it was something minor that I missed.  ;)

Did it pass?

@JonPM, it’s still under review (it’s the weekend).  I’ll hit the thread when I hear back.