GetTranslations() public méthode

public GetTranslations ( ) : XsollaTranslations
Résultat XsollaTranslations
 public void InitScreen(XsollaUtils utils)
 {
     utilsLink = utils;
     title.GetComponent<Text>().text = utilsLink.GetTranslations().Get(XsollaTranslations.SAVEDMETHOD_PAGE_TITLE);
     showQuickPaymentMethods.GetComponent<Text>().text = utilsLink.GetTranslations().Get(XsollaTranslations.PAYMENT_LIST_SHOW_QUICK);
     back.GetComponent<Text>().text = utilsLink.GetTranslations().Get(XsollaTranslations.BACK_TO_SPECIALS);
 }
        /// <summary>
        /// Sets the list landing item.
        /// </summary>
        /// <param name="pItem">P item.</param>
        private void SetListLandingItem(XsollaShopItem pItem)
        {
            if (mQuantityLabel == null)
            {
                return;
            }

            if ((pItem.GetQuantityLimit() > 1) || (pItem.GetQuantityLimit() == 0))
            {
                // Блок кол-ва
                if (mQuantityLabel != null && mQuantityCount != null)
                {
                    mQuantityLabel.text = mUtils.GetTranslations().Get("quantity_label");
                    mQuantityCount.text = mCount.ToString();
                }
                // События для кнопок изменения кол-ва товара
                if (mQuantityMinus != null && mQuantityPlus != null)
                {
                    mQuantityMinus.onClick.AddListener(MinusQuantity);
                    mQuantityPlus.onClick.AddListener(AddQuantity);
                }
            }
            else
            {
                // убираем панель с кол-вом
                mQuantityLabel.gameObject.SetActive(false);
                mQuantityPanel.SetActive(false);
            }
        }
Exemple #3
0
        public void InitScreen(XsollaUtils pUtils)
        {
            // set title
            _titleProj.text = pUtils.GetProject().name;

            // user name
            _userName.text = pUtils.GetUser().GetName();

            if (pUtils.GetUser().virtualCurrencyBalance != null)
            {
                AddUserMenuBtn(pUtils.GetTranslations().Get("user_menu_balance"), ShowHistory);
                _pMenuBtnComponent.enabled = true;
            }

            if (!pUtils.IsServerLess())
            {
                AddUserMenuBtn(pUtils.GetTranslations().Get("user_menu_payment_accounts"), ShowPaymentManager);
            }

            if (pUtils.GetProject().components.ContainsKey("subscriptions"))
            {
                AddUserMenuBtn(pUtils.GetTranslations().Get("user_menu_user_subscription"), ShowSubscriptionManager);
            }

            if (pUtils.IsServerLess())
            {
                _userName.color            = StyleManager.Instance.GetColor(StyleManager.BaseColor.disable_user_menu);
                _pMenuBtnComponent.enabled = false;
                mDropIcon.gameObject.SetActive(false);
            }
        }
Exemple #4
0
        //TODO minimize
        private void InitMenu(XsollaUtils utils)
        {
            GameObject menuItemPrefab = Resources.Load("Prefabs/SimpleView/MenuItem") as GameObject;
//			menuTransform = mainScreen.GetComponentInChildren<HorizontalLayoutGroup> ().gameObject.transform;
            XsollaPaystation2 paystation2 = utils.GetSettings().paystation2;

            if (paystation2.goodsAtFirst != null && paystation2.goodsAtFirst.Equals("1"))
            {
                GameObject menuItemGoods = Instantiate(menuItemPrefab) as GameObject;
                Text[]     texts         = menuItemGoods.GetComponentsInChildren <Text>();
                texts[0].text = "";
                texts[1].text = utils.GetTranslations().Get(XsollaTranslations.VIRTUALITEM_PAGE_TITLE);
                menuItemGoods.GetComponent <Button>().onClick.AddListener(delegate { LoadGoodsGroups(); });
                menuItemGoods.transform.SetParent(menuTransform);
            }
            if (paystation2.pricepointsAtFirst != null && paystation2.pricepointsAtFirst.Equals("1"))
            {
                GameObject menuItemPricepoints = Instantiate(menuItemPrefab) as GameObject;
                Text[]     texts = menuItemPricepoints.GetComponentsInChildren <Text>();
                texts[0].text = "";
                texts[1].text = utils.GetTranslations().Get(XsollaTranslations.PRICEPOINT_PAGE_TITLE);
                menuItemPricepoints.GetComponent <Button>().onClick.AddListener(delegate { LoadShopPricepoints(); });
                menuItemPricepoints.transform.SetParent(menuTransform);
            }
        }
 public void InitScreen(XsollaUtils utils)
 {
     utilsLink = utils;
     title.GetComponent <Text>().text = utilsLink.GetTranslations().Get(XsollaTranslations.SAVEDMETHOD_PAGE_TITLE);
     showQuickPaymentMethods.GetComponent <Text>().text = utilsLink.GetTranslations().Get(XsollaTranslations.PAYMENT_LIST_SHOW_QUICK);
     back.GetComponent <Text>().text = utilsLink.GetTranslations().Get(XsollaTranslations.BACK_TO_SPECIALS);
 }
