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 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 onDetailBtnClick(XsollaManagerSubscription pSub)
 {
     Logger.Log("On Detail click. Id: " + pSub.GetKey());
     GetDetailSub(pSub.GetId());
 }