Skip to content

Commit 698bcd1

Browse files
committed
add fixes for marketplaces
1 parent 686e972 commit 698bcd1

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

Source/FikaAmazonAPI/Utils/MarketPlace.cs

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,46 @@ public class MarketPlace
1010
public Region Region { get; set; }
1111

1212
public Country Country { get; set; }
13-
13+
1414
private MarketPlace(string id, Region region, Country country)
1515
{
1616
ID = id;
1717
Region = region;
1818
Country = country;
1919
}
20-
20+
2121
public static MarketPlace GetMarketPlaceByID(string id)
2222
{
23-
var list =new List<MarketPlace>();
23+
var list = new List<MarketPlace>();
2424
//NorthAmerica
2525
list.Add(US); list.Add(Canada); list.Add(Mexico); list.Add(Brazil);
2626
//Europe
27-
list.Add(Spain); list.Add(UnitedKingdom); list.Add(France); list.Add(Netherlands);
27+
list.Add(Spain); list.Add(UnitedKingdom); list.Add(France); list.Add(Netherlands);
2828
list.Add(Germany); list.Add(Italy); list.Add(Sweden); list.Add(Egypt);
2929
list.Add(Poland); list.Add(Turkey); list.Add(UnitedArabEmirates); list.Add(India);
30+
list.Add(SaudiArabia);
3031
//FarEast
3132
list.Add(Singapore); list.Add(Australia); list.Add(Japan);
3233

3334
return list.FirstOrDefault(a => a.ID == id);
3435
}
3536

37+
public static MarketPlace GetMarketplaceByCountryCode(string countryCode)
38+
{
39+
var list = new List<MarketPlace>();
40+
//NorthAmerica
41+
list.Add(US); list.Add(Canada); list.Add(Mexico); list.Add(Brazil);
42+
//Europe
43+
list.Add(Spain); list.Add(UnitedKingdom); list.Add(France); list.Add(Netherlands);
44+
list.Add(Germany); list.Add(Italy); list.Add(Sweden); list.Add(Egypt);
45+
list.Add(Poland); list.Add(Turkey); list.Add(UnitedArabEmirates); list.Add(India);
46+
list.Add(SaudiArabia);
47+
//FarEast
48+
list.Add(Singapore); list.Add(Australia); list.Add(Japan);
49+
50+
return list.FirstOrDefault(a => a.Country.Code == countryCode);
51+
}
52+
3653
//https://docs.developer.amazonservices.com/en_UK/dev_guide/DG_Endpoints.html
3754

3855
//NorthAmerica
@@ -43,7 +60,7 @@ public static MarketPlace GetMarketPlaceByID(string id)
4360

4461
//Europe
4562
public static MarketPlace Spain { get { return new MarketPlace("A1RKKUPIHCS9HS", Region.Europe, Country.ES); } }
46-
public static MarketPlace UnitedKingdom { get { return new MarketPlace("A1F83G8C2ARO7P", Region.Europe, Country.GB); } }
63+
public static MarketPlace UnitedKingdom { get { return new MarketPlace("A1F83G8C2ARO7P", Region.Europe, Country.GB); } }
4764
public static MarketPlace France { get { return new MarketPlace("A13V1IB3VIYZZH", Region.Europe, Country.FR); } }
4865
public static MarketPlace Netherlands { get { return new MarketPlace("A1805IZSGTT6HS", Region.Europe, Country.NL); } }
4966
public static MarketPlace Germany { get { return new MarketPlace("A1PA6795UKMFR9", Region.Europe, Country.DE); } }
@@ -68,9 +85,9 @@ public static MarketPlace GetMarketPlaceByID(string id)
6885

6986
}
7087

71-
7288

73-
89+
90+
7491

7592

7693
}

0 commit comments

Comments
 (0)