public void SetCurrencyBalance(VirtualCurrencyBalance balance) { if (currencies.ContainsKey(balance.sku)) { currencies[balance.sku].SetBalance(balance.amount); } }
public IParseble Parse(SimpleJSON.JSONNode userNode) { if (userNode ["requisites"].Count > 1) { requisites = new Requisites(userNode ["requisites"] ["value"], userNode ["requisites"] ["isVisible"].AsBool, userNode ["requisites"] ["id_allow_modify"].AsBool); } country = new Country(userNode ["country"] ["value"], userNode ["country"] ["allow_modify"].AsBool); local = userNode ["local"]; savedPaymentMethodCount = userNode ["savedPaymentMethodCount"].AsInt; acceptLanguage = userNode ["acceptLanguage"]; acceptEncoding = userNode ["acceptEncoding"]; if ((userNode["user_balance"]["currency"] != null) && (userNode["user_balance"]["amount"] != null)) { userBalance = new VirtualUserBalance(userNode["user_balance"]["currency"], userNode["user_balance"]["amount"].AsDecimal); } if (userNode["virtual_currency_balance"]["amount"] != null) { if (userNode["virtual_currency_balance"]["amount"] != null) { virtualCurrencyBalance = new VirtualCurrencyBalance(userNode["virtual_currency_balance"]["amount"].AsDouble); } } return(this); }
public IParseble Parse(SimpleJSON.JSONNode userNode) { if(userNode ["requisites"].Count > 1) requisites = new Requisites (userNode ["requisites"] ["value"], userNode ["requisites"] ["isVisible"].AsBool); country = new Country (userNode ["country"] ["value"], userNode ["country"] ["allow_modify"].AsBool); local = userNode ["local"]; savedPaymentMethodCount = userNode ["savedPaymentMethodCount"].AsInt; acceptLanguage = userNode ["acceptLanguage"]; acceptEncoding = userNode ["acceptEncoding"]; if (userNode["virtual_currency_balance"]["amount"] != null) virtualCurrencyBalance = new VirtualCurrencyBalance(userNode["virtual_currency_balance"]["amount"].AsDouble); return this; }