Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

IAP Badger: a unified approach to in-app purchases
Started by happymongoose Sep 13 2015 09:59 AM

405 replies to this topic
release lua plugin iap in app purchases monetization inventory
[TOPIC CONTROLS]
« Page 17 of 17 15 16 17
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#401

happymongoose

[GLOBAL: userInfoPane.html]
happymongoose
  • Contributor

  • 353 posts
  • Corona SDK

Version 17

------------

 

* corrected declaration of emptyInventoryOfNonConsumableItems function so it calls correctly



[TOPIC: post.html]
#402

happymongoose

[GLOBAL: userInfoPane.html]
happymongoose
  • Contributor

  • 353 posts
  • Corona SDK

Hi everyone.

 

Have just updated the IAP Badger library based on some user feedback:

 

Version 18:

  • purchases on Google Store that fail because the user already owns the specified item are now converted into standard purchase events (to replicate behaviour on iOS).  This functionality can be turned on/off with the googleConvertOwnedPurchaseEvents flag during initialisation.
  • On Android, warnings given if no build store has been selected in the Corona build dialog (not selecting a store on the build dialog causes IAPs to break - so this warning is given to save lots of head scratching and looking for complex problems, where the issue was a simple one)

These changes are live on github and on the plugin version of the code.

 

 

Simon :)



[TOPIC: post.html]
#403

perflubron

[GLOBAL: userInfoPane.html]
perflubron
  • Contributor

  • 145 posts
  • Corona SDK

Hi Simon,

 

Thanks for continuing to work on IAP Badger!

 

I'm cross posting this issue I'm having from the Slack General channel, in case you can help:

 

I'm looking into identifying refunded / revoked orders in Google Play, at app startup, using IAP badger. I am probably doing it wrong, but I was expecting that when an order has been refunded, the next time I restore purchases I would get the onRefund callback. This doesn't seem to be the case. 

 