Exemple #6
0
        public void init(XsollaManagerSubDetails pSubDetail, XsollaUtils pUtils, Action <XsollaManagerSubDetails> pLinkAction)
        {
            mUtils          = pUtils;
            mSubDetail      = pSubDetail;
            mPartTitle.text = pUtils.GetTranslations().Get("user_subscription_payment_title");

            if (pSubDetail.mPaymentMethodType != "notify" && pSubDetail.mPaymentMethodName != "")
            {
                mUnLinkBtn.GetComponent <Text>().text = pUtils.GetTranslations().Get("user_subscription_unlink_payment_account");
            }
            else
            {
                mUnLinkBtn.GetComponent <Text>().text = pUtils.GetTranslations().Get("user_subscription_add");
            }
            getUnlinkBtn().onClick.AddListener(() => pLinkAction(pSubDetail));

            // добавляем поля датализации
            List <LabelValue> listFileds = getImportDetails();

            foreach (LabelValue item in listFileds)
            {
                GameObject           obj        = Instantiate(Resources.Load(mLabeltextPrefab)) as GameObject;
                LabelValueController controller = obj.GetComponent <LabelValueController>();
                controller.init(item.label, item.value, item.actionLabel, item.action);
                obj.transform.SetParent(mDetailsContainer.transform);
            }
        }
        public void initScreen(XsollaUtils pUtils, string pCustomCurrency, Action<Dictionary<string, object>> pActionCalc, Action<float> pTryPay)
        {
            if (pUtils.GetProject().isDiscrete)
                virtCurrAmount.contentType = InputField.ContentType.IntegerNumber;
            else
                virtCurrAmount.contentType = InputField.ContentType.DecimalNumber;

            // Set btn Name
            btnPay.gameObject.GetComponentInChildren<Text>().text = pUtils.GetTranslations().Get("form_continue");
            mTotalTitle = pUtils.GetTranslations().Get("payment_summary_total");
            mCustomCurrency = pCustomCurrency;
            ImageLoader imageLoader = FindObjectOfType<ImageLoader>();
            Logger.Log("VirtIcon " + pUtils.GetProject().virtualCurrencyIconUrl);
            imageLoader.LoadImage(iconVirtCurr, "http:" + pUtils.GetProject().virtualCurrencyIconUrl);

            virtCurrAmount.onEndEdit.AddListener(delegate
                {
                    if (!mSetValues)
                        pActionCalc(GetParamsForCalc(true));
                });

            realCurrAmount.onEndEdit.AddListener(delegate
                {
                    if (!mSetValues)
                        pActionCalc(GetParamsForCalc(false));
                });

            btnPay.onClick.AddListener(delegate
                {
                    pTryPay(GetOutAmount());
                });
        }
Exemple #8
0
        public void initScreen(XsollaManagerSubDetails pSubDetail, XsollaUtils pUtils)
        {
            mUtils             = pUtils;
            mSubDetail         = pSubDetail;
            mPartTitle.text    = pUtils.GetTranslations().Get("user_subscription_details_title");
            mBtnRenewName.text = pUtils.GetTranslations().Get("user_subscription_renew");

            mLinkUnhold.GetComponent <Text>().text = pUtils.GetTranslations().Get("user_subscription_unhold");
            //mLinkHoldCancel.GetComponent<Text>().text = pUtils.GetTranslations().Get("user_subscription_hold");
            mLinkHoldCancel.GetComponent <Text>().text = pUtils.GetTranslations().Get("hold_subscription_cancel_label");            // TODO вернуть обратно при реализации заморозки
            mLinkChangePlan.GetComponent <Text>().text = pUtils.GetTranslations().Get("user_subscription_change_plan");

            // кнопка обновления
            mBtnRenew.gameObject.SetActive(mSubDetail.mIsRenewPossible);
            // Unhold
            mLinkUnhold.SetActive(mSubDetail.mStatus == "freeze");
            // Hold or Cancel
            mLinkHoldCancel.SetActive((mSubDetail.mIsHoldPossible || mSubDetail.mStatus != "non_renewing") && (mSubDetail.mStatus != "freeze"));
            // TODO реализуем в последующих итерациях
            // Change Plan
            //mLinkChangePlan.SetActive(mSubDetail.mIsChangePlanAllowed);
            mLinkChangePlan.SetActive(false);

            // добавляем поля датализации
            List <LabelValue> listFileds = getImportDetails();

            foreach (LabelValue item in listFileds)
            {
                GameObject           obj        = Instantiate(Resources.Load(mLabeltextPrefab)) as GameObject;
                LabelValueController controller = obj.GetComponent <LabelValueController>();
                controller.init(item.label, item.value, item.actionLabel, item.action);
                obj.transform.SetParent(mDetailsContainer.transform);
            }
        }
