示例#1
0
        /// <summary>
        /// Method used to pull the IV, Key and Base URL for the All Brands Partner Stores
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static PartnerStoreNode GetPartnerStoreNode(PartnerStoreTypes type)
        {
            var node = new PartnerStoreNode();

            switch (type)
            {
            case PartnerStoreTypes.AllBrandsForYou:
                node.Key     = "ZkTh^ptY-2hT2^N#";
                node.IV      = "XEqNjm*ZHWa&6K5+";
                node.BaseUrl = "http://www.allbrandstoyou.com?k={0}";
                break;

            case PartnerStoreTypes.FullerBrush:
                node.Key = "F8*Q4^6!@vZo9$cB";
                node.IV  = "H8%5P0Oe3!nM*8vF";
                //D.H. 8-10-16 #77129 Added "www" to the link because without it, it doesn't redirect correctly
                node.BaseUrl = "http://www.fullerdirect.com/bonvera/order.asp?k={0}";
                break;

            case PartnerStoreTypes.Eskimo:
                node.Key     = "erxg8PyhhQzK2yCF";
                node.IV      = "6538499726737456";
                node.BaseUrl = "http://eskimokissesboutique.com?k={0}";
                break;

            case PartnerStoreTypes.Isabelles:
                node.Key     = "ISABELL197090901";
                node.IV      = "IVLIGHT197090901";
                node.BaseUrl = "http://www.isabelleslighting.com?k={0}";
                break;

            case PartnerStoreTypes.Bullionworks:
                node.Key     = "TESTKEY123456789";
                node.IV      = "IV12345678912343";
                node.BaseUrl = "http://store.unitedgoldsupply.com/bonvera/?k={0}";     //83549 20160104 DV. Client requested key change
                break;

            case PartnerStoreTypes.Quilbed:
                node.Key     = "783QUILBED618998";
                node.IV      = "IV99806754323712";
                node.BaseUrl = "http://quilbed.com/?k={0}";
                break;

            default:
                break;
            }

            return(node);
        }
示例#2
0
        /// <summary>
        /// NEED TO REWORK THIS TO ACCEPT MULTIPLE PARTNER STORE PARAMS FOR ONE CALL
        /// </summary>
        /// <param name="referralID"></param>
        /// <param name="customerID"></param>
        /// <param name="urlEncode"></param>
        /// <param name="additionalQueryParams"></param>
        /// <returns></returns>
        public static PartnerStoreNode GetPartnerStoreUrl(int referralID, int customerID = 0, bool urlEncode = true, PartnerStoreTypes type = PartnerStoreTypes.AllBrandsForYou, string additionalQueryParams = "")
        {
            var node = GetPartnerStoreNode(type);
            var url  = "";


            //var id = (customerID > 0) ? referralID.ToString() + "|" + customerID.ToString() : referralID.ToString();
            var id = referralID.ToString() + "|" + customerID.ToString();

            // Add a datetime stamp as well
            id += "|{0}".FormatWith(DateTime.UtcNow.ToString("g"));

            // Save our raw ID
            node.RawID = id;


            var encryptedID = StoreEncrypt(id, Encoding.UTF8.GetBytes(node.Key), Encoding.UTF8.GetBytes(node.IV));

            if (urlEncode)
            {
                encryptedID = HttpUtility.UrlEncode(encryptedID);
            }

            // Add in our encrypted version of the ID field
            node.Encrypted = encryptedID;

            url = node.BaseUrl.FormatWith(encryptedID);

            if (!additionalQueryParams.IsNullOrEmpty())
            {
                url += additionalQueryParams;
            }

            node.Url = url;

            return(node);
        }