Beispiel #1
0
        public static string CreateHashString(PointCheckWithTokenRequest request, string secretKey)
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("MERCHANT", request.MERCHANT);
            dictionary.Add("CURRENCY", request.CURRENCY);
            dictionary.Add("DATE", request.DATE);
            dictionary.Add("TOKEN", request.TOKEN);
            var    ordered = dictionary.OrderBy(x => x.Key);
            string hash    = string.Empty;

            foreach (var item in ordered)
            {
                hash += "&" + item.Key + "=" + item.Value;
            }
            hash = hash.Substring(1);

            hash += "&HASH=" + CreateMD5Hash(secretKey, dictionary);
            return(hash);
        }
Beispiel #2
0
        public static PointCheckResponse Execute(PointCheckWithTokenRequest request, Options options)
        {
            var hashString = CreateHashString(request, options.SecretKey);

            return(HttpCaller.Create().PostData <PointCheckResponse>(options.Url, hashString));
        }