Search Unity

[Solved]Error : IAP Button in Google Play return duplicate Transaction error

Discussion in 'Unity IAP' started by dfjhde, Nov 2, 2018.

Thread Status:
Not open for further replies.
  1. dfjhde

    dfjhde

    Joined:
    May 23, 2015
    Posts:
    8
    unity version : 2017.2.0.f3
    unity iap version: 1.20.1

    i used iap Button in my game, like this :

    and the code in ShopManager.cs like this
    Code (CSharp):
    1.     public void OnSuccessfullyBuy1000Coins(Product product)
    2.     {
    3.         Data.inst.jimServer.AddMoney(1000);
    4.         InfoText.SetText("Successfully Buy 1000 Coins");
    5.         InfoText.transform.parent.parent.gameObject.SetActive(true);
    6.     }
    7.     public void OnFaildBuy1000Coins(Product product, PurchaseFailureReason purchaseFailureReason)
    8.     {
    9.         Debug.Log(purchaseFailureReason.ToString());
    10.         InfoText.SetText(purchaseFailureReason.ToString());
    11.         InfoText.transform.parent.parent.gameObject.SetActive(true);
    12.     }

    so after the first purchase will successfully load the google play UI, but the
    OnSuccessfullyBuy1000Coins()
    seems not calling after i finished the payment, and from the second purchase on this same product, it will keep calling the
    OnFaildBuy1000Coins() 
    with
    PurchaseFailureReason.DuplicateTransaction
    does anybody have the same issue?
     
  2. dfjhde

    dfjhde

    Joined:
    May 23, 2015
    Posts:
    8
    Ok, turns out that Google Play need a couple of day to make the the IAP functional. i finally getting OnSuccessfullyBuy1000Coins() call now
     
Thread Status:
Not open for further replies.