public IParseble Parse(JSONNode pricepointNode)
        {
            outAmount          = pricepointNode["out"].AsFloat;
            outWithoutDiscount = pricepointNode["outWithoutDiscount"].AsFloat;
            bonusOut           = pricepointNode["bonusOut"].AsFloat;
            sum = pricepointNode["sum"].AsFloat;
            sumWithoutDiscount = pricepointNode["sumWithoutDiscount"].AsFloat;
            currency           = pricepointNode["currency"].Value;
            image      = pricepointNode["image"].Value;
            desc       = pricepointNode["description"].Value;
            bonusItems = XsollaBonusItem.ParseMany(pricepointNode ["bonusItems"]);
            label      = pricepointNode["label"].Value;
            offerLabel = pricepointNode["offerLabel"].Value;
            selected   = pricepointNode["selected"].AsBool;

            string advertisementTypeString = pricepointNode ["advertisementType"].Value;

            advertisementType = AdType.NONE;
            if (sum != sumWithoutDiscount || outAmount != outWithoutDiscount || bonusItems.Count > 0 || bonusOut > 0)
            {
                advertisementType = AdType.SPECIAL_OFFER;
            }
            else
            {
                if ("best_deal".Equals(advertisementTypeString))
                {
                    advertisementType = AdType.BEST_DEAL;
                }
                else if ("recommended".Equals(advertisementTypeString))
                {
                    advertisementType = AdType.RECCOMENDED;
                }
            }
            return(this);
        }
        public IParseble Parse(JSONNode shopItemNode)
        {
            id                      = shopItemNode ["id"].AsInt;
            sku                     = shopItemNode ["sku"].Value;
            name                    = shopItemNode ["name"].Value;
            description             = shopItemNode ["description"].Value;
            descriptionLong         = shopItemNode ["long_description"].Value;
            imageUrl                = shopItemNode ["image_url"].Value;                            //image_url <- NEW | OLD -> image
            amount                  = shopItemNode ["amount"].AsDecimal;
            amountWithoutDiscount   = shopItemNode ["amount_without_discount"].AsDecimal;          //amount_without_discount <- NEW | OLD -> amountWithoutDiscount
            vcAmount                = shopItemNode ["vc_amount"].AsDecimal;
            vcAmountWithoutDiscount = shopItemNode ["vc_amount_without_discount"].AsDecimal;       //amount_without_discount <- NEW | OLD -> amountWithoutDiscount
            currency                = shopItemNode ["currency"].Value;
            quantityLimit           = shopItemNode ["quantity_limit"].AsInt;
            bonusVirtualItems       = XsollaBonusItem.ParseMany(shopItemNode ["bonus_virtual_items"]);
            var bvc = new XsollaBonusItem();

            bvc.Parse(shopItemNode ["bonus_virtual_currency"]);
            bonusVirtualCurrency = bvc;
            label      = shopItemNode ["label"].Value;
            isFavorite = shopItemNode ["is_favorite"].AsInt;

            offerLabel = shopItemNode ["offer_label"].Value;
            string advertisementTypeString = shopItemNode ["advertisement_type"].Value;

            advertisementType = AdType.NONE;
            if (amount != amountWithoutDiscount || bonusVirtualItems.Count > 0)
            {
                advertisementType = AdType.SPECIAL_OFFER;
            }
            else
            {
                if ("best_deal".Equals(advertisementTypeString))
                {
                    advertisementType = AdType.BEST_DEAL;
                }
                else if ("recommended".Equals(advertisementTypeString))
                {
                    advertisementType = AdType.RECCOMENDED;
                }
                else if ("special_offer".Equals(advertisementTypeString))
                {
                    advertisementType = AdType.SPECIAL_OFFER;
                }
                else if ("custom".Equals(advertisementTypeString))
                {
                    advertisementType = AdType.CUSTOM;
                }
            }
            return(this);
        }
 public IParseble Parse(JSONNode subscriptionNode)
 {
     id           = subscriptionNode ["id"];
     chargeAmount = subscriptionNode ["chargeAmount"].AsFloat;
     chargeAmountWithoutDiscount = subscriptionNode ["chargeAmountWithoutDiscount"].AsFloat;
     chargeCurrency = subscriptionNode ["chargeCurrency"];
     period         = subscriptionNode ["period"].AsInt;
     periodUnit     = subscriptionNode ["periodUnit"];
     name           = subscriptionNode ["name"];
     description    = subscriptionNode ["description"];
     bonusOut       = subscriptionNode ["bonusOut"].AsInt;
     bonusItems     = XsollaBonusItem.ParseMany(subscriptionNode ["bonusItems"]);
     return(this);
 }
