public static string CreateHashString(PointCheckRequest 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("CC_CVV", request.CC_CVV); dictionary.Add("CC_OWNER", request.CC_OWNER); dictionary.Add("EXP_YEAR", request.EXP_YEAR); dictionary.Add("EXP_MONTH", request.EXP_MONTH); dictionary.Add("CC_NUMBER", request.CC_NUMBER); 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); }
public static PointCheckResponse Execute(PointCheckRequest request, Options options) { var hashString = CreateHashString(request, options.SecretKey); return(HttpCaller.Create().PostData <PointCheckResponse>(options.Url, hashString)); }