IAP Badger Receipt Information

I have Ultimate Wrestling in the iOS App Store using the standard Corona IAP functionality and there are a few products which are consumables that increase served based in-game credits.  Everything is working great for iOS with the flow basically being:

  1. User Purchases Consumable

  2. Receipt is sent to my server

  3. My server verifies the receipt with Apple

  4. If it is a unique valid transaction then increment the credits and send response back to app

I’ve now been working on getting this running with Android and after a solid day of effort I’m still running into some issues getting it to work the same way

I’m now trying to use IAPBadger since it seems to be really clean and supports the 3 platforms I plan on rolling out to but I can’t seem to be able to get the event.transaction.receipt which is needed to verify the transaction on the server end.  

Anyone have ideas on how to do this?

Thanks,

Roy

Hi Roy,

In a somewhat poorly, almost entirely un-documented feature, IAP Badger passes back all the original Corona SDK transaction information to your purchase listener (blink and you’ll miss it in the ‘Making a purchase’ section of the extended tutorial.)

Here’s how you do it:

--The callback function --IAP will call purchaseListener with the name of the product --Transaction is a table containing the original transaction information table passed by Corona local function purchaseListener(product, transaction) --You can now check the purchase using whatever is in transaction.receipt... end --Make the purchase iap.purchase("removeAds", purchaseListener)

Hope this helps,

Simon

Thanks so much for the quick response!