private string GetURL(MerchantLocationsRequestOptions options) { string url = ""; if (this.environment == Environments.Environment.PRODUCTION) { url = PRODUCTION_URL; } else { url = SANDBOX_URL; } url = URLUtil.AddQueryParameter(url, "Details", options.GetDetails(), false, null); url = URLUtil.AddQueryParameter(url, "PageOffset", options.GetPageOffset().ToString(), false, null); url = URLUtil.AddQueryParameter(url, "PageLength", options.GetPageLength().ToString(), false, null); url = URLUtil.AddQueryParameter(url, "Category", options.Category, true, ""); url = URLUtil.AddQueryParameter(url, "AddressLine1", options.AddressLine1, true, ""); url = URLUtil.AddQueryParameter(url, "AddressLine2", options.AddressLine2, true, ""); url = URLUtil.AddQueryParameter(url, "City", options.City, true, ""); url = URLUtil.AddQueryParameter(url, "CountrySubdivision", options.CountrySubdivision, true, ""); url = URLUtil.AddQueryParameter(url, "PostalCode", options.PostalCode, true, ""); url = URLUtil.AddQueryParameter(url, "Country", options.Country, true, ""); url = URLUtil.AddQueryParameter(url, "Latitude", options.Latitude.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "Longitude", options.Longitude.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "DistanceUnit", options.DistanceUnit, true, ""); url = URLUtil.AddQueryParameter(url, "Radius", options.Radius.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "OfferMerchantId", options.MerchantId.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "InternationalMaestroAccepted", options.GetInternationalMaestroAccepted().ToString(), true, "-1"); return url; }
private string GetURL(MerchantLocationsRequestOptions options) { string url = ""; if (this.environment == Environments.Environment.PRODUCTION) { url = PRODUCTION_URL; } else { url = SANDBOX_URL; } url = URLUtil.AddQueryParameter(url, "Details", options.GetDetails(), false, null); url = URLUtil.AddQueryParameter(url, "PageOffset", options.GetPageOffset().ToString(), false, null); url = URLUtil.AddQueryParameter(url, "PageLength", options.GetPageLength().ToString(), false, null); url = URLUtil.AddQueryParameter(url, "Category", options.Category, true, ""); url = URLUtil.AddQueryParameter(url, "AddressLine1", options.AddressLine1, true, ""); url = URLUtil.AddQueryParameter(url, "AddressLine2", options.AddressLine2, true, ""); url = URLUtil.AddQueryParameter(url, "City", options.City, true, ""); url = URLUtil.AddQueryParameter(url, "CountrySubdivision", options.CountrySubdivision, true, ""); url = URLUtil.AddQueryParameter(url, "PostalCode", options.PostalCode, true, ""); url = URLUtil.AddQueryParameter(url, "Country", options.Country, true, ""); url = URLUtil.AddQueryParameter(url, "Latitude", options.Latitude.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "Longitude", options.Longitude.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "DistanceUnit", options.DistanceUnit, true, ""); url = URLUtil.AddQueryParameter(url, "Radius", options.Radius.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "OfferMerchantId", options.MerchantId.ToString(), true, "0"); url = URLUtil.AddQueryParameter(url, "InternationalMaestroAccepted", options.GetInternationalMaestroAccepted().ToString(), true, "-1"); return(url); }
public Merchants GetMerchants(MerchantLocationsRequestOptions options) { string response = ""; Dictionary<string, string> responseMap = doRequest(GetURL(options), "GET", null); responseMap.TryGetValue(MESSAGE, out response); return Serializer<Merchants>.Deserialize(response); }
public void TestMerchantLocationServicePrepaidTravelCardFail() { options = new MerchantLocationsRequestOptions(Details.PRODUCTS_PREPAID_TRAVEL_CARD, 0, 25); options.Country = "USA"; options.PostalCode = "200006"; Merchants merchants = service.GetMerchants(options); Assert.IsTrue(merchants != null && merchants.Merchant.Count > 0); }
public Merchants GetMerchants(MerchantLocationsRequestOptions options) { string response = ""; Dictionary <string, string> responseMap = doRequest(GetURL(options), "GET", null); responseMap.TryGetValue(MESSAGE, out response); return(Serializer <Merchants> .Deserialize(response)); }
public void TestMerchantLocationServicePaypass() { options = new MerchantLocationsRequestOptions(Details.ACCEPTANCE_PAYPASS, 0, 25); options.PostalCode = "07032"; options.Country = "USA"; Merchants merchants = service.GetMerchants(options); Assert.IsTrue(merchants != null && merchants.Merchant.Count > 0); }
public void TestMerchantLocationServiceOffers() { options = new MerchantLocationsRequestOptions(Details.OFFERS_EASYSAVINGS, 0, 25); options.Country = "USA"; options.PostalCode = "22122"; Merchants merchants = service.GetMerchants(options); Assert.IsTrue(merchants != null && merchants.Merchant.Count > 0); }
public void TestMerchantLocationServiceCashback() { options = new MerchantLocationsRequestOptions(Details.FEATURES_CASHBACK, 0, 25); options.PostalCode = "46323"; options.Country = "USA"; Merchants merchants = service.GetMerchants(options); Assert.IsTrue(merchants != null && merchants.Merchant.Count > 0); }
public void TestMerchantLocationServicePrepaidTravelCardPass() { options = new MerchantLocationsRequestOptions(Details.PRODUCTS_PREPAID_TRAVEL_CARD, 0, 25); options.Country = "USA"; options.PostalCode = "20006"; Merchants merchants = service.GetMerchants(options); Assert.IsTrue(merchants != null && merchants.Merchant == null); }
public void TestMerchantLocationServiceRepower() { options = new MerchantLocationsRequestOptions(Details.TOPUP_REPOWER, 0, 25); options.Country = "USA"; options.PostalCode = "22122"; Merchants merchants = service.GetMerchants(options); Assert.IsTrue(merchants != null && merchants.Merchant.Count > 0); }
public void TestInternationalMaestroAccepted() { options = new MerchantLocationsRequestOptions(Details.FEATURES_CASHBACK, 0, 25); options.PostalCode = "46323"; options.Country = "USA"; options.SetInternationalMaestroAccepted(true); Merchants merchants = service.GetMerchants(options); Assert.IsTrue(merchants != null && merchants.Merchant.Count > 0); }