Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Simple In-App Purchase System (SIS) - Shop solution

Discussion in 'Assets and Asset Store' started by Baroni, Aug 8, 2013.

?

Which billing plugin are you using in combination with Simple IAP System?

  1. Unity IAP

    63 vote(s)
    84.0%
  2. Voxel Busters

    3 vote(s)
    4.0%
  3. Stans Assets

    9 vote(s)
    12.0%
  4. Prime31

    0 vote(s)
    0.0%
  1. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    @Nadan these errors occur when Unity IAP is not imported correctly.

    - enable Unity IAP in the services window
    - click the import button in the same window to download the Unity IAP plugin
    - in your project, look out for the UnityPurchasing folder that has been created
    - if there are unitypackage files in this folder, Unity could not extract their content automatically. Double click the unitypackage files to import
    - the errors should be gone
     
  2. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    324
    Thank you Baroni! You saved my day.

    At first this didn't work, so at first I needed to remove the SIS from project. Then I followed your instructions above. I only unpacked the 'UnityIAP' unitypackage file at UnityPurchasing folder. There are also 'UPD' and 'UnityChannel' but are these required?

    I also removed the 'In App Purchasing' from Packages. Window > Package Manager. But do I need to reimport that too?

    Right now there are no errors.
     
    Baroni likes this.
  3. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    UPD is Unity's new distribution platform feature for sending your app to stores in Asia - this is optional. UnityChannel contains XiaomiMiPay classes, which is optional too at first, but this package also contains other classes needed when using our receipt validation features.

    The Package Manager package is not required. It has dependencies the other way around - the Package Manager package does not work without the Unity IAP service package.
     
    Nadan likes this.
  4. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    194
    Im getting this error, and I have no clue why.

    MethodAccessException: Method `UnityEngine.VR.VRSettings.get_enabled()' is inaccessible from method `UnityEngine.Purchasing.GooglePlayAndroidJavaStore.Purchase(string,string)'
    04-13 11:52:10.355 13312 13355 E Unity : at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
    04-13 11:52:10.355 13312 13355 E Unity : at UnityEngine.Purchasing.GooglePlayAndroidJavaStore.Purchase (System.String productJSON, System.String developerPayload) [0x00019] in <4d0cb115fad04af59efcffe23f032975>:0
    04-13 11:52:10.355 13312 13355 E Unity : at UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) [0x00129] in <4d0cb115fad04af59efcffe23f032975>:0
    04-13 11:52:10.355 13312 13355 E Unity : at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) [0x0003c] in <2abeedd3020a43afa91d367b26a24e86>:0
    04-13 11:52:10.355 13312 13355 E Unity : at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product) [0x00000] in <2abeedd3020a43afa91d367b26a24e86>:0
    04-13 11:52:10.355 13312 13355 E Unity : at SIS.IAPManager.PurchaseProduct (System.St
    04-13 11:52:19.433 13312 13355 E Unity : MethodAccessException: Method `UnityEngine.VR.VRSettings.get_enabled()' is inaccessible from method `UnityEngine.Purchasing.GooglePlayAndroidJavaStore.Purchase(string,string)'
    04-13 11:52:19.433 13312 13355 E Unity : at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
     
  5. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    @Chaz32621 Unfortunately I cannot see any SIS related methods in your log. If this comes directly from Unity IAP, please try posting this on the official Unity IAP section instead.
     
  6. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,999
    Hi, Is there a method for unlocking everything via an IAP? Thanks
     
  7. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    @derkoi What do you mean by unlocking everything? You are controlling what is granted to the user, or how far he/she can progress, by checking whether the specific product is owned by the user or not.

    Please register on our dedicated support forum, which is set up to also allow sharing code.
     
  8. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,999
    I just wondered if there was an easy way to unlock all the IAP purchases in the game, EG all levels and all weapons.
     
  9. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    @derkoi For levels, you would do a

    if (DBManager.isPurchased(level1_iap) || DBManager.isPurchased(all_iap))

    before starting or initializing the level(s). For weapons you would call DBManager.SetPurchase in the IAPListener callback to unlock other products as well. This also works with restoring purchases later on.
     
    derkoi likes this.
  10. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,999
    Perfect, thanks
     
  11. SupremeEnchanter

    SupremeEnchanter

    Joined:
    Nov 29, 2012
    Posts:
    181
    Unity 2019.1 gives this error in every game. As such one can not compile the game and can not do much until it is fixed. I tried setting up an account on your website but it will not accept the unity invoice number.

    Assets\SimpleIAPSystem\Scripts\VRGraphicRaycaster.cs(325,36): error CS0234: The type or namespace name 'ScriptingUtils' does not exist in the namespace 'UnityEngineInternal' (are you missing an assembly reference?)
     
  12. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    @SupremeEnchanter Thanks, I'm looking into it. Could you please try registering again? Maybe your formatting was incorrect, the field accepts INxxxx and 303xxx invoice ids.

    If that doesn't work, please send your invoice via email so I can check that out as well.

    Edit: In the VRGraphicRaycaster script, all calls to UnityEngineInternal.ScriptingUtils.CreateDelegate should be replaced with just Delegate.CreateDelegate. I will prepare a new version for the Asset Store very soon.
     
    Last edited: Apr 17, 2019
  13. SupremeEnchanter

    SupremeEnchanter

    Joined:
    Nov 29, 2012
    Posts:
    181
    I have IAP setup for android play store. I was wondering how to set IAP for windows store? I assume they are similar.
     
  14. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    @SupremeEnchanter In Simple IAP System, nothing changes when building for an additional platform. If you are looking for a Windows Store guide, please see the official manual.

    Also, as I wrote before, please contact us if you're having issues registering on our forum - this is not optional. We're answering general questions on this forum, but are doing support only on our forum.
     
  15. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,999
    Sorry to post in here again, I tried to log into my forum account but it says my credentials are not correct, so I tried to change my password but I never receive the email.

    Anyway, I'm using the following with a text array of strings (AllTackleVenueIAPIds) for each IAP id and some players are reporting that they're not receiving all the content unlocked, I check their data (as I save it to playfab and it does only show the 'unlock_everything' purchase and nothing else, it should unlock all items, set remove_ads to purchase and give them 1000 coins, can you see anything here that could be an issue:


    Code (CSharp):
    1.   public void HandleSuccessfulPurchase(string id)
    2.     {
    3.         if (PurchaseSound != null) audioSource.PlayOneShot(PurchaseSound, PurchaseSoundVolume);
    4.  
    5.         //differ between ids set in the IAP Settings editor
    6.         if (IAPManager.isDebug) Debug.Log("HandleSuccessfulPurchase: " + id);
    7.         IAPObject obj = IAPManager.GetIAPObject(id);
    8.  
    9.         //if the purchased item was non-consumable,
    10.         //additionally block further purchase of the shop item
    11.  
    12.         if (obj.type != ProductType.Consumable) DBManager.SetPurchase(id);
    13.  
    14.         switch (id)
    15.         {
    16.             case "remove_ads":
    17.                 MobileAdsManager.Instance.RemoveAds();
    18.                 break;
    19.             case "unlock_everything":
    20.  
    21.                 //Set all to purchased
    22.                 for (int i = 0; i < AllTackleVenueIAPIds.Length; i++)
    23.                 {
    24.                     if (!DBManager.isPurchased(AllTackleVenueIAPIds[i]) DBManager.SetPurchase(AllTackleVenueIAPIds[i]);
    25.                 }
    26.  
    27.                 DBManager.IncreaseFunds("coins", 1000);
    28.                 if (!DBManager.isPurchased("remove_ads")) DBManager.SetPurchase("remove_ads");
    29.  
    30.                 break;
    31.         }
    32.     }
    Also, a player got a refund for the IAP which made me wonder, what's to stop someone making an IAP and receiving the items then getting a refund? Is there anything to address that?

    Thanks
     
  16. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
  17. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,999
  18. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,999
    I've registered again with another email address...
     
  19. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    We're going to check existing email addresses very soon for the registration issue, they're somehow still floating around in our database.
     
  20. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    194
    Same happened to me hence why I have used these fourms for the time.
     
  21. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    194
    Any reason why the recipient would fail validation?
     
  22. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    Could you please elaborate? What recipient? Which validation?
     
  23. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
  24. SupremeEnchanter

    SupremeEnchanter

    Joined:
    Nov 29, 2012
    Posts:
    181
    My bad. I missed that reply.
     
  25. SupremeEnchanter

    SupremeEnchanter

    Joined:
    Nov 29, 2012
    Posts:
    181
    I have a couple of quick questions.

    1) I'd like to have a restore in the list. Is the picture how it is supposed to be done? this is what I gathered from the instructions? Do I just leave the price empty?

    2) What happens if using the following code, that the user is not connected to the internet? Does it return a not purchased? The reason is that I would like to save a variable to player prefs. Then instead of checking online, it would check the player prefs.
    if (DBManager.isPurchased("proversion"))

    3) With #2 above, if the player deletes the player prefs then I would need a way to check again. Is this what restore is for or should I just use if (DBManager.isPurchased("proversion"))?

    thanks.
     

    Attached Files:

    Chaz32621 likes this.
  26. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,246
    @SupremeEnchanter Please contact us via email with your Unity invoice number if you're having issues registering on our support forum.