public EzPayInvoiceInvalidResponse InvalidInvoice(ref EzPayInvoiceInvalidInfo ezPayInvoiceInvalidInfo) { ezPayInvoiceInvalidInfo.Version = string.IsNullOrEmpty(ezPayInvoiceInvalidInfo.Version) ? _configService.EzPayInvoiceInvalidVersion : ezPayInvoiceInvalidInfo.Version; ezPayInvoiceInvalidInfo.RespondType = "JSON"; ezPayInvoiceInvalidInfo.TimeStamp = UnixDateTimeService.GetUNIX(DateTime.Now).ToString(); EzPayInvoiceInvalidResponse response = null; var request = new EzPayInvoiceRequest() { MerchantID_ = _configService.EzPayMerchantId, PostData_ = HashService.EncryptAESHex(ezPayInvoiceInvalidInfo.GetDataString(), _configService.EzPayHashKey, _configService.EzPayHashIv) }; FormUrlEncodedContent formContent = new FormUrlEncodedContent(new[] { new KeyValuePair <string, string>(nameof(request.MerchantID_), request.MerchantID_), new KeyValuePair <string, string>(nameof(request.PostData_), request.PostData_) }); string responseBody = HttpService.PostForm(_configService.EzPayInvoiceInvalid, formContent); if (!string.IsNullOrEmpty(responseBody)) { var deserializeObj = JsonConvert.DeserializeObject <JObject>(responseBody); response = new EzPayInvoiceInvalidResponse() { Message = deserializeObj.GetValue("Message").ToString(), Status = deserializeObj.GetValue("Status").ToString(), }; if (response.IsSucceed) { response.Result = JsonConvert.DeserializeObject <EzPayInvoiceInvalidResult>(deserializeObj.GetValue("Result").ToString()); } } return(response); }
private string GetQueryTradeInfoCheckValue(string queryTradeInfo, string hashKey, string hashIv) { return(HashService.EncryptSHA256($"IV={hashIv}&{queryTradeInfo}&Key={hashKey}")); }
private string GetTradeSha(string aesTradeInfoString, string hashKey, string hashIv) { return(HashService.EncryptSHA256($"HashKey={hashKey}&{aesTradeInfoString}&HashIV={hashIv}")); }
private string GetCheckCode(string checkCodeInfoString, string hashKey, string hashIv) { return(HashService.EncryptSHA256($"HashIV={hashIv}&{checkCodeInfoString}&HashKey={hashKey}")); }