Exemple #9
0
        public List <LabelValue> getImportDetails()
        {
            List <LabelValue>  list        = new List <LabelValue>();
            XsollaTranslations translation = mUtils.GetTranslations();

            // ПОЛЯ ДЕТАЛИЗАЦИИ
            // имя
            list.Add(new LabelValue(translation.Get("user_subscription_name"), mSubDetail.mName));
            // статус
            list.Add(new LabelValue(translation.Get("user_subscription_status"), translation.Get("user_subscription_status_" + mSubDetail.mStatus)));
            // ценa
            list.Add(new LabelValue(translation.Get("user_subscription_charge"), mSubDetail.mCharge.ToString()));
            // цикл платежа
            list.Add(new LabelValue(translation.Get("user_subscription_period"), formattedPeriod(mSubDetail.mPeriod.mValue.ToString(), mSubDetail.mPeriod.mUnit)));

            if (mSubDetail.mStatus == "non_renewing")
            {
                list.Add(new LabelValue(translation.Get("user_subscription_end_bill_date"), StringHelper.DateFormat(mSubDetail.mDateNextCharge)));
            }

            if (mSubDetail.mNextPeriodPlanChange != null)
            {
                list.Add(new LabelValue(translation.Get("user_subscription_new_plan"), string.Format(StringHelper.PrepareFormatString(translation.Get("user_subscription_next_period_plan_change")), mSubDetail.mNextPeriodPlanChange.name, StringHelper.DateFormat(mSubDetail.mNextPeriodPlanChange.date))));
            }

            if (mSubDetail.mIsSheduledHoldExist && (mSubDetail.mSheduledHoldDates != null) || (mSubDetail.mStatus == "freeze") && (mSubDetail.mHoldDates != null))
            {
                String lDateFrom = "", lDateTo = "";
                if (mSubDetail.mStatus == "freeze")
                {
                    if (mSubDetail.mHoldDates != null)
                    {
                        lDateFrom = StringHelper.DateFormat(mSubDetail.mHoldDates.dateFrom);
                        lDateTo   = StringHelper.DateFormat(mSubDetail.mHoldDates.dateTo);
                    }
                }
                else
                {
                    if (mSubDetail.mSheduledHoldDates != null)
                    {
                        lDateFrom = StringHelper.DateFormat(mSubDetail.mSheduledHoldDates.dateFrom);
                        lDateTo   = StringHelper.DateFormat(mSubDetail.mSheduledHoldDates.dateTo);
                    }
                }

                if (mSubDetail.mIsSheduledHoldExist)
                {
                    list.Add(new LabelValue(translation.Get("user_subscription_hold_dates"), lDateFrom + " - " + lDateTo, translation.Get(mSubDetail.mStatus == "freeze"?"user_subscription_unhold":"cancel"), cancelHoldDates));
                }
                else
                {
                    list.Add(new LabelValue(translation.Get("user_subscription_hold_dates"), lDateFrom + " - " + lDateTo));
                }
            }

            return(list);
        }
        private void addSubBtn(XsollaManagerSubscription pSub)
        {
            GameObject objBtn = Instantiate(Resources.Load(mBtnPrefab)) as GameObject;
            SubManagerBtnController controller = objBtn.GetComponent <SubManagerBtnController>();

            controller.init(pSub, mUtils.GetTranslations());
            controller.SetDetailAction(onDetailBtnClick);
            objBtn.transform.SetParent(mSubsContainer.transform);
        }
 public void InitScreen(XsollaUtils pUtils)
 {
     _utiliLink = pUtils;
     // Set titles
     _title.text = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_PAGE_TITLE);
     _coupounNotif.text = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_DESCRIPTION);
     _nameInputField.text = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_CODE_TITLE);
     _inputFieldExample.text = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_CODE_EXAMPLE);
     Text btnText = _btnApply.GetComponentInChildren<Text>();
     btnText.text = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_CONTROL_APPLY);
 }
        public void InitScreen(XsollaUtils pUtils)
        {
            _utiliLink = pUtils;
            // Set titles
            _title.text             = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_PAGE_TITLE);
            _coupounNotif.text      = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_DESCRIPTION);
            _nameInputField.text    = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_CODE_TITLE);
            _inputFieldExample.text = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_CODE_EXAMPLE);
            Text btnText = _btnApply.GetComponentInChildren <Text>();

            btnText.text = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_CONTROL_APPLY);
        }
        public void OpenPricepoints(XsollaUtils utils, XsollaPricepointsManager pricepoints)
        {
            DrawShopScreen ();
            string title = utils.GetTranslations ().Get (XsollaTranslations.PRICEPOINT_PAGE_TITLE);
            string vcName = utils.GetProject ().virtualCurrencyName;
            string buyText = utils.GetTranslations ().Get (XsollaTranslations.VIRTUAL_ITEM_OPTION_BUTTON);

            if (utils.GetSettings().components.virtualCurreny.customAmount)
                _shopViewController.OpenPricepoints(title, pricepoints, vcName, buyText, true, utils);
            else
                _shopViewController.OpenPricepoints(title, pricepoints, vcName, buyText);
        }
        public void OpenPricepoints(string title, XsollaPricepointsManager pricepoints, string virtualCurrencyName, string buyBtnText, bool pCustomHref = false, XsollaUtils pUtils = null)
        {
            Resizer.ResizeToParrent(gameObject);
            menu.transform.parent.parent.gameObject.SetActive(false);
            SetTitle(title);
            // if we have custom amount we need show link object
            if (pCustomHref)
            {
                CustomAmountLink.SetActive(true);
                string customAmountShowTitle = pUtils.GetTranslations().Get(XsollaTranslations.PRICEPOINT_PAGE_CUSTOM_AMOUNT_SHOW_TITLE);
                string customAmountHideTitle = pUtils.GetTranslations().Get(XsollaTranslations.PRICEPOINT_PAGE_CUSTOM_AMOUNT_HIDE_TITLE);

                Text titleCustomAmount = CustomAmountLink.GetComponent <Text>();
                titleCustomAmount.text = customAmountShowTitle;

                Toggle toggle = CustomAmountLink.GetComponent <Toggle>();
                toggle.onValueChanged.AddListener((value) =>
                {
                    if (value)
                    {
                        titleCustomAmount.text = customAmountHideTitle;
                    }
                    else
                    {
                        titleCustomAmount.text = customAmountShowTitle;
                    }

                    CustomAmountScreen.SetActive(value);
                    ShopPanel.SetActive(!value);

                    Logger.Log("Change value toggle " + value.ToString());
                });

                CustomVirtCurrAmountController controller = CustomAmountScreen.GetComponent <CustomVirtCurrAmountController>() as CustomVirtCurrAmountController;
                controller.initScreen(pUtils, pricepoints.GetItemByPosition(1).currency, CalcCustomAmount, TryPayCustomAmount);
            }
            else
            {
                CustomAmountLink.SetActive(false);
            }

            pAdapter.SetManager(pricepoints, virtualCurrencyName, buyBtnText);
            if (pAdapter.OnBuyPricepoints == null)
            {
                pAdapter.OnBuyPricepoints += (outAmount) => {
                    Dictionary <string, object> map = new Dictionary <string, object> (1);
                    map.Add("out", outAmount);
                    OpenPaymentMethods(map, false);
                };
            }
            DrawContent(pAdapter, 3);
        }
        public void OpenPricepoints(XsollaUtils utils, XsollaPricepointsManager pricepoints)
        {
            DrawShopScreen();
            string title   = utils.GetTranslations().Get(XsollaTranslations.PRICEPOINT_PAGE_TITLE);
            string vcName  = utils.GetProject().virtualCurrencyName;
            string buyText = utils.GetTranslations().Get(XsollaTranslations.VIRTUAL_ITEM_OPTION_BUTTON);

            if (utils.GetSettings().components.virtualCurreny.customAmount)
            {
                _shopViewController.OpenPricepoints(title, pricepoints, vcName, buyText, true, utils);
            }
            else
            {
                _shopViewController.OpenPricepoints(title, pricepoints, vcName, buyText);
            }
        }
        public void InitScreen(XsollaUtils utils, XsollaForm form)
        {
            XsollaTranslations translations = utils.GetTranslations();

            Resizer.ResizeToParrent(gameObject);
            bool isPurchaseNull = utils.GetPurchase() == null;

            if (isPurchaseNull || !utils.GetPurchase().IsPurchase() || !utils.GetPurchase().IsPaymentSystem())
            {
                if (!isPurchaseNull)
                {
                    isPrevStepPaymentList = !utils.GetPurchase().IsPaymentSystem();
                }
                paymentForm.OnClickBack += () => {
                    Back();
                };
            }
            paymentForm.InitView(translations, form);
            if (form.GetSummary() != null)
            {
                tower.InitView(translations, form.GetSummary());
            }
            else
            {
                tower.gameObject.SetActive(false);
            }
        }
        public static StyleManager.BaseSprite SetAdBlockItem(XsollaPricepoint pItem, XsollaUtils pUtils, Text pLabel, Image pPanel)
        {
            bool isOffer = (pItem.sum != pItem.sumWithoutDiscount) || (pItem.bonusItems.Count > 0);

            String lDisplaLabel;

            if (isOffer)
            {
                lDisplaLabel = pItem.offerLabel != "" ? pItem.offerLabel : pUtils.GetTranslations().Get("option_offer_desktop");
            }
            else
            {
                lDisplaLabel = pItem.label;
            }

            if (!isOffer && pItem.advertisementType != AXsollaShopItem.AdType.NONE)
            {
                switch (pItem.advertisementType)
                {
                case AXsollaShopItem.AdType.BEST_DEAL:
                {
                    pLabel.text    = pItem.label;
                    pPanel.enabled = true;
                    pPanel.sprite  = StyleManager.Instance.GetSprite(StyleManager.BaseSprite.bckg_bd_panel);
                    return(StyleManager.BaseSprite.bckg_item_bd);
                }

                case AXsollaShopItem.AdType.RECCOMENDED:
                {
                    pLabel.text    = pItem.label;
                    pPanel.enabled = true;
                    pPanel.sprite  = StyleManager.Instance.GetSprite(StyleManager.BaseSprite.bckg_ad_panel);
                    return(StyleManager.BaseSprite.bckg_item_ad);
                }

                case AXsollaShopItem.AdType.SPECIAL_OFFER:
                {
                    pLabel.text    = pItem.label;
                    pPanel.enabled = true;
                    pPanel.sprite  = StyleManager.Instance.GetSprite(StyleManager.BaseSprite.bckg_sales_panel);
                    return(StyleManager.BaseSprite.bckg_item_sales);
                }

                case AXsollaShopItem.AdType.CUSTOM:
                {
                    pLabel.text    = pItem.label;
                    pPanel.enabled = true;
                    pPanel.sprite  = StyleManager.Instance.GetSprite(StyleManager.BaseSprite.bckg_sales_panel);
                    return(StyleManager.BaseSprite.bckg_item_sales);
                }

                default:
                {
                    return(StyleManager.BaseSprite.bckg_item);
                }
                }
            }
            return(StyleManager.BaseSprite.bckg_item);
        }
Exemple #18
0
 public void InitScreen(XsollaUtils utils)
 {
     utilsLink       = utils;
     titleText.text  = utils.GetTranslations().Get(XsollaTranslations.PAYMENT_METHODS_PAGE_TITLE);
     startCountryIso = utils.GetUser().GetCountryIso();
     savedPayController.InitScreen(utilsLink);
     quickController.InitScreen(utilsLink);
     allController.InitScreen(utilsLink);
 }
        public void init(XsollaManagerSubDetails pSubDetail, XsollaUtils pUtils)
        {
            mTitle.text = pUtils.GetTranslations().Get("user_hold_subscription_title");

            if (pSubDetail.mStatus != "non_renewing")
            {
                mDontRenewLabel.text = pUtils.GetTranslations().Get("hold_subscription_dont_renew_label");
                mDontRenewDesc.text  = pUtils.GetTranslations().Get("hold_subscription_dont_renew_label_description");
            }
            else
            {
                mDontRenew.gameObject.SetActive(false);
                mDontRenewDesc.gameObject.SetActive(false);
            }

            mDeleteNowLabel.text = pUtils.GetTranslations().Get("hold_subscription_cancel_label");
            mDeleteNowDesc.text  = pUtils.GetTranslations().Get("hold_subscription_cancel_label_description");
        }
Exemple #20
0
        /// <summary>
        /// Init the specified pUtils.
        /// </summary>
        /// <param name="pUtils">P utils.</param>
        public void Init(XsollaUtils pUtils)
        {
            mUtils           = pUtils;
            mList            = new List <HistoryElemController>();
            mTitle.text      = mUtils.GetTranslations().Get("balance_history_page_title");
            mEmptyItems.text = mUtils.GetTranslations().Get("balance_history_no_data");
            mBtnContinue.GetComponent <Text>().text = mUtils.GetTranslations().Get("balance_back_button");
            mBtnContinue.GetComponent <Button>().onClick.AddListener(delegate
            {
                Destroy();
            });

            // Добавляем заголовок
            AddHeader();

            // Делаем запрос на лист
            GetRequestList();
        }
Exemple #21
0
        private void AddSubs(XsollaSubscription pSub)
        {
            GameObject subObj = Instantiate(Resources.Load(PREFAB_SPEC_SUBS)) as GameObject;

            subObj.transform.SetParent(_listSubsView.transform);
            Resizer.SetDefScale(subObj);
            SubscriptionBtnController controller = subObj.GetComponent <SubscriptionBtnController>();

            controller.InitBtn(pSub, mUtils.GetTranslations());
        }
Exemple #22
0
        public void initScreen(XsollaUtils pUtils, string pCustomCurrency, Action <Dictionary <string, object> > pActionCalc, Action <float> pTryPay)
        {
            if (pUtils.GetProject().isDiscrete)
            {
                virtCurrAmount.contentType = InputField.ContentType.IntegerNumber;
            }
            else
            {
                virtCurrAmount.contentType = InputField.ContentType.DecimalNumber;
            }

            // Set btn Name
            btnPay.gameObject.GetComponentInChildren <Text>().text = pUtils.GetTranslations().Get("form_continue");
            mTotalTitle     = pUtils.GetTranslations().Get("payment_summary_total");
            mCustomCurrency = pCustomCurrency;
            ImageLoader imageLoader = FindObjectOfType <ImageLoader>();

            Logger.Log("VirtIcon " + pUtils.GetProject().virtualCurrencyIconUrl);
            imageLoader.LoadImage(iconVirtCurr, "http:" + pUtils.GetProject().virtualCurrencyIconUrl);

            virtCurrAmount.onEndEdit.AddListener(delegate
            {
                if (!mSetValues)
                {
                    pActionCalc(GetParamsForCalc(true));
                }
            });

            realCurrAmount.onEndEdit.AddListener(delegate
            {
                if (!mSetValues)
                {
                    pActionCalc(GetParamsForCalc(false));
                }
            });

            btnPay.onClick.AddListener(delegate
            {
                pTryPay(GetOutAmount());
            });
        }
Exemple #23
0
        private void GoodsGroupRecived(JSONNode pNode)
        {
            // получили список групп товаров.
            XsollaGroupsManager lGoodsGroups = new XsollaGroupsManager().Parse(pNode["groups"]) as XsollaGroupsManager;

            // Строим меню
            mGoodsGroupController = this.gameObject.GetComponentInChildren <GoodsGroupMenuController>();
            if (mUtils.mBonus.mHasSales)
            {
                XsollaGoodsGroup salesGroup = new XsollaGoodsGroup();
                salesGroup.id        = -1;
                salesGroup.mChildren = new XsollaGroupsManager();
                salesGroup.name      = "%" + " " + mUtils.GetTranslations().Get("sales_page_title");
                lGoodsGroups.InsertItem(0, salesGroup);
            }

            mGoodsGroupController.init(lGoodsGroups, SelectGoodsGroup);
            // Выделяем первый активный элемент
            mGoodsGroupController.clickFirstActiveItem();
            //mGoodsGroupController.clickItem(0);
        }
        public void InitScreen(XsollaUtils pUtils)
        {
            _utiliLink = pUtils;
            // Set titles
            _title.text                  = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_PAGE_TITLE);
            _coupounNotif.text           = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_DESCRIPTION);
            _nameInputField.text         = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_CODE_TITLE);
            _inputFieldExample.text      = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_CODE_EXAMPLE);
            _inputField.onValidateInput += delegate(string input, int charIndex, char addedChar)
            {
                return(MyValidate(addedChar));
            };

            _inputField.onEndEdit.AddListener(delegate
            {
                setAproveInput();
            });

            Text btnText = _btnApply.GetComponentInChildren <Text>();

            btnText.text = _utiliLink.GetTranslations().Get(XsollaTranslations.COUPON_CONTROL_APPLY);
        }
Exemple #25
0
        public void initWaitScreen(XsollaUtils pUtils, Action pAddPaymentMethod)
        {
            mUtilsLink        = pUtils;
            _addPaymentMethod = pAddPaymentMethod;
            mWaitChangeScreen.SetActive(true);
            mProgressBar.SetLoading(true);
            _MethodsOnWaitLoop = null;

            // Start wait change loop
            InvokeRepeating("StartGetSavedMethodLoop", 0f, 5f);
            mCancelWaitBtn.GetComponent <Button>().onClick.AddListener(() => CancelWait());
            mCanceltext.text = pUtils.GetTranslations().Get("cancel");
        }
 private void InitFooter(XsollaUtils utils)
 {
     if (utils != null)
     {
         Text[]             texts         = mainScreen.GetComponentsInChildren <Text> ();
         XsollaTranslations translatrions = utils.GetTranslations();
         texts [4].text = translatrions.Get(XsollaTranslations.SUPPORT_CUSTOMER_SUPPORT);
         texts [5].text = translatrions.Get(XsollaTranslations.SUPPORT_CONTACT_US);
         texts [6].text = translatrions.Get(XsollaTranslations.XSOLLA_COPYRIGHT);
         texts [7].text = translatrions.Get(XsollaTranslations.FOOTER_SECURED_CONNECTION);
         texts [8].text = translatrions.Get(XsollaTranslations.FOOTER_AGREEMENT);
     }
 }
