🆕 #1789 微信支付电商收付通增加下载账单的接口

This commit is contained in:
f00lish
2020-09-29 12:40:11 +08:00
committed by GitHub
parent b797152199
commit 429f1706a4
9 changed files with 292 additions and 3 deletions

View File

@@ -0,0 +1,86 @@
package com.github.binarywang.wxpay.bean.ecommerce;
import com.google.gson.annotations.SerializedName;
import lombok.*;
/**
* 账单请求
* @author: f00lish
* @date: 2020/09/28
*/
@Data
@Builder
@ToString
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class BillRequest {
/**
* <pre>
* 字段名:账单日期
* 变量名bill_date
* 是否必填:是
* 类型string10
* 描述:
* 格式YYYY-MM-DD
* 仅支持三个月内的账单下载申请。
* 示例值2019-06-11
* </pre>
*/
@SerializedName(value = "bill_date")
private String billDate;
/**
* <pre>
* 字段名:二级商户号
* 变量名sub_mchid
* 是否必填:否
* 类型string12
* 描述:
* 1、若商户是直连商户无需填写该字段。
* 2、若商户是服务商
* ● 不填则默认返回服务商下的交易或退款数据。
* ● 如需下载某个子商户下的交易或退款数据,则该字段必填。
* 特殊规则最小字符长度为8
* 注意:仅适用于电商平台 服务商
* 示例值1900000001
* </pre>
*/
@SerializedName(value = "sub_mchid")
private String subMchid;
/**
* <pre>
* 字段名:账单类型
* 变量名bill_type
* 是否必填:否
* 类型string32
* 描述:
* 不填则默认是ALL
* 枚举值:
* ALL返回当日所有订单信息不含充值退款订单
* SUCCESS返回当日成功支付的订单不含充值退款订单
* REFUND返回当日退款订单不含充值退款订单
* 示例值ALL
* </pre>
*/
@SerializedName(value = "bill_type")
private String billType;
/**
* <pre>
* 字段名:压缩类型
* 变量名tar_type
* 是否必填:否
* 类型string32
* 描述:
* 不填则默认是数据流
* 枚举值:
* GZIP返回格式为.gzip的压缩包账单
* 示例值GZIP
* </pre>
*/
@SerializedName(value = "tar_type")
private String tarType;
}

View File

@@ -0,0 +1,60 @@
package com.github.binarywang.wxpay.bean.ecommerce;
import com.google.gson.annotations.SerializedName;
import lombok.*;
/**
* 账单结果
* @author: f00lish
* @date: 2020/09/28
*/
@Data
@Builder
@ToString
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class BillResult {
/**
* <pre>
* 字段名:哈希类型
* 变量名hash_type
* 是否必填:是
* 类型string32
* 描述:
* 原始账单gzip需要解压缩的摘要值用于校验文件的完整性。
* 示例值SHA1
* </pre>
*/
@SerializedName(value = "hash_type")
private String hashType;
/**
* <pre>
* 字段名:哈希值
* 变量名hash_value
* 是否必填:是
* 类型string1024
* 描述:
* 原始账单gzip需要解压缩的摘要值用于校验文件的完整性。
* 示例值79bb0f45fc4c42234a918000b2668d689e2bde04
* </pre>
*/
@SerializedName(value = "hash_value")
private String hashValue;
/**
* <pre>
* 字段名:账单下载地址
* 变量名download_url
* 是否必填:是
* 类型string32
* 描述:
* 供下一步请求账单文件的下载地址该地址30s内有效。
* 示例值https://api.mch.weixin.qq.com/v3/billdownload/file?token=xxx
* </pre>
*/
@SerializedName(value = "download_url")
private String downloadUrl;
}

View File

@@ -0,0 +1,30 @@
package com.github.binarywang.wxpay.bean.ecommerce.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 账单类型
* @author: f00lish
* @date: 2020/09/28
*/
@Getter
@AllArgsConstructor
public enum BillTypeEnum {
/**
* 交易账单
*/
TRADE_BILL("%s/v3/bill/tradebill?%s"),
/**
* 资金账单
*/
FUND_FLOW_BILL("%s/v3/bill/fundflowbill?%s");
/**
* url
*/
private final String url;
}