Exemple #4
0
 public IParseble Parse(JSONNode pricepointNode)
 {
     outAmount          = pricepointNode["out"].AsInt;
     outWithoutDiscount = pricepointNode["outWithoutDiscount"].AsInt;
     bonusOut           = pricepointNode["bonusOut"].AsInt;
     sum = pricepointNode["sum"].AsFloat;
     sumWithoutDiscount = pricepointNode["sumWithoutDiscount"].AsFloat;
     currency           = pricepointNode["currency"];
     image             = pricepointNode["image"];
     desc              = pricepointNode["description"];
     bonusItems        = XsollaBonusItem.ParseMany(pricepointNode ["bonusItems"]);
     label             = pricepointNode["label"];
     advertisementType = pricepointNode["advertisementType"];
     selected          = pricepointNode["selected"].AsBool;
     return(this);
 }
Exemple #5
0
        public IParseble Parse(JSONNode shopItemNode)
        {
            id                    = shopItemNode ["id"].AsInt;
            sku                   = shopItemNode["sku"];
            name                  = shopItemNode ["name"];
            description           = shopItemNode ["description"];
            imageUrl              = shopItemNode ["image_url"];                       //image_url <- NEW | OLD -> image
            amount                = shopItemNode ["amount"].AsFloat;
            amountWithoutDiscount = shopItemNode ["amount_without_discount"].AsFloat; //amount_without_discount <- NEW | OLD -> amountWithoutDiscount
            currency              = shopItemNode ["currency"];
            bonusVirtualItems     = XsollaBonusItem.ParseMany(shopItemNode ["bonus_virtual_items"]);
            var bvc = new XsollaBonusItem();

            bvc.Parse(shopItemNode ["bonus_virtual_currency"]);
            bonusVirtualCurrency = bvc;
//			bonusOut = shopItemNode ["bonusOut"].AsInt;
//			bonusItems =
            advertisementType = null;            //shopItemNode ["advertisementType"];
            return(this);
        }
Exemple #6
0
 public IParseble Parse(JSONNode subscriptionNode)
 {
     id                               = subscriptionNode ["id"];
     chargeAmount                     = subscriptionNode ["charge_amount"].AsDecimal;
     chargeAmountLocal                = subscriptionNode ["charge_amount_local"].AsDecimal;
     chargeAmountWithoutDiscount      = subscriptionNode ["charge_amount_without_discount"].AsDecimal;
     chargeAmountWithoutDiscountLocal = subscriptionNode ["charge_amount_without_discount_local"].AsDecimal;
     chargeCurrency                   = subscriptionNode ["charge_currency"];
     chargeCurrencyLocal              = subscriptionNode ["charge_currency_local"];
     isActive                         = subscriptionNode ["is_active"].AsBool;
     isPossibleRenew                  = subscriptionNode ["is_possible_renew"].AsBool;
     isTrial                          = subscriptionNode ["is_trial"].AsBool;
     period                           = subscriptionNode ["period"].AsInt;
     periodTrial                      = subscriptionNode ["perios_trial"].AsInt;
     periodUnit                       = subscriptionNode ["period_unit"];
     name                             = subscriptionNode ["name"];
     offerLabel                       = subscriptionNode ["offer_label"];
     description                      = subscriptionNode ["description"];
     bonusVirtualCurrency             = subscriptionNode ["bonus_virtual_currency"].AsInt;
     bonusVirtualItems                = XsollaBonusItem.ParseMany(subscriptionNode ["bonus_virtual_items"]);
     promotionChargesCount            = subscriptionNode ["promotion_charges_count"].AsInt;
     return(this);
 }