コード例 #1
0
        public IParseble Parse(SimpleJSON.JSONNode rootNode)
        {
            mApi = new XsollaApi().Parse(rootNode["api"]) as XsollaApi;

            mCharges = new List <XsollaSubDetailCharge>();
            var listCharges = rootNode["charges"].Childs.GetEnumerator();

            while (listCharges.MoveNext())
            {
                mCharges.Add(new XsollaSubDetailCharge().Parse(listCharges.Current) as XsollaSubDetailCharge);
            }

            JSONNode subsNode = rootNode["subscription"];

            mCharge               = new XsollaSubCharge().Parse(subsNode["charge"]) as XsollaSubCharge;
            mDateCreate           = DateTime.Parse(subsNode["date_create"].Value);
            mDateNextCharge       = DateTime.Parse(subsNode["date_next_charge"].Value);
            mDesc                 = subsNode["description"].Value;
            mHoldDates            = new XsollaSubHoldDates().Parse(subsNode["hold_dates"]) as XsollaSubHoldDates;
            mId                   = subsNode["id"].AsInt;
            mIdExternal           = subsNode["id_external"].Value;
            mIsCancelPossible     = subsNode["is_cancel_possible"].AsBool;
            mIsChangePlanAllowed  = subsNode["is_change_plan_allowed"].AsBool;
            mIsHoldPossible       = subsNode["is_hold_possible"].AsBool;
            mIsRenewPossible      = subsNode["is_renew_possible"].AsBool;
            mIsSheduledHoldExist  = subsNode["is_scheduled_hold_exist"].AsBool;
            mLimitHoldPeriod      = new XsollaSubLimitHoldPeriod().Parse(subsNode["limit_hold_period"]) as XsollaSubLimitHoldPeriod;
            mName                 = subsNode["name"].Value;
            mNextCharge           = new XsollaSubCharge().Parse(subsNode["next_charge"]) as XsollaSubCharge;
            mNextPeriodPlanChange = new XsollaSubNextPeriodPlanChange().Parse(subsNode["next_period_plan_change"]) as XsollaSubNextPeriodPlanChange;
            mPaymentAccount       = new XsollaSubDetailPaymentAcc().Parse(subsNode["payment_account"]) as XsollaSubDetailPaymentAcc;
            mPaymentIcoSrc        = subsNode["payment_icon_src"].Value;
            mPaymentMethodName    = subsNode["payment_method"].Value;
            mPaymentMethodType    = subsNode["payment_type"].Value;
            mPaymentMethodVisName = subsNode["payment_visible_name"].Value;
            mPeriod               = new XsollaSubDetailPeriod().Parse(subsNode["period"]) as XsollaSubDetailPeriod;
            mSheduledHoldDates    = new XsollaSubHoldDates().Parse(subsNode["scheduled_hold_dates"]) as XsollaSubHoldDates;
            mStatus               = subsNode["status"].Value;

            return(this);
        }
コード例 #2
0
        public String mStatus;                //		status:"active"

        public IParseble Parse(SimpleJSON.JSONNode rootNode)
        {
            mCharge = new XsollaSubCharge().Parse(rootNode["charge"]) as XsollaSubCharge;
            if (rootNode["date_next_charge"].Value != "")
            {
                mDateNextCharge = DateTime.Parse(rootNode["date_next_charge"].Value);
            }

            mDesc               = rootNode["description"];
            mHoldDates          = new XsollaSubHoldDates().Parse(rootNode["hold_dates"]) as XsollaSubHoldDates;
            mId                 = rootNode["id"].AsInt;
            mIdExternal         = rootNode["id_external"];
            mName               = rootNode["name"];
            mPaymentMethod      = rootNode["payment_method"];
            mPaymentType        = rootNode["payment_type"];
            mPaymentVisibleName = rootNode["payment_visible_name"];
            mPeriod             = new XsollaSubPeriod().Parse(rootNode["period"]) as XsollaSubPeriod;
            mValue              = rootNode["value"].AsInt;
            mStatus             = rootNode["status"];

            return(this);
        }