In the Play order management console, the order has a state of "Refunded", but in the verbose logging it is market as state "purchased"

 12:16:33.853     : IAP Badger: restore
 12:16:33.853     : Requesting restore...
 12:16:33.853     : Timeout function specified, placing on timer...
 12:16:33.854     : IAP Badger: leaving restore
 12:16:33.878     : IAP Badger: storeTransactionCallback
 12:16:33.878     : event contains raw data:
 12:16:33.878     : table: 0x757c7d08c0 {
 12:16:33.878     : [name] => "storeTransaction"
 12:16:33.878     : [transaction] => table: 0x757c7d08c0 {
 12:16:33.878     : [identifier] => "GPA.3321-2721-1438-62030"
 12:16:33.878     : [packageName] => "se.appfamily.puzzle.super2.free"
 12:16:33.878     : [receipt] => "{"orderId":"GPA.3321-2721-1438-62030","packageName":"se.appfamily.puzzle.super2.free","productId":"fullgame","purchaseTime":1566553570093,"purchaseState":0,"purchaseToken":"capmijjmeemfbjgjldem                          nkgn.AO-J1Ox7HZPQ4i9it6cqawzrK0BHaEKgaRwXD9KYs6rMGFDFX40JLMNdoEbcIih_MTTVmpiiSHA9IGqCzI0t2K4F6Eqru9-byko4ggpXWNIvdECi_hdhXPgye3sPMydn-zm52JYMzUrI"}"
 12:16:33.878     : [state] => "purchased"
 12:16:33.878     : [originalJson] => "{"orderId":"GPA.3321-2721-1438-62030","packageName":"se.appfamily.puzzle.super2.free","productId":"fullgame","purchaseTime":1566553570093,"purchaseState":0,"purchaseToken":"capmijjmeemfbjg                          jldemnkgn.AO-J1Ox7HZPQ4i9it6cqawzrK0BHaEKgaRwXD9KYs6rMGFDFX40JLMNdoEbcIih_MTTVmpiiSHA9IGqCzI0t2K4F6Eqru9-byko4ggpXWNIvdECi_hdhXPgye3sPMydn-zm52JYMzUrI"}"
 12:16:33.878     : [token] => "capmijjmeemfbjgjldemnkgn.AO-J1Ox7HZPQ4i9it6cqawzrK0BHaEKgaRwXD9KYs6rMGFDFX40JLMNdoEbcIih_MTTVmpiiSHA9IGqCzI0t2K4F6Eqru9-byko4ggpXWNIvdECi_hdhXPgye3sPMydn-zm52JYMzUrI"
 12:16:33.878     : [productIdentifier] => "fullgame"
 12:16:33.878     : [signature] => "pP3oRArNaftTPEeSO2FmPbqYlrPg2ynlXsPxc91bvlJRPq05wYJHZ/O4Gd/y/v3i1dWjM8TLHU5P5nbJxYqwc16ZtZI0Y4KfiN8Y5WsbfKBNOe7yLV3qLcQBySF8OjF8+ns8gE+0LRp/g6lgax0EbCu9c16Ruqkgul/D8sSxu02cXWqnx4BmDyLI7WqSeAP                          c7oV1gdratrKcktg8/555la6Ob3c8jGUZvpLviwS6Ka+N/KC0AMEEtbaqdpQTrxsqgaEntVAW29EdZ+QAW4+u3QWGd4h+4VXNE6jc82ihHBryoP7vl73KZ/dQ1t1XXKR3Vtb5XblCfm0iqZhhT09x3w=="
 12:16:33.878     : [type] => "inapp"
 12:16:33.878     : [date] => 1566553570093

When refunding the order in the Play Console, there is a check-box for "Revoke". I don't recall if I checked that or not - do you know if that is what is causing this?

 

Cheers,

 

Per



[TOPIC: post.html]
#404

happymongoose

[GLOBAL: userInfoPane.html]
happymongoose
  • Contributor

  • 353 posts
  • Corona SDK

Hi,

 

Could you try the following - when you do your restore, tell IAP Badger to remove the user's access to all previously purchased non-consumable items.  (Bear with me.)

 

You do it like this:

 

iap.restore(true, your list of listeners...)

 

This won't be a problem, because...

  • although we're removing access to everything the user has bought...
  • Google Play will now immediately tell us which IAPs to restore - and this should be minus the items that have been refunded

BTW - if my understanding is correct, your app should also receive a 'refunded' event when the user requests a refund, but I can't remember if this works in practice.

 

The internet also suggests that, if a user initiates a refund, the IAP can get stuck in the 'purchased' state for quite some time (72 hours even) due to cacheing issues.

 

 

Simon

 

PS - when you set this flag to true, it won't affect consumable purchases.


Edited by happymongoose, 24 August 2019 - 12:25 PM.


[TOPIC: post.html]
#405

perflubron

[GLOBAL: userInfoPane.html]
perflubron
  • Contributor

  • 145 posts
  • Corona SDK

Hi Simon,

 

Thank you for your response. I have a very simplistic setup with a single 'remove ads' IAP, combined with local state management, so no issues with testing that flag. 

 

It does seem that it could be related to the caching that you mentioned. When I re-opened the affected app today, it was locked again. So at some indeterminate time after the refund & revoke, the purchase is no longer returned, and hence I can remove it (when my local state shows it as purchased but it is no longer returned when restoring purchases).

 

To speed up the testing, I found that you can clear the local cache for Play Store billing via adb: adb shell pm clear com.android.vending

 

After clearing the cache with that command, the purchase was no longer available when restoring. So, case closed as long as Google accepts my explanation.

 

Thanks again,

 

Per



[TOPIC: post.html]
#406

perflubron

[GLOBAL: userInfoPane.html]
perflubron
  • Contributor

  • 145 posts
  • Corona SDK

Hmm. The purchase was not available on the first launch after clearing the cache. BUT After exiting and re-launching the app it still got back the purchase.

 

I'll have to wait and re-try launching tomorrow or something, to see if it gets the right response back.




[topic_controls]
« Page 17 of 17 15 16 17
 
[/topic_controls]

Also tagged with one or more of these keywords: release, lua plugin, iap, in app purchases, monetization, inventory