Exemple #27
0
        public void init(XsollaManagerSubDetails pSubDetail, XsollaUtils pUtils)
        {
            mUtils       = pUtils;
            mSubDetail   = pSubDetail;
            mListCharges = new List <GameObject>();

            mPartTitle.text = mUtils.GetTranslations().Get("user_subscription_charges_title");

            String lDateTitle        = mUtils.GetTranslations().Get("virtualstatus_check_time");
            String lPaymenyTypeTitle = mUtils.GetTranslations().Get("user_subscription_payment_header");
            String lAmountTitle      = mUtils.GetTranslations().Get("user_subscription_payment");

            // добавляем заголовки
            addChargeElem(lDateTitle, lPaymenyTypeTitle, lAmountTitle, true);

            mSubDetail.mCharges.Sort(delegate(XsollaSubDetailCharge charge1, XsollaSubDetailCharge charge2)
            {
                if (charge1.mDateCreate < charge2.mDateCreate)
                {
                    return(1);
                }
                else
                {
                    return(-1);
                }
            });

            mMorePanel.SetActive(mSubDetail.mCharges.Count > 4);
            mShowMoreBtn.onClick.AddListener(OnMoreBtnAction);

            // добавляем историю
            foreach (XsollaSubDetailCharge charge in mSubDetail.mCharges)
            {
                mListCharges.Add(addChargeElem(StringHelper.DateFormat(charge.mDateCreate), charge.mPaymentMethod, charge.mCharge.ToString()));
            }

            ShowList(mShowState);
        }
        public void initScreen(XsollaUtils pUtils, XsollaManagerSubscriptions pSubsList)
        {
            mUtils             = pUtils;
            mTitleScreen.text  = mUtils.GetTranslations().Get("user_menu_user_subscription");
            mContinueText.text = mUtils.GetTranslations().Get("balance_back_button");
            mLabel.gameObject.SetActive(true);
            mLabel.text = mUtils.GetTranslations().Get("user_subscription_list_subtitle");

            var children = new List <GameObject>();

            foreach (Transform child in mSubsContainer.transform)
            {
                if (child.gameObject != mLabel.gameObject)
                {
                    children.Add(child.gameObject);
                }
            }
            children.ForEach(child => Destroy(child));

            setNotifyPanels();

            // событие на кнопку возврата
            mContinueLink.onClick.RemoveAllListeners();
            mContinueLink.onClick.AddListener(OnClickBackShopAction);

            if (pSubsList.GetCount() == 0)
            {
                Logger.Log("Empty List subs");
                mLabel.text      = mUtils.GetTranslations().Get("subscription_no_data");
                mLabel.alignment = TextAnchor.MiddleCenter;
            }

            foreach (XsollaManagerSubscription sub in pSubsList.GetItemsList())
            {
                addSubBtn(sub);
            }
        }
Exemple #29
0
 private void ShowList(bool pMore)
 {
     if (pMore)
     {
         mListCharges.ForEach((obj) => { obj.SetActive(true); });
     }
     else
     {
         if (mListCharges.Count > 4)
         {
             mListCharges.GetRange(3, mListCharges.Count - 3).ForEach((obj) => { obj.SetActive(false); });
         }
     }
     mShowMoreLabel.text = mUtils.GetTranslations().Get(pMore?"user_subscription_expand_link_expanded":"user_subscription_expand_link");
     mShowState          = pMore;
 }
Exemple #30
0
        public List <LabelValue> getImportDetails()
        {
            List <LabelValue>  list        = new List <LabelValue>();
            XsollaTranslations translation = mUtils.GetTranslations();

            // ПОЛЯ ДЕТАЛИЗАЦИИ
            // имя
            if (mSubDetail.mPaymentMethodName != "null")
            {
                list.Add(new LabelValue(translation.Get("user_subscription_payment_method"), mSubDetail.mPaymentMethodName + " (" + mSubDetail.mPaymentMethodVisName + ")"));
            }
            // сумма след списание
            list.Add(new LabelValue(translation.Get("user_subscription_next_bill_sum"), mSubDetail.mNextCharge.ToString()));
            // дата след списание
            list.Add(new LabelValue(translation.Get("user_subscription_next_bill_date"), StringHelper.DateFormat(mSubDetail.mDateNextCharge)));
            return(list);
        }
 public void InitScreen(XsollaUtils utils, XsollaForm form)
 {
     XsollaTranslations translations = utils.GetTranslations ();
     Resizer.ResizeToParrent (gameObject);
     bool isPurchaseNull = utils.GetPurchase () == null;
     if (isPurchaseNull || !utils.GetPurchase ().IsPurchase () || !utils.GetPurchase ().IsPaymentSystem ()) {
         if(!isPurchaseNull)
             isPrevStepPaymentList = !utils.GetPurchase ().IsPaymentSystem ();
         paymentForm.OnClickBack += () => {
             Back ();};
     }
     paymentForm.InitView (translations, form);
     if (form.GetSummary () != null)
         tower.InitView (translations, form.GetSummary ());
     else
         tower.gameObject.SetActive (false);
 }
        //  новая инициализация
        public void init(XsollaUtils pUtils, XsollaPricepoint pDefPackage)
        {
            mUtils = pUtils;
            if (pUtils.GetProject().isDiscrete)
            {
                virtCurrAmount.contentType = InputField.ContentType.IntegerNumber;
            }
            else
            {
                virtCurrAmount.contentType = InputField.ContentType.DecimalNumber;
            }

            btnPay.gameObject.GetComponentInChildren <Text>().text = pUtils.GetTranslations().Get("form_continue");
            FindObjectOfType <ImageLoader>().LoadImage(iconVirtCurr, pUtils.GetProject().virtualCurrencyIconUrl);

            // Задаем дефолтное значение для обсчета
            totalAmountTitle.text = mUtils.GetTranslations().Get("form_subtotal");
            virtCurrAmount.text   = pDefPackage.outAmount.ToString();
            realCurrAmount.text   = pDefPackage.sum.ToString();
            mTotalAmount.text     = CurrencyFormatter.Instance.FormatPrice(pDefPackage.currency, pDefPackage.sum);;

            virtCurrAmount.onValueChanged.AddListener(delegate
            {
                if (!mSetValues)
                {
                    CancelInvoke();
                    Invoke("RecalcVcAmount", 1);
                }
            });
            virtCurrAmount.onEndEdit.AddListener(delegate { mErrorPanel.gameObject.SetActive(false); });
            realCurrAmount.onValueChanged.AddListener(delegate
            {
                if (!mSetValues)
                {
                    CancelInvoke();
                    Invoke("RecalcAmount", 1);
                }
            });
            realCurrAmount.onEndEdit.AddListener(delegate { mErrorPanel.gameObject.SetActive(false); });

            btnPay.onClick.AddListener(delegate
            {
                BuyBtn();
            });
        }
