コード例 #1
0
        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;
        }
コード例 #2
0
        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);
        }
コード例 #3
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);
 }
コード例 #4
0
 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);
 }
コード例 #5
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));
        }
コード例 #6
0
 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);
 }
コード例 #7
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);
 }
コード例 #8
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);
 }
コード例 #9
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);
        }
コード例 #10
0
        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);
        }
コード例 #11
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);
        }
コード例 #12
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);
        }
コード例 #13
0
        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);
        }
コード例 #14
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);
 }
コード例 #15
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);
        }
コード例 #16
0
 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);
 }