1

Hello,

sometimes a transaction (buying virtual currency = consumable items) cannot be finished (because the application is terminated / device is disconnected / other unknown reason). In such case, IAP bills the user for the item (a test purchase confirmation is sent to my e-mail), but the item is not consumed. The currency is not added to user's account (meaning the OnSuccess listener method is not being called) and when I try to buy the same item again, it fails with error code 7 (item already owned).

The item is explicitly defined as consumable in sdkbox_config.json. Since the item is consumable, using restore() does not help.

Is there a way to retrieve a list of purchases that were paid for, but could not have been consumed properly?

Thank you for your time.

games vex answered
    -1

    I am very new to SDK Box, but a possible solution (or workaround?) would be to store a variable when the user initiates a purchase (eg, initiatedPurchase = true in UserDefault) and then when the purchase is completed and the coins are added, set the variable to false. Upon loading the app, check if the variable is true, in which case add the currency to the user's account. Also, if the user quits or leaves the app, mid-purchase without confirming, set the variable to false.

    Apollo18 answered
      0

      Thanks for sharing the information it was very helpful for me slither io

      games vex answered
        0

        I have exactly the same problem.
        This is all due to a poorly designed API of SDKBox IAP.

        There is should be a method, but it's absent:

        that must invoke  com.android.billingclient.api.BillingClient.consumeAsync() 

        And until I called this method, the purchase should not be spent (consumed).

        Without this, I cannot buy my diamonds for the 2nd time due to an error: 7 item already owned.  And this error will be soon on all my InApps until I have consumed them with consumeAsync().

        But main problem is: I can not get a list of unspent purchases through IAP:Restore() or via IAP::requestUpdateTransaction(), so I lose my client's money - and that is a BIG, BIG problem!!!

        I do my own server side verification, so when server validates this purchase and stores it to my database only after this I send message to client - so everything is OK and you may consume this purchase. But SDKBox not implemented this method, so sad.

        So I can't use SDKBOX IAP until they will fix this BUG.

        tribal commented
          • I believe that consumeAsync() is called from IAP::finishTransaction(), but in our case there is nothing to finish here, because the transaction has already been LOST when the application is restarted or something happens with device.

          -1

          IAP enables clients to buy extra substance from inside an application. Be that as it may, this substance can't be conveyed through a commercial center as though it were physical stock you should, you should download extra substance into the application utilizing the system APIs. dissertation editing and proofreading service

          MarkMorgan answered
            0

            plz update to staging version and test it again.

             

            sdkbox update --staging

            yinjimmy answered

              Question stats

              • Active
              • Views441 times
              • Answers6 answers
              • Followers2 followers

              Categories