com.github.binarywang.wxpay.bean.request.WxPayDownloadBillRequest Maven / Gradle / Ivy
package com.github.binarywang.wxpay.bean.request;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import me.chanjar.weixin.common.annotation.Required;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
/**
*
* 微信支付下载对账单请求参数类
* Created by Binary Wang on 2017-01-11.
* @author binarywang(Binary Wang)
*
*/
@XStreamAlias("xml")
public class WxPayDownloadBillRequest extends WxPayBaseRequest {
private static final String[] BILL_TYPE = new String[]{"ALL", "REFUND", "SUCCESS"};
/**
*
* 设备号
* device_info
* 否
* String(32)
* 13467007045764
* 终端设备号
*
*/
@XStreamAlias("device_info")
private String deviceInfo;
/**
*
* 签名类型
* sign_type
* 否
* String(32)
* HMAC-SHA256
* 签名类型,目前支持HMAC-SHA256和MD5,默认为MD5
*
*/
@XStreamAlias("sign_type")
private String signType;
/**
*
* 账单类型
* bill_type
* 是
* ALL
* String(8)
* --ALL,返回当日所有订单信息,默认值
* --SUCCESS,返回当日成功支付的订单
* --REFUND,返回当日退款订单
*
*/
@Required
@XStreamAlias("bill_type")
private String billType;
/**
*
* 对账单日期
* bill_date
* 是
* String(8)
* 20140603
* 下载对账单的日期,格式:20140603
*
*/
@Required
@XStreamAlias("bill_date")
private String billDate;
/**
*
* 压缩账单
* tar_type
* 否
* String(8)
* GZIP
* 非必传参数,固定值:GZIP,返回格式为.gzip的压缩包账单。不传则默认为数据流形式。
*
*/
@XStreamAlias("tar_type")
private String tarType;
public String getDeviceInfo() {
return deviceInfo;
}
public void setDeviceInfo(String deviceInfo) {
this.deviceInfo = deviceInfo;
}
public String getSignType() {
return signType;
}
public void setSignType(String signType) {
this.signType = signType;
}
public String getBillType() {
return billType;
}
public void setBillType(String billType) {
this.billType = billType;
}
public String getBillDate() {
return billDate;
}
public void setBillDate(String billDate) {
this.billDate = billDate;
}
public String getTarType() {
return tarType;
}
public void setTarType(String tarType) {
this.tarType = tarType;
}
@Override
protected void checkConstraints() throws WxPayException {
if (StringUtils.isNotBlank(this.getTarType()) && !"GZIP".equals(this.getTarType())) {
throw new WxPayException("tar_type值如果存在,只能为GZIP");
}
if (!ArrayUtils.contains(BILL_TYPE, this.getBillType())) {
throw new WxPayException(String.format("bill_tpye目前必须为%s其中之一,实际值:%s",
Arrays.toString(BILL_TYPE), this.getBillType()));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy