public async Task <IActionResult> BillDownloadurlQuery(string bill_type, string bill_date) { var model = new AlipayDataDataserviceBillDownloadurlQueryModel { BillDate = bill_type, BillType = bill_date }; var req = new AlipayDataDataserviceBillDownloadurlQueryRequest(); req.SetBizModel(model); var response = await _client.ExecuteAsync(req); ResponseModel responseModel = new ResponseModel() { code = HTTPResponseCode.PartialContent, message = string.Empty, data = response.Body }; if (response.IsError) { responseModel.code = HTTPResponseCode.BadRequest; responseModel.message = response.Msg; } else { responseModel.code = HTTPResponseCode.Successful; } return(Json(responseModel)); }
/// <summary> /// 获取某天的对账单的下载地址(商户可通过接口下载指定日期(当天除外)的业务明细账单文件,并结合自身业务系统实现自动对账。该下载链接仅30秒,在得到链接后系统需要立刻请求下载账单文件。) /// </summary> public string GetBillDownloadUrl(DateTime date) { string url = string.Empty; //组装业务参数 var model = new AlipayDataDataserviceBillDownloadurlQueryModel() { BillType = "trade", BillDate = date.ToString("yyyy-MM-dd") }; var request = new AlipayDataDataserviceBillDownloadurlQueryRequest(); request.SetBizModel(model); AlipayDataDataserviceBillDownloadurlQueryResponse response = aopClient.Execute(request); if (response != null && response.Code == "10000") { url = response.BillDownloadUrl; } //记日志response.ToJson(); return(url); }
public async Task <IActionResult> BillDownloadurlQuery(string bill_date, string bill_type) { var model = new AlipayDataDataserviceBillDownloadurlQueryModel() { BillDate = bill_date, BillType = bill_type }; var req = new AlipayDataDataserviceBillDownloadurlQueryRequest(); req.SetBizModel(model); var response = await _client.ExecuteAsync(req); return(Ok(response.Body)); }
public async Task <IActionResult> BillDownloadurlQuery(AlipayBillDownloadurlQueryViewModel viewModel) { var model = new AlipayDataDataserviceBillDownloadurlQueryModel { BillDate = viewModel.BillDate, BillType = viewModel.BillType }; var req = new AlipayDataDataserviceBillDownloadurlQueryRequest(); req.SetBizModel(model); var response = await _client.ExecuteAsync(req, _optionsAccessor.Value); ViewData["response"] = response.ResponseBody; return(View()); }