Exemple #33
0
        private void StartPayment(Dictionary <string, object> dict, bool isSandbox)
        {
            Logger.Log("Request prepared");
            currentPurchase.Add(ActivePurchase.Part.TOKEN, dict);
            IsSandbox = isSandbox;
            if (isSimple)
            {
                CheckUnfinished();
            }
            Payment.UtilsRecieved += RecieveUtils;

            Payment.FormReceived   += (form) => ShowPaymentForm(Utils, form);
            Payment.StatusReceived += (status, form) => {
                //TODO make better solution
                FillPurchase(ActivePurchase.Part.XPS, form.GetXpsMap());
                ShowPaymentStatus(Utils.GetTranslations(), status);
            };
            Payment.ApplyCouponeCodeReceived += (form) => ApplyPromoCouponeCode(form);
            Payment.StatusChecked            += (status) => WaitingStatus(status);

            Payment.QuickPaymentMethodsRecieved += (quickpayments) => ShowQuickPaymentsList(Utils, quickpayments);
            Payment.PaymentMethodsRecieved      += ShowPaymentsList;
            Payment.SavedPaymentMethodsRecieved += ShowSavedPaymentsList;
            Payment.CountriesRecieved           += ShowCountries;

            Payment.PricepointsRecieved += (pricepoints) => ShowPricepoints(Utils, pricepoints);
            Payment.GoodsGroupsRecieved += (goods) => ShowGoodsGroups(goods);
            Payment.GoodsRecieved       += (goods) => UpdateGoods(goods);

            Payment.CustomAmountCalcRecieved += (calcRes) => UpdateCustomAmount(calcRes);

            Payment.VirtualPaymentSummaryRecieved += (summary) => ShowVPSummary(Utils, summary);
            Payment.VirtualPaymentProceedError    += (error) => ShowVPError(Utils, error);
            Payment.VirtualPaymentStatusRecieved  += (status) => ShowVPStatus(Utils, status);

            Payment.CouponProceedErrorRecived       += (proceed) => GetCouponErrorProceed(proceed);
            Payment.PaymentManagerMethods           += (savedMethods, addState) => PaymentManagerRecieved(savedMethods, addState);
            Payment.DeleteSavedPaymentMethodRespond += () => DeleteSavedPaymentMethodRecieved();
            Payment.WaitChangeSavedMethods          += () => WaitChangeSavedMethod();
            Payment.SubsManagerListRecived          += (SubsList) => SubsManagerListRecived(SubsList);

            Payment.ErrorReceived += ShowPaymentError;
            Payment.SetModeSandbox(isSandbox);
            Payment.InitPaystation(currentPurchase.GetMergedMap());
        }
