using System.Threading.Tasks;
using PaySharp.Core.Request;
using PaySharp.Core.Utils;
namespace PaySharp.Alipay.Response
{
public class BillDownloadResponse : BaseResponse
{
///
/// 账单下载地址链接,获取连接后30秒后未下载,链接地址失效。
///
public string BillDownloadUrl { get; set; }
private byte[] _billFile;
///
/// 获取账单文件
///
public byte[] GetBillFile()
{
if (_billFile == null && !string.IsNullOrEmpty(BillDownloadUrl))
{
_billFile = HttpUtil.Download(BillDownloadUrl);
}
return _billFile;
}
///
/// 获取账单文件
///
public async Task GetBillFileAsync()
{
if (_billFile == null && !string.IsNullOrEmpty(BillDownloadUrl))
{
_billFile = await HttpUtil.DownloadAsync(BillDownloadUrl);
}
return _billFile;
}
internal override void Execute(Merchant merchant, Request request)
{
}
}
}