GetAcceessToken() public method

public GetAcceessToken ( ) : string
return string
Example #1
0
        private void SelectGoodsGroup(XsollaGoodsGroup pGroup)
        {
            // Зачищаем панель с товарами
            ClearItemsContent();
            // Запускаем прелоадер
            mProgressBar.SetLoading(true);
            // выбор товаров по группе
            // Меняем заголовок
            mShopTitle.text = pGroup.GetName();
            mCurrGroupId    = pGroup.id;

            // запрос на данные
            Logger.Log("Load goods from groupId:" + pGroup.id.ToString());
            Dictionary <String, object> lParams = new Dictionary <string, object>();

            lParams.Add(XsollaApiConst.ACCESS_TOKEN, mUtils.GetAcceessToken());
            if (mUtils.GetUser().userBalance != null)
            {
                lParams.Add(XsollaApiConst.USER_INITIAL_CURRENCY, mUtils.GetUser().userBalance.currency);
            }
            lParams.Add("group_id", pGroup.id);
            // Если id = -1 то это распродажа и делаем запрос по другому адресу
            ApiRequest.Instance.getApiRequest(new XsollaRequestPckg((pGroup.id == -1) ? mSalesUrl : mGoodsUrl, lParams), GoodsRecived, ErrorRecived, mGroupUseCached.ContainsKey(mCurrGroupId) ? mGroupUseCached[mCurrGroupId] : true);

            SetCachedStateOnGroupId(mCurrGroupId, true);
        }
        /// <summary>
        /// Changes the state of the fav.
        /// </summary>
        private void ChangeFavState()
        {
            Logger.Log("Get summary");
            Dictionary <String, object> lParams = new Dictionary <string, object>();

            lParams.Add(XsollaApiConst.ACCESS_TOKEN, mUtils.GetAcceessToken());
            if (mUtils.GetUser().userBalance != null)
            {
                lParams.Add(XsollaApiConst.USER_INITIAL_CURRENCY, mUtils.GetUser().userBalance.currency);
            }
            lParams.Add("virtual_item_id", mItem.GetId());
            lParams.Add("is_favorite", mItem.IsFavorite()? "0" : "1");
            ApiRequest.Instance.getApiRequest(new XsollaRequestPckg(mFavoriteUrl, lParams), FavoriteRecived, ErrorRecived, false);
        }
Example #3
0
        protected virtual void RecieveUtils(XsollaUtils utils)
        {
            Logger.Log("Utils recived");
            Utils = utils;
            if (isSimple)
            {
                BaseParams += "&access_token=" + utils.GetAcceessToken();
                currentPurchase.GetPart(ActivePurchase.Part.TOKEN).Remove("access_data");
                currentPurchase.GetPart(ActivePurchase.Part.TOKEN).Add("access_token", utils.GetAcceessToken());
            }
            XsollaPurchase xsollaPurchase = utils.GetPurchase();

            if (xsollaPurchase != null)
            {
                bool isPurchase = xsollaPurchase.IsPurchase();
                if (xsollaPurchase.paymentSystem != null && isPurchase)
                {
                    NextPaymentStep(currentPurchase.GetMergedMap());
                }
                else if (isPurchase)
                {
                    LoadQuickPayment();
                }
                else
                {
                    LoadShop(utils);
                }
            }
            else
            {
                LoadShop(utils);
            }
            SetLoading(false);
        }
Example #4
0
        private void GetSubsRequest()
        {
            mProgressBar.SetLoading(true);
            // получить список пакетов
            Dictionary <String, object> lParams = new Dictionary <string, object>();

            lParams.Add(XsollaApiConst.ACCESS_TOKEN, mUtils.GetAcceessToken());
            ApiRequest.Instance.getApiRequest(new XsollaRequestPckg(mActiveSubsUrl, lParams), ActiveSubsRecived, ErrorRecived);
        }