Exemple #34
0
        public void Init(XsollaUtils pUtils)
        {
            if (pUtils != null)
            {
                XsollaTranslations lTranslatrions = pUtils.GetTranslations();
                mCustomerSupport.text   = lTranslatrions.Get(XsollaTranslations.SUPPORT_CUSTOMER_SUPPORT);
                mContactUs.text         = lTranslatrions.Get(XsollaTranslations.SUPPORT_CONTACT_US);
                mCopyRight.text         = lTranslatrions.Get(XsollaTranslations.XSOLLA_COPYRIGHT);
                mSecuredConnection.text = lTranslatrions.Get(XsollaTranslations.FOOTER_SECURED_CONNECTION);

                mAgreement.text = pUtils.GetProject().eula != "null" ? pUtils.GetProject().eula : lTranslatrions.Get(XsollaTranslations.FOOTER_AGREEMENT);

                mAgreement.gameObject.GetComponent <Button>().onClick.AddListener(delegate
                {
                    new OpenUrlHelper().OpenUrl(pUtils.GetProject().eulaUrl != "null" ? pUtils.GetProject().eulaUrl : mUrl);
                });
            }
        }
 public void DrawScreen(XsollaUtils utils, XVirtualPaymentSummary summary)
 {
     ResizeToParent();
     Title.text        = utils.GetTranslations().Get("cart_page_title");
     Confirmation.text = utils.GetTranslations().Get("cart_confirm_your_purchase");
     ImageLoader.UploadImageToCurrentView(summary.Items [0].GetImage());
     ItemName.text          = summary.Items [0].Name;
     BackTo.text            = "< " + utils.GetTranslations().Get("back_to_virtualitem");
     ToggleText.text        = utils.GetTranslations().Get("cart_dont_ask_again");
     Total.text             = utils.GetTranslations().Get("total") + " " + summary.Total + " " + utils.GetProject().virtualCurrencyName;
     ProceedButtonText.text = utils.GetTranslations().Get("cart_submit");
     ProceedButton.onClick.AddListener(() => OnClickProceed());
 }
 public void InitScreen(XsollaUtils utils)
 {
     utilsLink = utils;
     showMore.GetComponent<Text>().text = utilsLink.GetTranslations().Get(XsollaTranslations.PAYMENT_LIST_SHOW_MORE);
     back.GetComponent<Text>().text = utilsLink.GetTranslations().Get(XsollaTranslations.BACK_TO_SPECIALS);
 }
 public void InitScreen(XsollaUtils pUtils)
 {
     utilsLink = pUtils;
     back.GetComponent<Text>().text = utilsLink.GetTranslations().Get(XsollaTranslations.BACK_TO_LIST);
 }
 private void InitFooter(XsollaUtils utils)
 {
     if (utils != null) {
         Text[] texts = mainScreen.GetComponentsInChildren<Text> ();
         XsollaTranslations translatrions = utils.GetTranslations ();
         texts [4].text = translatrions.Get (XsollaTranslations.SUPPORT_CUSTOMER_SUPPORT);
         texts [5].text = translatrions.Get (XsollaTranslations.SUPPORT_CONTACT_US);
         texts [6].text = translatrions.Get (XsollaTranslations.XSOLLA_COPYRIGHT);
         texts [7].text = translatrions.Get (XsollaTranslations.FOOTER_SECURED_CONNECTION);
         texts [8].text = translatrions.Get (XsollaTranslations.FOOTER_AGREEMENT);
     }
 }
        //TODO minimize
        private void InitMenu(XsollaUtils utils)
        {
            _radioController = menuTransform.gameObject.AddComponent<RadioGroupController> ();
            GameObject menuItemPrefab 		= Resources.Load (PREFAB_VIEW_MENU_ITEM) as GameObject;
            GameObject menuItemIconPrefab 	= Resources.Load (PREFAB_VIEW_MENU_ITEM_ICON) as GameObject;
            GameObject menuItemEmptyPrefab 	= Resources.Load (PREFAB_VIEW_MENU_ITEM_EMPTY) as GameObject;
            //			menuTransform = mainScreen.GetComponentInChildren<HorizontalLayoutGroup> ().gameObject.transform;
            Dictionary<string, XComponent> components = utils.GetProject().components;
            XsollaPaystation2 paystation2 			  = utils.GetSettings ().paystation2;
            bool isGoodsRequred = components.ContainsKey("items") && components ["items"].IsEnabled;
            if(isGoodsRequred)
            {
                GameObject menuItemGoods = Instantiate(menuItemPrefab) as GameObject;
                Text[] texts = menuItemGoods.GetComponentsInChildren<Text>();
                texts[0].text = "";
                texts[1].text = utils.GetTranslations().Get(XsollaTranslations.VIRTUALITEM_PAGE_TITLE);
                menuItemGoods.GetComponent<Button>().onClick.AddListener(delegate {
                    LoadGoodsGroups();
                    _radioController.SelectItem(0);
                });
                menuItemGoods.transform.SetParent(menuTransform);
                _radioController.AddButton(menuItemGoods.GetComponent<RadioButton>());
            }
            //HACK with Unity 5.3
            //bool isPricepointsRequired = components.ContainsKey("virtual_currency") && components ["virtual_currency"].IsEnabled;
            if (paystation2.pricepointsAtFirst != null && paystation2.pricepointsAtFirst.Equals("1"))
            {
                GameObject menuItemPricepoints = Instantiate(menuItemPrefab) as GameObject;
                Text[] texts = menuItemPricepoints.GetComponentsInChildren<Text>();
                texts[0].text = "";
                texts[1].text = utils.GetTranslations().Get(XsollaTranslations.PRICEPOINT_PAGE_TITLE);
                menuItemPricepoints.GetComponent<Button>().onClick.AddListener(delegate {
                    LoadShopPricepoints();
                    _radioController.SelectItem(1);
                });
                menuItemPricepoints.transform.SetParent(menuTransform);
                _radioController.AddButton(menuItemPricepoints.GetComponent<RadioButton>());
            }

            if (components.ContainsKey("coupons") && components["coupons"].IsEnabled)
            {
                GameObject menuItemCoupons = Instantiate(menuItemPrefab) as GameObject;
                Text[] texts = menuItemCoupons.GetComponentsInChildren<Text>();
                texts[0].text = "";
                texts[1].text = utils.GetTranslations().Get(XsollaTranslations.COUPON_PAGE_TITLE);
                menuItemCoupons.GetComponent<Button>().onClick.AddListener(delegate {
                    ShowRedeemCoupon();
                    _radioController.SelectItem(2);
                });
                menuItemCoupons.transform.SetParent(menuTransform);
                _radioController.AddButton(menuItemCoupons.GetComponent<RadioButton>());
            }

            GameObject menuItemEmpty = Instantiate (menuItemEmptyPrefab);
            menuItemEmpty.transform.SetParent (menuTransform);

            GameObject menuItemFavorite = Instantiate (menuItemIconPrefab);
            menuItemFavorite.GetComponentInChildren<Text> ().text = "";
            menuItemFavorite.GetComponent<Button>().onClick.AddListener(delegate {
                _shopViewController.SetTitle(utils.GetTranslations().Get(XsollaTranslations.VIRTUALITEMS_TITLE_FAVORITE));
                LoadFavorites();
                _radioController.SelectItem(3);
            });
            menuItemFavorite.transform.SetParent (menuTransform);
            _radioController.AddButton(menuItemFavorite.GetComponent<RadioButton>());
        }
        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);
        }