Exemplo n.º 1
0
        /// <summary>
        /// Comfirm trạng thái giao dịch
        /// </summary>
        /// <param name="TenantId"></param>
        /// <param name="merchant_trans_id">Mã giao dịch</param>
        /// <param name="good_code">Mã đơn hàng</param>
        /// <param name="trans_id">Mã Giao dịch của Keypay</param>
        /// <param name="trans_result">Trạng thái xử lý 0: Thành công| 1 Thất bại</param>
        /// <returns>
        /// Thành công : yyy|00 |MD5(yyy + 00 + Merchant_secure_key)
        /// Thất bại : 011|xx |MD5(011 + xx + Merchant_secure_key)
        /// </returns>
        public async Task <string> ConfirmTransResult(int TenantId, string merchant_trans_id, string good_code, string trans_id, string trans_result)
        {
            var KEYPAY_MERCHANT_KEY = await SettingManager.GetSettingValueForTenantAsync(AppSettings.Payment.KEYPAY_MERCHANT_KEY, TenantId);

            var KEYPAY_MERCHANT_CODE = await SettingManager.GetSettingValueForTenantAsync(AppSettings.Payment.KEYPAY_MERCHANT_CODE, TenantId);

            string          _keyHash     = KEYPAY_MERCHANT_CODE + good_code + merchant_trans_id + trans_id + trans_result + KEYPAY_MERCHANT_KEY;
            Secure_Hash_MD5 md5          = new Secure_Hash_MD5();
            string          _Secure_hash = md5.GetMD5Hash(_keyHash);

            //Call service
            kpWebservices webservice = new kpWebservices();

            return(webservice.ConfirmTransResult(KEYPAY_MERCHANT_CODE, good_code, merchant_trans_id, trans_id, trans_result, _Secure_hash));
        }
Exemplo n.º 2
0
        public async Task <string> QueryBillStatusV2_MD5(int TenantId, string Merchant_trans_id, string Good_code, string Trans_time)
        {
            var KEYPAY_MERCHANT_KEY = await SettingManager.GetSettingValueForTenantAsync(AppSettings.Payment.KEYPAY_MERCHANT_KEY, TenantId);

            var KEYPAY_MERCHANT_CODE = await SettingManager.GetSettingValueForTenantAsync(AppSettings.Payment.KEYPAY_MERCHANT_CODE, TenantId);

            string          _keyHash     = KEYPAY_MERCHANT_CODE + Merchant_trans_id + Good_code + Trans_time + KEYPAY_MERCHANT_KEY;
            Secure_Hash_MD5 md5          = new Secure_Hash_MD5();
            string          _Secure_hash = md5.GetMD5Hash(_keyHash);

            //Call service
            kpWebservices webservice = new kpWebservices();

            return(webservice.QuerryBillStatusV2(KEYPAY_MERCHANT_CODE, Merchant_trans_id, Good_code, Trans_time, _Secure_hash));
        }