Exemple #1
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);
        }
Exemple #2
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);
        }
Exemple #3
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 init(XsollaManagerSubscription pSub, XsollaTranslations pTranslation)
        {
            mSub          = pSub;
            mSubName.text = mSub.GetName();
            String nextChargeFormat = pTranslation.Get("next_charge");             // next_charge:"Next invoice: {{amount}}, {{date}}↵"

            int indx = 0;

            while (nextChargeFormat.Contains("{{"))
            {
                String replacedPart = nextChargeFormat.Substring(nextChargeFormat.IndexOf("{{", 0) + 1, nextChargeFormat.IndexOf("}}", 0) - nextChargeFormat.IndexOf("{{", 0));
                nextChargeFormat = nextChargeFormat.Replace(replacedPart, indx.ToString());
                indx++;
            }

            if (pSub.mStatus == "active")
            {
                mNextInvoice.text = String.Format(nextChargeFormat, mSub.mCharge.ToString(), StringHelper.DateFormat(pSub.mDateNextCharge));
            }
            else
            {
                mNextInvoice.gameObject.SetActive(false);
            }

            if (pSub.mPaymentMethod != "null")
            {
                mPaymentMethodName.text = pSub.mPaymentMethod + " " + pSub.mPaymentVisibleName;
            }
            else
            {
                switch (pSub.mStatus)
                {
                case "freeze":
                {
                    mPaymentMethodName.text = String.Format(StringHelper.PrepareFormatString(pTranslation.Get("user_subscription_hold_to")), StringHelper.DateFormat(pSub.mHoldDates.dateTo));
                    break;
                }

                case "non_renewing":
                {
                    mPaymentMethodName.text = String.Format(StringHelper.PrepareFormatString(pTranslation.Get("user_subscription_non_renewing")), StringHelper.DateFormat(pSub.mDateNextCharge));
                    break;
                }

                default:
                {
                    mPaymentMethodName.gameObject.SetActive(false);
                    break;
                }
                }
            }

            mDetailText.text = pTranslation.Get("user_subscription_to_details");
        }
 private void callbackDontrenewMethod(JSONNode pNode)
 {
     if (pNode["status"].Value == "saved")
     {
         // перестроить детализацию и показать что подписка не будет продлеваться
         ShowLocalSubDetail();
         // показать статус
         showStatus(String.Format(StringHelper.PrepareFormatString(mUtils.GetTranslations().Get("user_subscription_message_non_renewing")), StringHelper.DateFormat(mLocalSubDetail.mDateNextCharge)));
     }
 }