Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

error CS0103: The name 'StandardPurchasingModule' does not exist in the current context

Discussion in 'Unity IAP' started by pKallv, Sep 15, 2019.

  1. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,177
    I am trying to implement IAP into my app but get this error:

    It seems to be a common. problem and I have tested all kinds of ways to solve this including downloading tutorial projects from this forum, but still get the same problem.

    The code below is from the last project here: https://forum.unity.com/threads/sample-iap-project.529555/

    I do not know what to do to get this work and would appreciate any help so I understand how to solve this.

    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using UnityEngine.Purchasing;
    4. using UnityEngine.UI;
    5.  
    6. public class KD_IAPManager : MonoBehaviour, IStoreListener
    7. {
    8.  
    9.     private static IStoreController m_StoreController;          // The Unity Purchasing system.
    10.     private static IExtensionProvider m_StoreExtensionProvider; // The store-specific Purchasing subsystems.
    11.     private static Product test_product = null;
    12.  
    13.  
    14.     public static string DECK_ENHANCE = "DeckEnhance";
    15.     private static Text myText;
    16.  
    17.     private Boolean return_complete = true;
    18.  
    19.     void Start()
    20.     {
    21.         myText = GameObject.Find("MyText").GetComponent<Text>();
    22.  
    23.         // If we haven't set up the Unity Purchasing reference
    24.         if (m_StoreController == null)
    25.         {
    26.             // Begin to configure our connection to Purchasing
    27.             InitializePurchasing();
    28.         }
    29.         MyDebug("Complete = " + return_complete.ToString());
    30.     }
    31.  
    32.     public void InitializePurchasing()
    33.     {
    34.         if (IsInitialized())
    35.         {
    36.             return;
    37.         }
    38. >>>> HERE IS THE PROBLEM <<<<
    39.         var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    40.  
    41.         builder.AddProduct(DECK_ENHANCE, ProductType.NonConsumable);
    42.  
    43.         UnityPurchasing.Initialize(this, builder);
    44.     }
    45.  
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Did you view the video and follow the steps? What version of Unity are you using? Don't use Unity 2019 until the next IAP release in a few weeks.
     
    pKallv likes this.
  3. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,177
    Well that is the problem I guess, using 2019.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    No need to guess, it's good to review the popular posts on this forum