public IWorldPayFluentOptions Address(string address1, string address2, string address3, string town, string region, string postcode, CountryCode code) { fWorldPayPaymentModel.address1 = address1.Truncate(84); fWorldPayPaymentModel.address2 = address2.Truncate(84); fWorldPayPaymentModel.address3 = address3.Truncate(84); fWorldPayPaymentModel.town = town.Truncate(30); fWorldPayPaymentModel.region = region.Truncate(30); fWorldPayPaymentModel.postcode = postcode.Truncate(12); fWorldPayPaymentModel.country = code.ToString(); return new WorldPayFluentOptions(this); }
public static string GetEquitySearchCriteria(SearchCategory category = SearchCategory.None, CountryCode country = CountryCode.ALL, string name = "", string description = "", bool includeNoLongerTrading = false) { if (GetAssetType(category) != AssetClass.Equity) throw new ArgumentException("Invalid SearchCategory for Equity search: " + category.ToString(), "category"); StringBuilder criteria = new StringBuilder(); if (category != SearchCategory.None) Append(criteria, "c=" + category.ToString()); if (name != string.Empty) Append(criteria, "n=" + name); if (description != string.Empty) Append(criteria, "desc=" + description); if (includeNoLongerTrading) Append(criteria, "Flg=true"); if (country != CountryCode.ALL) Append(criteria, string.Format("cnt={0}", country)); return criteria.ToString(); }
public IEmployeeTypesRequest WhereCountryCode(CountryCode value) { _countryCode = value.ToString(); return this; }
public int GetClientNumber(PaymentType type, CountryCode country) { return 79021; }
/// <summary> /// Gets a <see cref="CountryInfo"/> by its <paramref name="countryCode"/>. /// </summary> /// <remarks> /// Never returns null. /// </remarks> /// <param name="countryCode">The <see cref="CountryCode"/> to get the <see cref="CountryInfo"/> for.</param> /// <returns>The <see cref="CountryInfo"/> corresponding to <paramref name="countryCode"/>.</returns> public static CountryInfo GetCountry(CountryCode countryCode) { return _all[countryCode]; }
public ICategoryRequest WhereCountryCode(CountryCode value) { _countryCode = value.ToString(); return this; }
public static string GetInvalidIdentifierMessage(string nationalIdentifier, CountryCode countryCode) => $"The given national Identifier '{nationalIdentifier}' is not valid for the country {countryCode}";
/// <summary> /// Gets a <see cref="CurrencyInfo"/> for the passed <see cref="CountryCode"/>. /// </summary> /// <remarks> /// Never returns null. /// </remarks> /// <param name="countryCode">The <see cref="CountryCode"/> to get the <see cref="CurrencyInfo"/> for.</param> /// <returns>The <see cref="CurrencyInfo"/> corresponding to <paramref name="countryCode"/>.</returns> /// <exception cref="ArgumentNullException">When <see cref="countryCode"/> is null.</exception> /// <exception cref="ArgumentException">When there is no region associated with <paramref name="countryCode"/>, i.e. when <paramref name="countryCode"/> is a neutral or the invariant culture.</exception> public static CurrencyInfo GetCurrency(CountryCode countryCode) { return CountryInfo.GetCountry(countryCode).Currency; }
public CloseOrderBuilder SetCountryCode(CountryCode countryCode) { _countryCode = countryCode; return this; }
public int GetClientNumber(PaymentType type, CountryCode country) { switch (country) { case CountryCode.SE: if (type == PaymentType.INVOICE) { return 79021; } if (type == PaymentType.PAYMENTPLAN) { return 59999; } break; case CountryCode.NO: if (type == PaymentType.INVOICE) { return 33308; } if (type == PaymentType.PAYMENTPLAN) { return 32503; } break; case CountryCode.FI: if (type == PaymentType.INVOICE) { return 26136; } if (type == PaymentType.PAYMENTPLAN) { return 27136; } break; case CountryCode.DK: if (type == PaymentType.INVOICE) { return 62008; } if (type == PaymentType.PAYMENTPLAN) { return 64008; } break; case CountryCode.NL: if (type == PaymentType.INVOICE) { return 85997; } if (type == PaymentType.PAYMENTPLAN) { return 86997; } break; case CountryCode.DE: if (type == PaymentType.INVOICE) { return 14997; } if (type == PaymentType.PAYMENTPLAN) { return 16997; } break; } return 0; }
public string GetMerchantId(PaymentType type, CountryCode country) { return type == PaymentType.HOSTED ? "1130" : ""; }
private PaymentPlanType(string value, CountryCode countryCode) { Value = value; CountryCode = countryCode; }
//Method that validate and reformat inputs from user private void DAEdit() { string errorMessage = ""; Regex regex; //Trim all string fields if (ProvinceCode.Trim() == null) { ProvinceCode = ""; } if (Name.Trim() == null) { Name = ""; } if (CountryCode.Trim() == null) { CountryCode = ""; } if (TaxCode.Trim() == null) { TaxCode = ""; } //Checks Name if (Name == "") { errorMessage += "Name is required\n"; } //Checks Province Code regex = new Regex("^[a-zA-Z]{2}"); if (!regex.IsMatch(ProvinceCode)) { errorMessage += "Province Code is required and must be" + " 2 letters\n"; } else if (regex.IsMatch(ProvinceCode)) { ProvinceCode = ProvinceCode.ToUpper(); } //Checks Country Code if (!regex.IsMatch(CountryCode)) { errorMessage += "Country Code is required and must be" + " 2 letters\n"; } else if (regex.IsMatch(CountryCode)) { CountryCode = CountryCode.ToUpper(); } if (TaxCode != "") { TaxCode = TaxCode.ToUpper(); } //Checks Tax Code regex = new Regex("^[a-zA-Z]*"); if (!regex.IsMatch(TaxCode)) { errorMessage += "Tax Code must be only letters\n"; } //Checks Tax Rate if (TaxCode == "" && TaxRate != 0) { errorMessage += "Insert first a Tax Code, then a Tax Rate\n"; } else if (TaxCode != "" && (TaxRate < 0 || TaxRate > 1)) { errorMessage += "Tax Rate must be between 0 and 1, inclusive\n"; } //Checks federal tax if (TaxRate == 0 && IncludesFederalTax) { errorMessage += "Includes Federal Tax must not be selected" + " if Tax Rate is zero\n"; } //Checks if Province code already exists if (DAGetByProvinceCode(ProvinceCode) != null) { IsEdit = true; } else { IsEdit = false; } //Checks to update if ( DAGetByProvinceName(Name) != null && (DAGetByProvinceCode(ProvinceCode) == null || DAGetByProvinceCode(ProvinceCode).ProvinceCode != DAGetByProvinceName(Name).ProvinceCode)) { errorMessage += "The name entered already exists!\n"; } if (errorMessage != "") { throw new Exception(errorMessage); } }
public Translation(CountryCode countryCode) { CountryCode = countryCode; }
public Translation(long id, string text, CountryCode countryCode) { Id = id; Text = text; CountryCode = countryCode; }
public IJobSearch WhereCountryCode(CountryCode value) { _CountryCode = value.ToString(); return this; }
public string GetPassword(PaymentType type, CountryCode country) { if (type == PaymentType.INVOICE || type == PaymentType.PAYMENTPLAN) { switch (country) { case CountryCode.SE: return "sverigetest"; case CountryCode.NO: return "norgetest2"; case CountryCode.FI: return "finlandtest2"; case CountryCode.DK: return "danmarktest2"; case CountryCode.NL: return "hollandtest"; case CountryCode.DE: return "germanytest"; } } return ""; }
public static void CDR_SerializeDeserialize_Test01() { #region Defined CDR1 var CDR1 = new CDR(CountryCode.Parse("DE"), Party_Id.Parse("GEF"), CDR_Id.Parse("CDR0001"), DateTime.Parse("2020-04-12T18:20:19Z"), DateTime.Parse("2020-04-12T22:20:19Z"), new CDRToken( Token_Id.Parse("1234"), TokenTypes.RFID, Contract_Id.Parse("C1234") ), AuthMethods.AUTH_REQUEST, new CDRLocation( Location_Id.Parse("LOC0001"), "Biberweg 18", "Jena", "Deutschland", GeoCoordinate.Parse(10, 20), EVSE_UId.Parse("DE*GEF*E*LOC0001*1"), EVSE_Id.Parse("DE*GEF*E*LOC0001*1"), Connector_Id.Parse("1"), ConnectorTypes.IEC_62196_T2, ConnectorFormats.SOCKET, PowerTypes.AC_3_PHASE, "Name?", "07749" ), Currency.EUR, new ChargingPeriod[] { new ChargingPeriod( DateTime.Parse("2020-04-12T18:21:49Z"), new CDRDimension[] { new CDRDimension( CDRDimensions.ENERGY, 1.33M ) }, Tariff_Id.Parse("DE*GEF*T0001") ), new ChargingPeriod( DateTime.Parse("2020-04-12T18:21:50Z"), new CDRDimension[] { new CDRDimension( CDRDimensions.TIME, 5.12M ) }, Tariff_Id.Parse("DE*GEF*T0002") ) }, // Total costs new Price( 10.00, 11.60 ), // Total Energy 50.00M, // Total time TimeSpan.FromMinutes(30), Session_Id.Parse("0815"), AuthorizationReference.Parse("Auth0815"), Meter_Id.Parse("Meter0815"), // OCPI Computer Science Extensions new EnergyMeter( Meter_Id.Parse("Meter0815"), "EnergyMeter Model #1", "hw. v1.80", "fw. v1.20", "Energy Metering Services", null, null ), // OCPI Computer Science Extensions new TransparencySoftware[] { new TransparencySoftware( "Chargy Transparency Software Desktop Application", "v1.00", LegalStatus.LegallyBinding, OpenSourceLicenses.GPL3, "GraphDefined GmbH", URL.Parse("https://open.charging.cloud/logo.svg"), URL.Parse("https://open.charging.cloud/Chargy/howto"), URL.Parse("https://open.charging.cloud/Chargy"), URL.Parse("https://github.com/OpenChargingCloud/ChargyDesktopApp") ), new TransparencySoftware( "Chargy Transparency Software Mobile Application", "v1.00", LegalStatus.ForInformationOnly, OpenSourceLicenses.GPL3, "GraphDefined GmbH", URL.Parse("https://open.charging.cloud/logo.svg"), URL.Parse("https://open.charging.cloud/Chargy/howto"), URL.Parse("https://open.charging.cloud/Chargy"), URL.Parse("https://github.com/OpenChargingCloud/ChargyMobileApp") ) }, new Tariff[] { new Tariff( CountryCode.Parse("DE"), Party_Id.Parse("GEF"), Tariff_Id.Parse("TARIFF0001"), Currency.EUR, new TariffElement[] { new TariffElement( new PriceComponent[] { PriceComponent.ChargingTime( TimeSpan.FromSeconds(300), 2.00M, 0.10M ) }, new TariffRestrictions [] { new TariffRestrictions( Time.FromHourMin(08, 00), // Start time Time.FromHourMin(18, 00), // End time DateTime.Parse("2020-12-01"), // Start timestamp DateTime.Parse("2020-12-31"), // End timestamp 1.12M, // MinkWh 5.67M, // MaxkWh 1.34M, // MinCurrent 8.89M, // MaxCurrent 1.49M, // MinPower 9.91M, // MaxPower TimeSpan.FromMinutes(10), // MinDuration TimeSpan.FromMinutes(30), // MaxDuration new DayOfWeek[] { DayOfWeek.Monday, DayOfWeek.Tuesday }, ReservationRestrictionTypes.RESERVATION ) } ) }, TariffTypes.PROFILE_GREEN, new DisplayText[] { new DisplayText(Languages.de, "Hallo Welt!"), new DisplayText(Languages.en, "Hello world!"), }, URL.Parse("https://open.charging.cloud"), new Price( // Min Price 1.10, 1.26 ), new Price( // Max Price 2.20, 2.52 ), DateTime.Parse("2020-12-01"), // Start timestamp DateTime.Parse("2020-12-31"), // End timestamp new EnergyMix( true, new EnergySource[] { new EnergySource( EnergySourceCategories.SOLAR, 80 ), new EnergySource( EnergySourceCategories.WIND, 20 ) }, new EnvironmentalImpact[] { new EnvironmentalImpact( EnvironmentalImpactCategories.CARBON_DIOXIDE, 0.1 ) }, "Stadtwerke Jena-Ost", "New Green Deal" ), DateTime.Parse("2020-09-22") ) }, new SignedData( EncodingMethod.GraphDefiened, new SignedValue[] { new SignedValue( SignedValueNature.START, "PlainStartValue", "SignedStartValue" ), new SignedValue( SignedValueNature.INTERMEDIATE, "PlainIntermediateValue", "SignedIntermediateValue" ), new SignedValue( SignedValueNature.END, "PlainEndValue", "SignedEndValue" ) }, 1, // Encoding method version null, // Public key "https://open.charging.cloud/pools/1/stations/1/evse/1/publicKey" ), // Total Fixed Costs new Price( 20.00, 23.10 ), // Total Energy Cost new Price( 20.00, 23.10 ), // Total Time Cost new Price( 20.00, 23.10 ), // Total Parking Time TimeSpan.FromMinutes(120), // Total Parking Cost new Price( 20.00, 23.10 ), // Total Reservation Cost new Price( 20.00, 23.10 ), "Remark!", InvoiceReference_Id.Parse("Invoice:0815"), true, // IsCredit CreditReference_Id.Parse("Credit:0815"), DateTime.Parse("2020-09-12") ); #endregion var JSON = CDR1.ToJSON(); Assert.AreEqual("DE", JSON["country_code"].Value <String>()); Assert.AreEqual("GEF", JSON["party_id"].Value <String>()); Assert.AreEqual("CDR0001", JSON["id"].Value <String>()); Assert.IsTrue(CDR.TryParse(JSON, out CDR CDR2, out String ErrorResponse)); Assert.IsNull(ErrorResponse); Assert.AreEqual(CDR1.CountryCode, CDR2.CountryCode); Assert.AreEqual(CDR1.PartyId, CDR2.PartyId); Assert.AreEqual(CDR1.Id, CDR2.Id); Assert.AreEqual(CDR1.Start.ToIso8601(), CDR2.Start.ToIso8601()); Assert.AreEqual(CDR1.End.ToIso8601(), CDR2.End.ToIso8601()); Assert.AreEqual(CDR1.CDRToken, CDR2.CDRToken); Assert.AreEqual(CDR1.AuthMethod, CDR2.AuthMethod); Assert.AreEqual(CDR1.Location, CDR2.Location); Assert.AreEqual(CDR1.Currency, CDR2.Currency); Assert.AreEqual(CDR1.ChargingPeriods, CDR2.ChargingPeriods); Assert.AreEqual(CDR1.TotalCosts, CDR2.TotalCosts); Assert.AreEqual(CDR1.TotalEnergy, CDR2.TotalEnergy); Assert.AreEqual(CDR1.TotalTime, CDR2.TotalTime); Assert.AreEqual(CDR1.SessionId, CDR2.SessionId); Assert.AreEqual(CDR1.AuthorizationReference, CDR2.AuthorizationReference); Assert.AreEqual(CDR1.MeterId, CDR2.MeterId); Assert.AreEqual(CDR1.EnergyMeter, CDR2.EnergyMeter); Assert.AreEqual(CDR1.TransparencySoftwares, CDR2.TransparencySoftwares); Assert.AreEqual(CDR1.Tariffs, CDR2.Tariffs); Assert.AreEqual(CDR1.SignedData, CDR2.SignedData); Assert.AreEqual(CDR1.TotalFixedCosts, CDR2.TotalFixedCosts); Assert.AreEqual(CDR1.TotalEnergyCost, CDR2.TotalEnergyCost); Assert.AreEqual(CDR1.TotalTimeCost, CDR2.TotalTimeCost); Assert.AreEqual(CDR1.TotalParkingTime, CDR2.TotalParkingTime); Assert.AreEqual(CDR1.TotalParkingCost, CDR2.TotalParkingCost); Assert.AreEqual(CDR1.TotalReservationCost, CDR2.TotalReservationCost); Assert.AreEqual(CDR1.Remark, CDR2.Remark); Assert.AreEqual(CDR1.InvoiceReferenceId, CDR2.InvoiceReferenceId); Assert.AreEqual(CDR1.Credit, CDR2.Credit); Assert.AreEqual(CDR1.CreditReferenceId, CDR2.CreditReferenceId); Assert.AreEqual(CDR1.LastUpdated.ToIso8601(), CDR2.LastUpdated.ToIso8601()); }
/// <summary> /// Private method which exposes all possible parameters, with default values for the optional ones. /// </summary> /// <param name="category">Category=StockOption, IndexOption, FutureOption or CurrencyOption</param> /// <param name="symbolRoot">Symbol root. Required Field, the symbol the option is a derivative of, this search will not return options based on a partial root.</param> /// <param name="strikeCount">Number of strikes prices above and below the underlying price. Defaults to 3. Ignored if strike price high and low are passed.</param> /// <param name="strikePriceLow">Strike price low</param> /// <param name="strikePriceHigh">Strike price high</param> /// <param name="dateCount">Number of expiration dates. Default value 3. Ignored if expiration dates high and low are passed.</param> /// <param name="expirationDateLow">Expiration date low</param> /// <param name="expirationDateHigh">Expiration date high</param> /// <param name="optionType">Option type (Both, Call, Put) Default: Both</param> /// <param name="futureType">Future type (Electronic, Pit) Default: Electronic</param> /// <param name="symbolType">SymbolType (Both, Composite, Regional) Default: Composite</param> /// <param name="country">Country code (US, DE, CA) Default: US</param> /// <returns></returns> public static string GetOptionSearchCriteria(SearchCategory category, string symbolRoot, uint strikeCount = 3, decimal strikePriceLow = 0, decimal strikePriceHigh = decimal.MaxValue, uint dateCount = 3, DateTime? expirationDateLow = null, DateTime? expirationDateHigh = null, OptionType optionType = OptionType.Both, FutureType futureType = FutureType.Electronic, SymbolType symbolType = SymbolType.Composite, CountryCode country = CountryCode.US) { if (string.IsNullOrEmpty(symbolRoot)) throw new ArgumentException("symbolRoot is required.", "symbolRoot"); if (GetAssetType(category) != AssetClass.Option) throw new ArgumentException("SearchCategory must be StockOption, IndexOption, FutureOption or CurrencyOption", "category"); if (strikePriceLow < 0) throw new ArgumentOutOfRangeException("strikePriceLow", "Argument cannot be less than 0."); if (strikePriceHigh < 0) throw new ArgumentOutOfRangeException("strikePriceHigh", "Argument cannot be less than 0."); if ((expirationDateLow.HasValue && !expirationDateHigh.HasValue) || (expirationDateHigh.HasValue && !expirationDateLow.HasValue)) throw new ArgumentException("If either expiration date parameter is passed, both must be passed."); if (expirationDateHigh.HasValue && expirationDateLow.HasValue && expirationDateHigh < expirationDateLow) throw new ArgumentOutOfRangeException("expirationDateHigh", "expirationDateHigh cannot be before expirationDateLow."); StringBuilder criteria = new StringBuilder(255); Append(criteria, "c=" + category.ToString()); Append(criteria, "R=" + symbolRoot); // strike price range takes precidence over strike count if (strikePriceLow > 0 && strikePriceHigh < decimal.MaxValue) { Append(criteria, "Spl=" + strikePriceLow); Append(criteria, "Sph=" + strikePriceHigh); } else if (strikeCount != 3) Append(criteria, "Stk=" + strikeCount); // daterange takes precidence over datacount if (expirationDateLow.HasValue) { Append(criteria, "Edl=" + ((DateTime)expirationDateLow).ToString("MM-dd-yyyy")); Append(criteria, "Edh=" + ((DateTime)expirationDateHigh).ToString("MM-dd-yyyy")); } else if (dateCount != 3) Append(criteria, "Exd=" + dateCount); if (optionType != OptionType.Both) Append(criteria, "OT=" + optionType.ToString()); if (futureType != FutureType.Electronic) Append(criteria, "FT=" + futureType.ToString()); if (symbolType != SymbolType.Composite) Append(criteria, "ST=" + symbolType.ToString()); if (country != CountryCode.US) Append(criteria, "Cnt=" + country.ToString()); return criteria.ToString(); }
public void SetSubmitMessage(CountryCode countryCode) { switch (countryCode) { case CountryCode.SE: SetSubmitText("Betala"); _noScriptMessage = "Javascript är inaktiverat i er webbläsare, ni får dirigera om till paypage manuellt"; break; default: SetSubmitText("Submit"); _noScriptMessage = "Javascript is inactivated in your browser, you will manually have to redirect to the paypage"; break; } }
public string GetMerchantId(PaymentType type, CountryCode country) { return "1130"; }
private InvoiceType(string value, CountryCode countryCode) { Value = value; CountryCode = countryCode; }
public string GetSecretWord(PaymentType type, CountryCode country) { return "8a9cece566e808da63c6f07ff415ff9e127909d000d259aba24daa2fed6d9e3f8b0b62e8ad1fa91c7d7cd6fc3352deaae66cdb533123edf127ad7d1f4c77e7a3"; }
public GetAddresses SetCountryCode(CountryCode countryCode) { _countryCode = countryCode; return this; }
private async Task <IAccountData> Registration(IAccountData accountData, SmsServiceCode smsServiceCode, ServiceCode serviceCode, CountryCode countryCode = CountryCode.RU) { return(await Registration(accountData, smsServiceCode, serviceCode, countryCode, Log)); }
public string GetPassword(PaymentType type, CountryCode country) { return "sverigetest"; }
public static string GetFutureSearchCriteria(string description = "", string root = "", FutureType futureType = FutureType.Electronic, Currency currency = Currency.USD, bool includeExpired = false, CountryCode country = CountryCode.ALL) { StringBuilder criteria = new StringBuilder(255); Append(criteria, "c=" + SearchCategory.Future.ToString()); if (description != string.Empty) Append(criteria, "desc=" + description); if (root != string.Empty) Append(criteria, "r=" + root); if (futureType != FutureType.Electronic) Append(criteria, "FT=" + futureType.ToString()); if (currency != Currency.USD) Append(criteria, "Cur=" + currency.ToString()); if (includeExpired) Append(criteria, "Exp=true"); if (country != CountryCode.ALL) Append(criteria, "Cnt=" + country.ToString()); return criteria.ToString(); }
public string GetUsername(PaymentType type, CountryCode country) { return "sverigetest"; }
public static IndividualCustomer CreateIndividualCustomer(CountryCode country = CountryCode.SE) { IndividualCustomer iCustomer = null; switch (country) { case CountryCode.SE: iCustomer = Item.IndividualCustomer() .SetInitials("SB") .SetName("Tess", "Persson") .SetEmail("*****@*****.**") .SetPhoneNumber("0811111111") .SetIpAddress("123.123.123") .SetStreetAddress("Testgatan", "1") .SetBirthDate("19231212") .SetCoAddress("c/o Eriksson, Erik") .SetNationalIdNumber(DefaultTestIndividualNationalIdNumber) .SetZipCode("99999") .SetLocality("Stan"); break; case CountryCode.NO: iCustomer = Item.IndividualCustomer() .SetName("Ola", "Normann") .SetEmail("*****@*****.**") .SetPhoneNumber("21222222") .SetIpAddress("123.123.123") .SetStreetAddress("Testveien", "2") .SetNationalIdNumber("17054512066") .SetZipCode("359") .SetLocality("Oslo"); break; case CountryCode.FI: iCustomer = Item.IndividualCustomer() .SetName("Kukka-Maaria", "Kanerva Haapakoski") .SetEmail("*****@*****.**") .SetIpAddress("123.123.123") .SetStreetAddress("Atomitie", "2 C") .SetNationalIdNumber("160264-999N") .SetZipCode("370") .SetLocality("Helsinki"); break; case CountryCode.DK: iCustomer = Item.IndividualCustomer() .SetName("Hanne", "Jensen") .SetEmail("*****@*****.**") .SetPhoneNumber("22222222") .SetIpAddress("123.123.123") .SetStreetAddress("Testvejen", "42") .SetCoAddress("c/o Test A/S") .SetNationalIdNumber("2603692503") .SetZipCode("2100") .SetLocality("KØBENHVN Ø"); break; case CountryCode.DE: iCustomer = Item.IndividualCustomer() .SetName("Theo", "Giebel") .SetEmail("*****@*****.**") .SetIpAddress("123.123.123") .SetStreetAddress("Zörgiebelweg", "21") .SetCoAddress("c/o Test A/S") .SetNationalIdNumber("19680403") .SetZipCode("13591") .SetLocality("BERLIN"); break; case CountryCode.NL: iCustomer = Item.IndividualCustomer() .SetInitials("SB") .SetName("Sneider", "Boasman") .SetEmail("*****@*****.**") .SetPhoneNumber("999999") .SetIpAddress("123.123.123.123") .SetStreetAddress("Gate", "42") .SetBirthDate("19550307") .SetCoAddress("138") .SetNationalIdNumber("19550307") .SetZipCode("1102 HG") .SetLocality("BARENDRECHT"); break; default: throw new SveaWebPayException("Unsupported argument for method."); } return iCustomer; }
/// <summary> /// Initializes a new instance of the <see cref="CountryInfo"/> class based on the country/region or specific culture, specified by identifier. /// </summary> /// <param name="culture">The culture identifier, <see cref="CultureInfo.LCID"/>.</param> /// <param name="countryCode">This country's corresponding <see cref="CountryCode"/></param> private CountryInfo(int culture, CountryCode countryCode) : base(culture) { Code = countryCode; }
public static CompanyCustomer CreateCompanyCustomer(CountryCode country = CountryCode.SE) { CompanyCustomer cCustomer = null; switch (country) { case CountryCode.SE: cCustomer = Item.CompanyCustomer() .SetCompanyName("Tess, T Persson") .SetNationalIdNumber(DefaultTestCompanyNationalIdNumber) .SetEmail("*****@*****.**") .SetPhoneNumber("0811111111") .SetIpAddress("123.123.123.123") .SetStreetAddress("Testgatan", "1") .SetCoAddress("c/o Eriksson, Erik") .SetZipCode("99999") .SetLocality("Stan"); break; case CountryCode.NO: cCustomer = Item.CompanyCustomer() .SetCompanyName("Test firma AS") .SetNationalIdNumber("923313850") .SetEmail("*****@*****.**") .SetPhoneNumber("22222222") .SetIpAddress("123.123.123.123") .SetStreetAddress("Testveien", "1") .SetZipCode("259") .SetLocality("Oslo"); break; case CountryCode.FI: cCustomer = Item.CompanyCustomer() .SetCompanyName("Testi Yritys Oy") .SetNationalIdNumber("9999999-2") .SetEmail("*****@*****.**") .SetPhoneNumber("22222222") .SetIpAddress("123.123.123.123") .SetStreetAddress("Testitie", "1") .SetZipCode("370") .SetLocality("Helsinki"); break; case CountryCode.DK: cCustomer = Item.CompanyCustomer() .SetCompanyName("Test A/S") .SetNationalIdNumber("99999993") .SetEmail("*****@*****.**") .SetPhoneNumber("22222222") .SetIpAddress("123.123.123.123") .SetStreetAddress("Testvejen", "42") .SetZipCode("2100") .SetLocality("KØBENHVN Ø"); break; case CountryCode.DE: cCustomer = Item.CompanyCustomer() .SetCompanyName("K. H. Maier gmbH") .SetNationalIdNumber("12345") .SetVatNumber("DE123456789") .SetEmail("*****@*****.**") .SetPhoneNumber("0241/12 34 56") .SetIpAddress("123.123.123.123") .SetStreetAddress("Adalbertsteinweg", "1") .SetZipCode("52070") .SetLocality("AACHEN"); break; case CountryCode.NL: cCustomer = Item.CompanyCustomer() .SetCompanyName("Svea bakkerij 123") .SetVatNumber("NL123456789A12") .SetEmail("*****@*****.**") .SetPhoneNumber("999999") .SetIpAddress("123.123.123.123") .SetStreetAddress("broodstraat", "1") .SetCoAddress("236") .SetZipCode("1111 CD") .SetLocality("BARENDRECHT"); break; default: throw new SveaWebPayException("Unsupported argument for method."); } return cCustomer; }
public IEducationCodesRequest WhereCountryCode(CountryCode value) { _countryCode = value.ToString(); return this; }
/** * Constructor */ private CountryCode(int v,string c,string d) { value = v; code = c; description = d; CountryCode[] newcodes = new CountryCode[codes.Length + 1]; System.Array.Copy(codes,0,newcodes,0,codes.Length); newcodes[codes.Length] = this; codes = newcodes; }
public Phone(CountryCode country, string number) { Country = country; Number = number; }
public Dictionary<int, string> GetCountries(bool needAll = false, CountryCode[] codes = null, int offset = 0, int count = 100) { Dictionary<int, string> countries = new Dictionary<int, string>(); NameValueCollection qs = new NameValueCollection(); if (needAll) qs["need_all"] = "1"; else qs["need_all"] = "0"; if(codes != null) qs["code"] = String.Join(",", from CountryCode c in codes select c); qs["offset"] = offset.ToString(); if(count > 0) qs["count"] = count.ToString(); XmlDocument answer = VkResponse.ExecuteCommand("database.getCountries", qs); XmlNodeList usersNodes = answer.SelectNodes("response/country"); if (usersNodes != null) foreach (XmlNode node in usersNodes) { int id = Convert.ToInt32(VkResponse.GetDataFromXmlNode(node.SelectSingleNode("cid"))); string title = VkResponse.GetDataFromXmlNode(node.SelectSingleNode("title")); countries.Add(id, title); } return countries; }
public Country() { CountryCode = new CountryCode(); }
public static void CDR_DeserializeGitHub_Test01() { #region Define JSON var JSON = @"{ ""country_code"": ""BE"", ""party_id"": ""BEC"", ""id"": ""12345"", ""start_date_time"": ""2015-06-29T21:39:09Z"", ""end_date_time"": ""2015-06-29T23:37:32Z"", ""cdr_token"": { ""uid"": ""012345678"", ""type"": ""RFID"", ""contract_id"": ""DE8ACC12E46L89"" }, ""auth_method"": ""WHITELIST"", ""cdr_location"": { ""id"": ""LOC1"", ""name"": ""Gent Zuid"", ""address"": ""F.Rooseveltlaan 3A"", ""city"": ""Gent"", ""postal_code"": ""9000"", ""country"": ""BEL"", ""coordinates"": { ""latitude"": ""3.729944"", ""longitude"": ""51.047599"" }, ""evse_uid"": ""3256"", ""evse_id"": ""BE*BEC*E041503003"", ""connector_id"": ""1"", ""connector_standard"": ""IEC_62196_T2"", ""connector_format"": ""SOCKET"", ""connector_power_type"": ""AC_1_PHASE"" }, ""currency"": ""EUR"", ""tariffs"": [{ ""country_code"": ""BE"", ""party_id"": ""BEC"", ""id"": ""12"", ""currency"": ""EUR"", ""elements"": [{ ""price_components"": [{ ""type"": ""TIME"", ""price"": 2.00, ""vat"": 10.0, ""step_size"": 300 }] }], ""last_updated"": ""2015-02-02T14:15:01Z"" }], ""charging_periods"": [{ ""start_date_time"": ""2015-06-29T21:39:09Z"", ""dimensions"": [{ ""type"": ""TIME"", ""volume"": 1.973 }], ""tariff_id"": ""12"" }], ""total_cost"": { ""excl_vat"": 4.00, ""incl_vat"": 4.40 }, ""total_energy"": 15.342, ""total_time"": 1.973, ""total_time_cost"": { ""excl_vat"": 4.00, ""incl_vat"": 4.40 }, ""last_updated"": ""2015-06-29T22:01:13Z"" }"; #endregion Assert.IsTrue(CDR.TryParse(JSON, out CDR parsedCDR, out String ErrorResponse)); Assert.IsNull(ErrorResponse); Assert.AreEqual(CountryCode.Parse("BE"), parsedCDR.CountryCode); Assert.AreEqual(Party_Id.Parse("BEC"), parsedCDR.PartyId); Assert.AreEqual(CDR_Id.Parse("12345"), parsedCDR.Id); //Assert.AreEqual(true, parsedCDR.Publish); //Assert.AreEqual(CDR1.Start. ToIso8601(), parsedCDR.Start. ToIso8601()); //Assert.AreEqual(CDR1.End.Value.ToIso8601(), parsedCDR.End.Value.ToIso8601()); //Assert.AreEqual(CDR1.kWh, parsedCDR.kWh); //Assert.AreEqual(CDR1.CDRToken, parsedCDR.CDRToken); //Assert.AreEqual(CDR1.AuthMethod, parsedCDR.AuthMethod); //Assert.AreEqual(CDR1.AuthorizationReference, parsedCDR.AuthorizationReference); //Assert.AreEqual(CDR1.CDRId, parsedCDR.CDRId); //Assert.AreEqual(CDR1.EVSEUId, parsedCDR.EVSEUId); //Assert.AreEqual(CDR1.ConnectorId, parsedCDR.ConnectorId); //Assert.AreEqual(CDR1.MeterId, parsedCDR.MeterId); //Assert.AreEqual(CDR1.EnergyMeter, parsedCDR.EnergyMeter); //Assert.AreEqual(CDR1.TransparencySoftwares, parsedCDR.TransparencySoftwares); //Assert.AreEqual(CDR1.Currency, parsedCDR.Currency); //Assert.AreEqual(CDR1.ChargingPeriods, parsedCDR.ChargingPeriods); //Assert.AreEqual(CDR1.TotalCosts, parsedCDR.TotalCosts); //Assert.AreEqual(CDR1.Status, parsedCDR.Status); //Assert.AreEqual(CDR1.LastUpdated.ToIso8601(), parsedCDR.LastUpdated.ToIso8601()); }