#InAppPurchasing count don't working

1 messages · Page 1 of 1 (latest)

chilly pumice
#

When I select buy 5 I'm buying only one. With test card
Also when fast after buy turn off internet product returns after restart. (Buy 5000 coins, spending them in store 2000 coins f.e. and after restart coins reset to 5000)

astral ridge
#

How much quantity the user buys - on Android is not controllable programatically.
Let me see in V2, if the quantity is matched on the transaction or not.

#

Also, "Coins reset to 5000" - This acutally plugin doesn't handle. This is something you do on your end is it?

chilly pumice
#

I guess it happens when shop event invokes

#
    {
        var transactions = result.Transactions;
        for (int iter = 0; iter < transactions.Length; iter++)
        {
            var transaction = transactions[iter];
            switch (transaction.TransactionState)
            {
                case BillingTransactionState.Purchased:
                    loadScreen.SetActive(false);
                    Debug.Log($"Buy product with id:{transaction.Payment.ProductId} finished successfully.");
                    PerformPurchaseComplete(transaction.Payment.ProductId);
                    break;
                case BillingTransactionState.Failed:
                    loadScreen.SetActive(false);
                    Debug.Log($"Buy product with id:{transaction.Payment.ProductId} failed with error. Error: {transaction.Error}");
                    break;
                case BillingTransactionState.Refunded:
                    loadScreen.SetActive(false);
                    break;
                case BillingTransactionState.Restored:
                    loadScreen.SetActive(false);
                    break;
            }
        }
    }```
#

Maybe there

astral ridge
#

Aren't you considering the quantity property?

chilly pumice
#

How to do that?

astral ridge
#

In the IBillingPayment returned in IBillingTransaction there is a quanity property

chilly pumice
astral ridge
#

Should be fine if you use latest version

chilly pumice
#

Yes. So what I can to do with reseting purchase after restart?

astral ridge
#

Yes. So what I can to do with reseting purchase after restart?
Is this the coins amount getting reset in your game?

chilly pumice
#

I'm buy coins. Get purchase complete and turn off internet. Get my coins from IAP and spend them in shop. After restart I get coins from transaction again and one more time can spend them in shop

#

Do you understand me?

#

I think that I got this method again when i'm enter game?

#

Maybe transaction wouldn't save because of internet off

#

And try to give it in next launch

#

2 usages and it's from IAP events

#

I'll send video and show my problem

astral ridge
#

We only fire a transaction if the transaction don't fire an event post purchase.

#

What happens is - When a purchase is made, we fire the event and consume the purchase (via an api to the store).
If this particular api fails to process, you may get another event with the same details.

chilly pumice
#

I have idea how i can fix it. If i save receipt ID and compare it when restart

astral ridge
#

On your end, you need to cross check if its already allocated.

#

Yes, I see a need to maintain history for avoiding duplicate delivery as there are chances for consume api to fail.