Example #5
0
        /// <summary>
        /// Gets the request list.
        /// </summary>
        private void GetRequestList()
        {
            mProgressBar.SetLoading(true);
            Dictionary <String, object> lParams = new Dictionary <string, object>();

            lParams.Add(XsollaApiConst.ACCESS_TOKEN, mUtils.GetAcceessToken());
            lParams.Add("offset", mList.Count);
            lParams.Add("limit", mCountMore);
            lParams.Add("sortDesc", mSortDesc.ToString().ToLower());
            lParams.Add("sortKey", "dateTimestamp");
            Logger.Log("Request on history: offset - " + mList.Count + " Limit - " + mCountMore + " Sort - " + mSortDesc.ToString());
            ApiRequest.Instance.getApiRequest(new XsollaRequestPckg(mHistoryUrl, lParams), HistoryListRecived, ErrorRecived, false);
        }
        private void GetDetailSub(int pSubId)
        {
            Dictionary <string, object> lParams = new Dictionary <string, object>();

            lParams.Add(XsollaApiConst.ACCESS_TOKEN, mUtils.GetAcceessToken());
            lParams.Add("subscription_id", pSubId);
            if (mUtils.GetUser().userBalance != null)
            {
                lParams.Add(XsollaApiConst.USER_INITIAL_CURRENCY, mUtils.GetUser().userBalance.currency);
            }

            getApiRequest(DOMAIN + "/paystation2/api/useraccount/subscription", lParams, callbackShowSubDetail);
        }
Example #7
0
        private void GetSavedMethod(bool pAddState = false, bool pInitAfter = false)
        {
            WWWForm form = new WWWForm();
            string  url  = "https://secure.xsolla.com/paystation2/api/savedmethods";
            Dictionary <string, object> post = new Dictionary <string, object>();
            StringBuilder sb = new StringBuilder();

            post.Add(XsollaApiConst.ACCESS_TOKEN, mUtilsLink.GetAcceessToken());

            foreach (KeyValuePair <string, object> post_arg in post)
            {
                string argValue = post_arg.Value != null?post_arg.Value.ToString() : "";

                sb.Append(post_arg.Key).Append("=").Append(argValue).Append("&");
                form.AddField(post_arg.Key, argValue);
            }

            Debug.Log(url);
            Debug.Log(sb.ToString());
            WWW www = new WWW(url, form);

            StartCoroutine(GetListSavedMethod(www, pInitAfter, pAddState));
        }
Example #8
0
        public void init(XsollaUtils pUtils)
        {
            mUtils     = pUtils;
            mListItems = new List <PricePointItemController>();

            mStartProgressBar();

            mShopTitle.text = (pUtils.GetProject().components ["virtual_currency"].Name != "") ? pUtils.GetProject().components["virtual_currency"].Name : pUtils.GetTranslations().Get(XsollaTranslations.PRICEPOINT_PAGE_TITLE);

            // Задаем перевод на отсутствие товаров
            mEmptyLabel.text = mUtils.GetTranslations().Get("virtualitem_no_data");
            mEmptyLabel.gameObject.SetActive(false);

            // Возможность произвольной покупки
            if (mUtils.GetSettings().components.virtualCurreny.customAmount)
            {
                mCustomAmountLink.SetActive(true);
                mCustomController = mCustomAmountScreen.GetComponent <CustomVirtCurrAmountController>();
                mCustomAmountLink.GetComponent <Button>().onClick.AddListener(ChangeStateCusomAmount);
                StateCustomAmount = false;
            }
            else
            {
                mCustomAmountLink.SetActive(false);
                StateCustomAmount = false;
            }

            // получить список пакетов
            Dictionary <String, object> lParams = new Dictionary <string, object>();

            lParams.Add(XsollaApiConst.ACCESS_TOKEN, mUtils.GetAcceessToken());
            if (mUtils.GetUser().userBalance != null)
            {
                lParams.Add(XsollaApiConst.USER_INITIAL_CURRENCY, mUtils.GetUser().userBalance.currency);
            }
            ApiRequest.Instance.getApiRequest(new XsollaRequestPckg(mPricePointsUrl, lParams), PricePointsRecived, ErrorRecived);
        }
