public List <Reward> GetRewards(RemotePromotion promotion)
        {
            RewardParams parsedCustomParams = promotion.ParsedCustomParams as RewardParams;

            if (parsedCustomParams == null)
            {
                return(null);
            }
            List <Reward> list = new List <Reward>();

            foreach (ProductReward reward in parsedCustomParams.Rewards)
            {
                Reward rewardFromProductReward = ConfigShops.GetRewardFromProductReward(reward, null);
                list.Add(rewardFromProductReward);
            }
            return(list);
        }
        protected override void onPreShow([Optional, DefaultParameterValue(null)] object param)
        {
            this.m_inputParameters = (InputParameters)param;
            if (!string.IsNullOrEmpty(this.m_inputParameters.Headline))
            {
                this.PopupTitle.text = StringExtensions.ToUpperLoca(this.m_inputParameters.Headline);
            }
            else
            {
                this.PopupTitle.enabled = false;
            }
            if (!string.IsNullOrEmpty(this.m_inputParameters.Title))
            {
                this.DividerTitle.text = StringExtensions.ToUpperLoca(this.m_inputParameters.Title);
            }
            else
            {
                this.DividerTitle.enabled = false;
            }
            if (!string.IsNullOrEmpty(this.m_inputParameters.Message))
            {
                this.DescriptionText.enabled = true;
                this.DescriptionText.text    = this.m_inputParameters.Message;
            }
            else
            {
                this.DescriptionText.enabled = false;
            }
            if (this.m_inputParameters.DisposableBackgroundTexture != null)
            {
                this.RawBg.enabled = true;
                this.RawBg.texture = this.m_inputParameters.DisposableBackgroundTexture;
                float num     = ((float)this.m_inputParameters.DisposableBackgroundTexture.width) / ((float)this.m_inputParameters.DisposableBackgroundTexture.height);
                float newSize = Mathf.Clamp((float)(this.m_defaultWidth / num), (float)200f, (float)1880f);
                RectTransformExtensions.SetHeight(base.RectTm, newSize);
            }
            else
            {
                this.RawBg.enabled = false;
                RectTransformExtensions.SetHeight(base.RectTm, this.m_defaultHeight);
            }
            string flareProductIdForPromoSlot = Service.Binder.PromotionManager.GetFlareProductIdForPromoSlot(this.m_inputParameters.Slot);

            if (!string.IsNullOrEmpty(flareProductIdForPromoSlot))
            {
                ShopEntry shopEntryByFlareProductId = Service.Binder.ShopManager.GetShopEntryByFlareProductId(flareProductIdForPromoSlot);
                if (shopEntryByFlareProductId != null)
                {
                    this.m_purchaseController    = new ShopPurchaseController(shopEntryByFlareProductId, null, PathToShopType.Vendor, null, new Action <ShopEntry, PurchaseResult>(this.onPurchaseComplete));
                    this.PurchaseButtonText.text = this.m_purchaseController.getPriceText(1);
                    if (this.m_inputParameters.DisposableBackgroundTexture == null)
                    {
                        base.RewardsGrid.gameObject.SetActive(true);
                        List <Reward>  rewards = new List <Reward>();
                        PremiumProduct prod    = Service.Binder.ShopService.GetProduct(flareProductIdForPromoSlot);
                        foreach (ProductReward reward in ConfigShops.GetRewardsFromProduct(prod))
                        {
                            rewards.Add(ConfigShops.GetRewardFromProductReward(reward, prod));
                        }
                        base.InitRewardGrid(rewards);
                    }
                    else
                    {
                        base.RewardsGrid.gameObject.SetActive(false);
                    }
                }
            }
        }