Esempio n. 1
0
 public bool Init(bool isResetMaster = false, ProductParamResponse res = null)
 {
     PaymentManager.MyDebug.PushMessage("PaymentManager.Init");
     this.isSetupOK = false;
     if (isResetMaster)
     {
         if (res != null)
         {
             this.ProductMasters = res.products;
         }
         else
         {
             this.ProductMasters.Clear();
         }
     }
     if (!this.isInitialized)
     {
         PaymentKit.set_EventListener((IPaymentListener)this);
         Client.set_Listener((IGacctListener)this);
         if (MonoSingleton <DebugManager> .Instance.IsWebViewEnable())
         {
             Client.SetUserAgent(gu3.Device.System.GetUserAgent());
         }
         else
         {
             Client.SetUserAgent("Mozilla/5.0 (Linux; U; Android 4.3; ja-jp; Nexus 7 Build/JSS15Q) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30");
         }
         PaymentKit.InitAndroid(this.googlePublicKey);
         this.isInitialized = true;
     }
     DebugUtility.LogWarning("PaymentManager:isSetupOK=>" + this.isSetupOK.ToString());
     return(true);
 }
Esempio n. 2
0
 public bool RequestPurchase(string productId)
 {
     PaymentManager.MyDebug.PushMessage(nameof(RequestPurchase));
     PaymentManager.verifyRetryCount = 0;
     this.purchaseResult             = PaymentManager.ERequestPurchaseResult.NONE;
     PaymentKit.StartPayment(productId);
     return(true);
 }
Esempio n. 3
0
    public void OnSetupSucceeded(string message)
    {
        PaymentManager.MyDebug.PushMessage(nameof(OnSetupSucceeded));
        int length1 = this.ProductIds.Length + this.BundleIds.Length;

        string[] strArray = new string[length1];
        for (int index = 0; index < this.ProductIds.Length; ++index)
        {
            strArray[index] = this.ProductIds[index];
        }
        int index1 = 0;

        for (int length2 = this.ProductIds.Length; length2 < length1; ++length2)
        {
            strArray[length2] = this.BundleIds[index1];
            ++index1;
        }
        PaymentKit.RequestProductDetails(strArray);
    }