예제 #1
0
        /// <summary>
        /// Thanh toan khach hang
        /// Hash: Loyalty/Payment/[IP]/[TID]/[KEY]/[SYSTEM]/[AMOUNT]/[LOGIN]/[PWD]
        /// </summary>
        /// <param name="login"></param>
        /// <param name="system">998/993</param>
        /// <param name="amount"></param>
        /// <param name="TID"></param>
        /// <param name="userIP"></param>
        /// <returns></returns>
        public async System.Threading.Tasks.Task <string> ApiLoyaltyPayments(string login, string system, string amount, string TID, string userIP)
        {
            string strMdD5 = hashMD5.HashLoyaltypayments(system, amount, login, TID);

            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri(URL_API_FUNDIST);
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
                HttpResponseMessage response = (await client.PostAsync("System/Api/" + API_KEY + "/Loyalty/Payment?&Login="******"&System=" + system + "&Amount=" + amount + "&TID=" + TID + "&Hash=" + strMdD5 + "&UserIP=" + userIP, null));
                if (response.IsSuccessStatusCode)
                {
                    return(response.Content.ReadAsStringAsync().Result);
                }
                return(null);
            }
        }