コード例 #1
0
        public static NameValueCollection CreateHashString(BinV2Request request, string secretKey)
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("merchant", request.MERCHANT);
            dictionary.Add("extraInfo", request.EXTRAINFO);
            dictionary.Add("dateTime", request.DATETIME);
            dictionary.Add("cc_cvv", request.CC_CVV);
            dictionary.Add("cc_owner", request.CC_OWNER);
            dictionary.Add("exp_month", request.EXP_MONTH);
            dictionary.Add("exp_year", request.EXP_YEAR);
            dictionary.Add("cc_number", request.CC_NUMBER);
            var ordered = dictionary.OrderBy(x => x.Key);


            NameValueCollection collection = new NameValueCollection();

            collection.Add("cc_cvv", request.CC_CVV);
            collection.Add("cc_number", request.CC_NUMBER);
            collection.Add("cc_owner", request.CC_OWNER);
            collection.Add("dateTime", request.DATETIME);
            collection.Add("exp_month", request.EXP_MONTH);
            collection.Add("exp_year", request.EXP_YEAR);
            collection.Add("extraInfo", request.EXTRAINFO);
            collection.Add("merchant", request.MERCHANT);
            collection.Add("signature", CreateSHA256Hash(secretKey, dictionary));
            return(collection);
        }
コード例 #2
0
        public static string Execute(BinV2Request request, Options options)
        {
            var nameValueCollection = CreateHashString(request, options.SecretKey);

            return(HttpCaller.PostDataArrayReturnString(options.Url, nameValueCollection));
        }