Search Unity

How to implement IAP for users who redeem apple IAP codes? I used codeless IAP in my game

Discussion in 'Unity IAP' started by strongbox3d, Dec 22, 2018.

  1. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello Unity,

    Please I need to resolve this problem asap, my game is out and I can't figure out why the IAP codes that apple gives me for free IAP doesn't work in the game. I used the codeless unity iAP to implement the iAP in my game and I have only 3 CONSUMABLES.

    I gave some users the iAP codes from the apple store but when a user redeem the code for the free IAP, nothing happens.

    Could someone explain what do I need to do in order for users to use these codes?

    Thanks in advance,
    Carlos
     
  2. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello again,

    So none one knows anything about the apple codes for iap in games? What to do so if people use an iap code from the apple store to get the consumables for free, so the consumable is given to the user for free? Or even if Unity iAP should handle that?

    I would appreciate any help please. I don't find any documentations on this topic.

    Regards,
    Carlos
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Once the user begins the normal purchase process, they should not be charged if they have been given a code. How are users redeeming the code?
     
  4. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello JeffDUnity3D,

    Thank you for answering, I really appreciate the help because I am in a pickle here...

    I don't know how they tried to use it because I didn't know what to tell them about using it. I tested my self by going to the apple store and entering the code for the IAP clicking the button REDEEM above the button SEND GIFT and it said that I was all set. Then I went to the game and followed the process of buying the item and I didn't see any message in the lines of "You won't be charged" or something like that, so I didn't proceed with the purchase in fear that I would get charged. So, from your answer I gather that once I enter the code in the apple store, if I go in the game and buy that same product I just entered the code for, I will not get charged? If so, I will test it again completing the purchase and see if I don't get charged. If all this works, is there a way to let users know that they will not be charge?

    Regards,
    Carlos
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Correct, you should not get charged. We would not have a way to notify the user, we don't actually handle any of the transaction details.
     
  6. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    I just tested it, and what it says after I proceed is "This In-App Purchase has already been bought." , and then below: "It will be restored for free". But I don't get anything.

    Keep in mind this is a consumable. Also I am using codeless iAP from Unity Services.

    Any idea?

    Regards,
    Carlos
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Is your Purchase Succeeded method called? Please provide the specific test details. What do you mean, "don't get anything". I would expect your Purchase Succeeded method would be called. Is this for a separate test user that you have configured on your phone?
     
  8. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    I appreciate your help!

    Ok, I sell 3 consumables in my game: 1000 coins, 5000 coins, and 10000 coins. So I have a panel with 3 buttons one for each coin amount and each button has an IAP button script to handle the purchase(codeless).

    When the user click one of the buttons the purchase process starts and when the receives the On Purchase Complete() method, the button runs the code that give the player the amount of coins they bought.

    This works great, if the player doesn't close the panel with the buttons, before the apple store sends back the Message with the purchase complete. If the user closes the panel with the buttons before, the user gets charge but because the buttons were close before completing the purchase, the user doesn't get the in game coins.

    This happened a couple of times in real life. So I offered the users the codes that apple store give us for IAP. When the users used these codes they sent me the screenshots where, when they try to buy the coins again(either by paying or after entering the IAP codes)when the process of buying completes, they get the message: "This In-App Purchase has already been bought" "It will be restored for free". Normally the message after buying an amount of coins, the message reads: "You are all set", but once the purchase fails for the above reasons(which is already fixed in an update), the users can't buy the coins anymore.

    So I believe I have two problems:

    If the user for any reason stops in the middle of a purchase transaction, they get charged and they don't receive the coins since the IAP button script, doesn't have a way to know that the transaction was completed(Or I don't know how to handle this case?)

    If I give a user IAP Code from the apple store to get the coins for free(promotions for example), how does the IAP Button Script knows so it can give the coins to the user one they redeem the code in the apple store? How should this be handle?

    You told me that the user have to follow the purchase process but they will not be charge, if they redeemed the code in the store before hand... When I try to test this, I was faced with the situation explained above.

    Regards,
    Carlos
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You are discussing two separate issues. Regarding refunds, there are no notifications to the user, there is no refund API. You would just need to send the user an email or similar, telling them that they would not be charged for the purchase. It looks like a normal purchase to the user, but there is no final credit card charge. If your buttons are not active when you need them, then you should either use the code approach and not use Codeless IAP, or use the IAP Listener component. The second sample project here uses a Listener https://docs.unity3d.com/Manual/UnityIAPCodelessIAP.html and https://forum.unity.com/threads/sample-iap-project.529555/.
     
  10. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Thank you JeffDUnity3D for your replay. I will look into all your info.

    Regards,
    Carlos