Example #9
0
        public void init(XsollaUtils pUtils)
        {
            mUtils          = pUtils;
            mListItems      = new List <ShopItemController>();
            mGroupUseCached = new Dictionary <int, bool>();
            // Задаем настройки на лэндинг
            mIsListLayout = pUtils.GetSettings().mDesktop.pVirtItems.isListLayout();
            SetLanding();

            // Задаем перевод на отсутствие товаров
            mEmptyLabel.text = mUtils.GetTranslations().Get("virtualitem_no_data");
            mEmptyLabel.gameObject.SetActive(false);

            // строим навигационное меню магазина
            // получить список групп
            Dictionary <String, object> lParams = new Dictionary <string, object>();

            lParams.Add(XsollaApiConst.ACCESS_TOKEN, mUtils.GetAcceessToken());
            if (mUtils.GetUser().userBalance != null)
            {
                lParams.Add(XsollaApiConst.USER_INITIAL_CURRENCY, mUtils.GetUser().userBalance.currency);
            }
            ApiRequest.Instance.getApiRequest(new XsollaRequestPckg(mGroupsUrl, lParams), GoodsGroupRecived, ErrorRecived);
        }
Example #10
0
        private void ProcessingRequestResult(int pType, RequestClass pRequestResult, Dictionary <string, object> pDataArgs)
        {
            if (!pRequestResult.HasError)
            {
                // Start Processing
                Debug.Log("Type -> " + pType);
                Debug.Log("WWW_request -> " + pRequestResult.TextRequest);

                JSONNode rootNode = JSON.Parse(pRequestResult.TextRequest);
                if (rootNode != null && rootNode.Count > 2 || rootNode["error"] == null)
                {
                    switch (pType)
                    {
                    case TRANSLATIONS:
                    {
                        if (rootNode.Count > 2)
                        {
                            XsollaUtils utils = new XsollaUtils().Parse(rootNode) as XsollaUtils;
                            projectId = utils.GetProject().id.ToString();

                            OnUtilsRecieved(utils);
                            // if base param not containKey access token, then add token from util
                            if (!baseParams.ContainsKey(XsollaApiConst.ACCESS_TOKEN))
                            {
                                _accessToken = utils.GetAcceessToken();
                            }
                            OnTranslationRecieved(utils.GetTranslations());
                        }
                        else
                        {
                            XsollaError error = new XsollaError();
                            error.Parse(rootNode);
                            OnErrorReceived(error);
                        }
                    }
                    break;

                    case DIRECTPAYMENT_FORM:
                    {
                        if (rootNode.Count > 8)
                        {
                            XsollaForm form = new XsollaForm();
                            form.Parse(rootNode);
                            switch (form.GetCurrentCommand())
                            {
                            case XsollaForm.CurrentCommand.STATUS:
                                GetStatus(form.GetXpsMap());
                                break;

                            case XsollaForm.CurrentCommand.CHECKOUT:
                            case XsollaForm.CurrentCommand.CHECK:
                            case XsollaForm.CurrentCommand.FORM:
                            case XsollaForm.CurrentCommand.CREATE:
                            case XsollaForm.CurrentCommand.ACCOUNT:
                                OnFormReceived(form);
                                break;

                            case XsollaForm.CurrentCommand.UNKNOWN:
                                if (rootNode.Count > 10)
                                {
                                    OnFormReceived(form);
                                }
                                else
                                {
                                    XsollaError error = new XsollaError();
                                    error.Parse(rootNode);
                                    OnErrorReceived(error);
                                }
                                break;

                            default:
                                break;
                            }
                        }
                        else
                        {
                            XsollaStatusPing statusPing = new XsollaStatusPing();
                            statusPing.Parse(rootNode);
                            OnStatusChecked(statusPing);
                        }
                    }
                    break;

                    case DIRECTPAYMENT_STATUS:
                    {
                        XsollaForm form = new XsollaForm();
                        form.Parse(rootNode);
                        XsollaStatus status = new XsollaStatus();
                        status.Parse(rootNode);
                        OnStatusReceived(status, form);
                    }
                    break;

                    case PRICEPOINTS:
                    {
                        XsollaPricepointsManager pricepoints = new XsollaPricepointsManager();
                        pricepoints.Parse(rootNode);
                        OnPricepointsRecieved(pricepoints);
                    }
                    break;

                    case GOODS:
                    {
                        XsollaGoodsManager goods = new XsollaGoodsManager();
                        goods.Parse(rootNode);
                        OnGoodsRecieved(goods);
                    }
                    break;

                    case GOODS_GROUPS:
                    {
                        XsollaGroupsManager groups = new XsollaGroupsManager();
                        groups.Parse(rootNode);
                        OnGoodsGroupsRecieved(groups);
                    }
                    break;

                    case GOODS_ITEMS:
                    {
                        XsollaGoodsManager goods = new XsollaGoodsManager();
                        goods.Parse(rootNode);
                        OnGoodsRecieved(goods);
                    }
                    break;

                    case PAYMENT_LIST:
                    {
                        XsollaPaymentMethods paymentMethods = new XsollaPaymentMethods();
                        paymentMethods.Parse(rootNode);
                        OnPaymentMethodsRecieved(paymentMethods);
                    }
                    break;

                    case SAVED_PAYMENT_LIST:
                    {
                        XsollaSavedPaymentMethods savedPaymentsMethods = new XsollaSavedPaymentMethods();
                        savedPaymentsMethods.Parse(rootNode);
                        OnSavedPaymentMethodsRecieved(savedPaymentsMethods);
                    }
                    break;

                    case QUICK_PAYMENT_LIST:
                    {
                        XsollaQuickPayments quickPayments = new XsollaQuickPayments();
                        quickPayments.Parse(rootNode);
                        OnQuickPaymentMethodsRecieved(quickPayments);
                    }
                    break;

                    case COUNTRIES:
                    {
                        XsollaCountries countries = new XsollaCountries();
                        countries.Parse(rootNode);
                        OnCountriesRecieved(countries);
                    }
                    break;

                    case VIRTUAL_PAYMENT_SUMMARY:
                    {
                        XVirtualPaymentSummary summary = new XVirtualPaymentSummary();
                        summary.Parse(rootNode);
                        Logger.Log("VIRTUAL_PAYMENT_SUMMARY " + summary.ToString());
                        if (summary.IsSkipConfirmation)
                        {
                            Logger.Log("IsSkipConfirmation true");
                            pDataArgs.Add("dont_ask_again", 0);
                            ProceedVPayment(pDataArgs);
                        }
                        else
                        {
                            Logger.Log("IsSkipConfirmation false");
                            OnVPSummaryRecieved(summary);
                        }
                    }
                    break;

                    case VIRTUAL_PROCEED:
                    {
                        XProceed proceed = new XProceed();
                        proceed.Parse(rootNode);
                        Logger.Log("VIRTUAL_PROCEED " + proceed.ToString());
                        if (proceed.IsInvoiceCreated)
                        {
                            Logger.Log("VIRTUAL_PROCEED 1");
                            long operationId = proceed.OperationId;
                            pDataArgs.Add("operation_id", operationId);
                            VPaymentStatus(pDataArgs);
                        }
                        else
                        {
                            Logger.Log("VIRTUAL_PROCEED 0 ");
                            OnVPProceedError(proceed.Error);
                        }
                    }
                    break;

                    case VIRTUAL_STATUS:
                    {
                        XVPStatus vpStatus = new XVPStatus();
                        vpStatus.Parse(rootNode);
                        //{"errors":[ {"message":"Insufficient balance to complete operation"} ], "api":{"ver":"1.0.1"}, "invoice_created":"false", "operation_id":"0", "code":"0"}
                        Logger.Log("VIRTUAL_STATUS" + vpStatus.ToString());
                        OnVPStatusRecieved(vpStatus);
                    }
                    break;

                    case APPLY_PROMO_COUPONE:
                    {
                        XsollaForm form = new XsollaForm();
                        form.Parse(rootNode);
                        OnApplyCouponeReceived(form);
                    }
                    break;

                    case COUPON_PROCEED:
                    {
                        XsollaCouponProceedResult couponProceed = new XsollaCouponProceedResult();
                        couponProceed.Parse(rootNode);
                        if (couponProceed._error != null)
                        {
                            Logger.Log("COUPON_PROCEED ERROR: " + couponProceed._error);
                            OnCouponProceedErrorRecived(couponProceed);
                        }
                        else
                        {
                            long operationId = couponProceed._operationId;
                            if (pDataArgs.ContainsKey("coupon_code"))
                            {
                                pDataArgs.Remove("coupon_code");
                            }
                            pDataArgs.Add("operation_id", operationId);
                            VPaymentStatus(pDataArgs);
                        }
                    }
                    break;

                    case HISTORY:
                    {
                        XsollaHistoryList history = new XsollaHistoryList().Parse(rootNode["operations"]) as XsollaHistoryList;
                        OnHistoryRecieved(history);
                    }
                    break;

                    case CALCULATE_CUSTOM_AMOUNT:
                    {
                        //TODO: fill method
                        CustomVirtCurrAmountController.CustomAmountCalcRes res = new CustomVirtCurrAmountController.CustomAmountCalcRes().Parse(rootNode["calculation"]) as CustomVirtCurrAmountController.CustomAmountCalcRes;
                        OnCustomAmountResRecieved(res);
                    }
                    break;

                    default:
                        break;
                    }
                }
                else
                {
                    XsollaError error = new XsollaError();
                    error.Parse(rootNode);
                    OnErrorReceived(error);
                }
            }
            else
            {
                JSONNode errorNode = JSON.Parse(pRequestResult.TextRequest);
                string   errorMsg  = errorNode["errors"].AsArray[0]["message"].Value
                                     + ". Support code " + errorNode["errors"].AsArray[0]["support_code"].Value;
                int errorCode = 0;
                if (pRequestResult.ErrorText.Length > 3)
                {
                    errorCode = int.Parse(pRequestResult.ErrorText.Substring(0, 3));
                }
                else
                {
                    errorCode = int.Parse(pRequestResult.ErrorText);
                }
                OnErrorReceived(new XsollaError(errorCode, errorMsg));
            }
            if (projectId != null && !"".Equals(projectId))
            {
                LogEvent("UNITY " + SDK_VERSION + " REQUEST", projectId, pRequestResult.Url);
            }
            else
            {
                LogEvent("UNITY " + SDK_VERSION + " REQUEST", "undefined", pRequestResult.Url);
            }
        }
        private void ProcessingRequestResult(int pType, RequestClass pRequestResult, Dictionary<string, object> pDataArgs)
        {
            if (!pRequestResult.HasError)
            {
                // Start Processing
                Debug.Log("Type -> " + pType);
                Debug.Log("WWW_request -> " + pRequestResult.TextRequest);

                JSONNode rootNode = JSON.Parse(pRequestResult.TextRequest);
                if(rootNode != null && rootNode.Count > 2 || rootNode["error"] == null) {
                    switch(pType)
                    {
                    case TRANSLATIONS:
                        {
                            if(rootNode.Count > 2){
                                XsollaUtils utils = new XsollaUtils().Parse(rootNode) as XsollaUtils;
                                projectId = utils.GetProject().id.ToString();

                                OnUtilsRecieved(utils);
                                // if base param not containKey access token, then add token from util
                                if (!baseParams.ContainsKey(XsollaApiConst.ACCESS_TOKEN))
                                    _accessToken = utils.GetAcceessToken();
                                OnTranslationRecieved(utils.GetTranslations());
                            } else {
                                XsollaError error = new XsollaError();
                                error.Parse(rootNode);
                                OnErrorReceived(error);
                            }
                        }
                        break;
                    case DIRECTPAYMENT_FORM:
                        {
                            if(rootNode.Count > 8) {
                                XsollaForm form = new XsollaForm();
                                form.Parse(rootNode);
                                switch (form.GetCurrentCommand()) {
                                case XsollaForm.CurrentCommand.STATUS:
                                    GetStatus(form.GetXpsMap());
                                    break;
                                case XsollaForm.CurrentCommand.CHECKOUT:
                                case XsollaForm.CurrentCommand.CHECK:
                                case XsollaForm.CurrentCommand.FORM:
                                case XsollaForm.CurrentCommand.CREATE:
                                case XsollaForm.CurrentCommand.ACCOUNT:
                                    OnFormReceived(form);
                                    break;
                                case XsollaForm.CurrentCommand.UNKNOWN:
                                    if(rootNode.Count > 10)
                                    {
                                        OnFormReceived(form);
                                    } else {
                                        XsollaError error = new XsollaError();
                                        error.Parse(rootNode);
                                        OnErrorReceived(error);
                                    }
                                    break;
                                default:
                                    break;
                                }
                            } else {
                                XsollaStatusPing statusPing = new XsollaStatusPing();
                                statusPing.Parse(rootNode);
                                OnStatusChecked(statusPing);
                            }
                        }
                        break;
                    case DIRECTPAYMENT_STATUS:
                        {
                            XsollaForm form = new XsollaForm();
                            form.Parse(rootNode);
                            XsollaStatus status = new XsollaStatus();
                            status.Parse(rootNode);
                            OnStatusReceived(status, form);
                        }
                        break;
                    case PRICEPOINTS:
                        {
                            XsollaPricepointsManager pricepoints = new XsollaPricepointsManager();
                            pricepoints.Parse(rootNode);
                            OnPricepointsRecieved(pricepoints);
                        }
                        break;
                    case GOODS:
                        {
                            XsollaGoodsManager goods = new XsollaGoodsManager();
                            goods.Parse(rootNode);
                            OnGoodsRecieved(goods);
                        }
                        break;
                    case GOODS_GROUPS:
                        {
                            XsollaGroupsManager groups = new XsollaGroupsManager();
                            groups.Parse(rootNode);
                            OnGoodsGroupsRecieved(groups);
                        }
                        break;
                    case GOODS_ITEMS:
                        {
                            XsollaGoodsManager goods = new XsollaGoodsManager();
                            goods.Parse(rootNode);
                            OnGoodsRecieved(goods);
                        }
                        break;
                    case PAYMENT_LIST:
                        {
                            XsollaPaymentMethods paymentMethods = new XsollaPaymentMethods();
                            paymentMethods.Parse(rootNode);
                            OnPaymentMethodsRecieved(paymentMethods);
                        }
                        break;
                    case SAVED_PAYMENT_LIST:
                        {
                            XsollaSavedPaymentMethods savedPaymentsMethods = new XsollaSavedPaymentMethods();
                            savedPaymentsMethods.Parse(rootNode);
                            OnSavedPaymentMethodsRecieved(savedPaymentsMethods);
                        }
                        break;
                    case QUICK_PAYMENT_LIST:
                        {
                            XsollaQuickPayments quickPayments = new XsollaQuickPayments();
                            quickPayments.Parse(rootNode);
                            OnQuickPaymentMethodsRecieved(quickPayments);
                        }
                        break;
                    case COUNTRIES:
                        {
                            XsollaCountries countries = new XsollaCountries();
                            countries.Parse(rootNode);
                            OnCountriesRecieved(countries);
                        }
                        break;
                    case VIRTUAL_PAYMENT_SUMMARY:
                        {
                            XVirtualPaymentSummary summary = new XVirtualPaymentSummary();
                            summary.Parse(rootNode);
                            Logger.Log("VIRTUAL_PAYMENT_SUMMARY " + summary.ToString());
                            if(summary.IsSkipConfirmation) {
                                Logger.Log("IsSkipConfirmation true");
                                pDataArgs.Add("dont_ask_again", 0);
                                ProceedVPayment(pDataArgs);
                            } else {
                                Logger.Log("IsSkipConfirmation false");
                                OnVPSummaryRecieved(summary);
                            }
                        }
                        break;
                    case VIRTUAL_PROCEED:
                        {
                            XProceed proceed = new XProceed();
                            proceed.Parse(rootNode);
                            Logger.Log ("VIRTUAL_PROCEED " + proceed.ToString());
                            if(proceed.IsInvoiceCreated) {
                                Logger.Log ("VIRTUAL_PROCEED 1");
                                long operationId = proceed.OperationId;
                                pDataArgs.Add("operation_id", operationId);
                                VPaymentStatus(pDataArgs);
                            } else {
                                Logger.Log ("VIRTUAL_PROCEED 0 ");
                                OnVPProceedError(proceed.Error);
                            }
                        }
                        break;
                    case VIRTUAL_STATUS:
                        {
                            XVPStatus vpStatus = new XVPStatus();
                            vpStatus.Parse(rootNode);
                            //{"errors":[ {"message":"Insufficient balance to complete operation"} ], "api":{"ver":"1.0.1"}, "invoice_created":"false", "operation_id":"0", "code":"0"}
                            Logger.Log ("VIRTUAL_STATUS" + vpStatus.ToString());
                            OnVPStatusRecieved(vpStatus);
                        }
                        break;

                    case APPLY_PROMO_COUPONE:
                        {
                            XsollaForm form = new XsollaForm();
                            form.Parse(rootNode);
                            OnApplyCouponeReceived(form);
                        }
                        break;
                    case COUPON_PROCEED:
                        {
                            XsollaCouponProceedResult couponProceed = new XsollaCouponProceedResult();
                            couponProceed.Parse(rootNode);
                            if (couponProceed._error != null)
                            {
                                Logger.Log("COUPON_PROCEED ERROR: " + couponProceed._error);
                                OnCouponProceedErrorRecived(couponProceed);
                            }
                            else
                            {
                                long operationId = couponProceed._operationId;
                                if (pDataArgs.ContainsKey("coupon_code"))
                                    pDataArgs.Remove("coupon_code");
                                pDataArgs.Add("operation_id", operationId);
                                VPaymentStatus(pDataArgs);
                            }
                        }
                        break;

                    case HISTORY:
                        {
                            XsollaHistoryList history = new XsollaHistoryList().Parse(rootNode["operations"]) as XsollaHistoryList;
                            OnHistoryRecieved(history);

                        }
                        break;
                    case CALCULATE_CUSTOM_AMOUNT:
                        {
                            //TODO: fill method
                            CustomVirtCurrAmountController.CustomAmountCalcRes res = new CustomVirtCurrAmountController.CustomAmountCalcRes().Parse(rootNode["calculation"]) as CustomVirtCurrAmountController.CustomAmountCalcRes;
                            OnCustomAmountResRecieved(res);
                        }
                        break;
                    default:
                        break;
                    }
                } else {
                    XsollaError error = new XsollaError();
                    error.Parse(rootNode);
                    OnErrorReceived(error);
                }
            }
            else
            {
                JSONNode errorNode = JSON.Parse(pRequestResult.TextRequest);
                string errorMsg = errorNode["errors"].AsArray[0]["message"].Value
                    + ". Support code " + errorNode["errors"].AsArray[0]["support_code"].Value;
                int errorCode = 0;
                if(pRequestResult.ErrorText.Length > 3)
                    errorCode = int.Parse(pRequestResult.ErrorText.Substring(0, 3));
                else
                    errorCode = int.Parse(pRequestResult.ErrorText);
                OnErrorReceived(new XsollaError(errorCode, errorMsg));
            }
            if(projectId != null && !"".Equals(projectId))
                LogEvent ("UNITY " + SDK_VERSION + " REQUEST", projectId, pRequestResult.Url);
            else
                LogEvent ("UNITY " + SDK_VERSION + " REQUEST", "undefined", pRequestResult.Url);
        }