Пример #1
0
 void HandleBillingFlowResult(GoogleBillingResult billingResult, AndroidJavaObject sku)
 {
     if (billingResult.responseCode != BillingClientResponseEnum.OK())
     {
         m_GooglePurchaseCallback.OnPurchaseFailed(
             new PurchaseFailureDescription(
                 sku.Call <string>("getSku"),
                 PurchaseFailureReason.PurchasingUnavailable,
                 billingResult.debugMessage
                 )
             );
     }
 }
        void onBillingSetupFinished(AndroidJavaObject billingResult)
        {
            GoogleBillingResult result = new GoogleBillingResult(billingResult);

            if (result.responseCode == BillingClientResponseEnum.OK())
            {
                m_OnConnected();
            }
            else
            {
                m_Disconnect();
            }
        }
        void ConsolidateOnSkuDetailsReceived(AndroidJavaObject javaBillingResult, AndroidJavaObject skuDetails, Action <List <AndroidJavaObject> > onSkuDetailsResponse)
        {
            m_NumberReceivedCallbacks++;

            GoogleBillingResult billingResult = new GoogleBillingResult(javaBillingResult);

            if (billingResult.responseCode == BillingClientResponseEnum.OK())
            {
                AddToQueriedSkuDetails(skuDetails);
            }

            if (m_NumberReceivedCallbacks >= k_RequiredNumberOfCallbacks)
            {
                m_GoogleCachedQuerySkuDetailsService.AddCachedQueriedSkus(m_QueriedSkuDetails);
                onSkuDetailsResponse(m_QueriedSkuDetails);
                Clear();
            }
        }
Пример #4
0
        /// <summary>
        /// Implementation of com.android.billingclient.api.PurchasesUpdatedListener#onPurchasesUpdated
        /// </summary>
        /// <param name="billingResult"></param>
        /// <param name="purchasesList"></param>
        void onPurchasesUpdated(AndroidJavaObject billingResult, AndroidJavaObject purchasesList)
        {
            GoogleBillingResult result = new GoogleBillingResult(billingResult);

            if (result.responseCode == BillingClientResponseEnum.OK() && purchasesList != null)
            {
                ApplyOnPurchases(purchasesList, OnPurchaseOk);
            }
            else if (result.responseCode == BillingClientResponseEnum.USER_CANCELED() && purchasesList != null)
            {
                ApplyOnPurchases(purchasesList, OnPurchaseCanceled);
            }
            else if (result.responseCode == BillingClientResponseEnum.ITEM_ALREADY_OWNED() && purchasesList != null)
            {
                ApplyOnPurchases(purchasesList, OnPurchaseAlreadyOwned);
            }
            else
            {
                HandleErrorCases(result, purchasesList);
            }
        }
 void HandleGooglePurchaseResult(GooglePurchaseResult purchaseResult, Action <List <GooglePurchase> > onPurchaseResult)
 {
     onPurchaseResult(purchaseResult.m_ResponseCode == BillingClientResponseEnum.OK() ? purchaseResult.m_Purchases : new List <GooglePurchase>());
 }