diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsNotifyResult.java deleted file mode 100644 index dcfae88247..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsNotifyResult.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - * 合单支付 通知结果 - *
- * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/combine/chapter3_7.shtml - *- */ -@Data -@NoArgsConstructor -public class CombineTransactionsNotifyResult implements Serializable { - - private static final long serialVersionUID = -4710926828683593250L; - /** - * 源数据 - */ - private NotifyResponse rawData; - - /** - * 解密后的数据 - */ - private CombineTransactionsResult result; - -} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsRequest.java deleted file mode 100644 index 3f285285ae..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsRequest.java +++ /dev/null @@ -1,459 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import com.google.gson.annotations.SerializedName; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; -import java.util.List; - -/** - * 合单支付API - *
- * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/e-combine.shtml - *- */ -@Data -@NoArgsConstructor -public class CombineTransactionsRequest implements Serializable { - private static final long serialVersionUID = -1242741645939606441L; - /** - *
- * 字段名:合单商户appid - * 变量名:combine_appid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 合单发起方的appid。 - * 示例值:wxd678efh567hg6787 - *- */ - @SerializedName(value = "combine_appid") - private String combineAppid; - - /** - *
- * 字段名:合单商户号 - * 变量名:combine_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 合单发起方商户号。 - * 示例值:1900000109 - *- */ - @SerializedName(value = "combine_mchid") - private String combineMchid; - - /** - *
- * 字段名:合单商户订单号 - * 变量名:combine_out_trade_no - * 是否必填:是 - * 类型:string(32) - * 描述: - * 合单支付总订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 - * 示例值:P20150806125346 - *- */ - @SerializedName(value = "combine_out_trade_no") - private String combineOutTradeNo; - - /** - *
- * 字段名:+场景信息 - * 变量名:scene_info - * 是否必填:否 - * 类型:object - * 描述:支付场景信息描述 - *- */ - @SerializedName(value = "scene_info") - private SceneInfo sceneInfo; - - /** - *
- * 字段名:+子单信息 - * 变量名:sub_orders - * 是否必填:是 - * 类型:array - * 描述: - * 最多支持子单条数:50 - * - *- */ - @SerializedName(value = "sub_orders") - private List
- * 字段名:+支付者 - * 变量名:combine_payer_info - * 是否必填:否(JSAPI必填) - * 类型:object - * 描述:支付者信息 - *- */ - @SerializedName(value = "combine_payer_info") - private CombinePayerInfo combinePayerInfo; - - /** - *
- * 字段名:交易起始时间 - * 变量名:time_start - * 是否必填:否 - * 类型:string(14) - * 描述: - * 订单生成时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 - * 示例值:2019-12-31T15:59:60+08:00 - *- */ - @SerializedName(value = "time_start") - private String timeStart; - - /** - *
- * 字段名:交易结束时间 - * 变量名:time_expire - * 是否必填:否 - * 类型:string(14) - * 描述: - * 订单失效时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 - * 示例值:2019-12-31T15:59:60+08:00 - *- */ - @SerializedName(value = "time_expire") - private String timeExpire; - - /** - *
- * 字段名:通知地址 - * 变量名:notify_url - * 是否必填:是 - * 类型:string(256) - * 描述: - * 接收微信支付异步通知回调地址,通知url必须为直接可访问的URL,不能携带参数。 - * 格式: URL - * 示例值:https://yourapp.com/notify - *- */ - @SerializedName(value = "notify_url") - private String notifyUrl; - - - @Data - @NoArgsConstructor - public static class SceneInfo implements Serializable { - /** - *
- * 字段名:商户端设备号 - * 变量名:device_id - * 是否必填:否 - * 类型:string(16) - * 描述: - * 终端设备号(门店号或收银设备ID)。 - * 特殊规则:长度最小7个字节 - * 示例值:POS1:1 - *- */ - @SerializedName(value = "device_id") - private String deviceId; - - /** - *
- * 字段名:用户终端IP - * 变量名:payer_client_ip - * 是否必填:是 - * 类型:string(45) - * 描述: - * 用户端实际ip - * 格式: ip(ipv4+ipv6) - * 示例值:14.17.22.32 - *- */ - @SerializedName(value = "payer_client_ip") - private String payerClientIp; - - /** - *
- * 字段名:H5场景信息 - * 变量名:h5_info - * 是否必填:否(H5支付必填) - * 类型:object - * 描述: - * H5场景信息 - *- */ - @SerializedName(value = "h5_info") - private H5Info h5Info; - } - - @Data - @NoArgsConstructor - public static class SubOrders implements Serializable { - /** - *
- * 字段名:子单商户号 - * 变量名:mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 子单发起方商户号,必须与发起方appid有绑定关系。 - * 示例值:1900000109 - * 此处一般填写服务商商户号 - *- */ - @SerializedName(value = "mchid") - private String mchid; - - /** - *
- * 字段名:附加信息 - * 变量名:attach - * 是否必填:是 - * 类型:string(128) - * 描述: - * 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用。 - * 示例值:深圳分店 - *- */ - @SerializedName(value = "attach") - private String attach; - - /** - *
- * 字段名:+订单金额 - * 变量名:amount - * 是否必填:是 - * 类型:object - * 描述: - *- */ - @SerializedName(value = "amount") - private Amount amount; - - /** - *
- * 字段名:子单商户订单号 - * 变量名:out_trade_no - * 是否必填:是 - * 类型:string(32) - * 描述: - * 商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 - * 特殊规则:最小字符长度为6 - * 示例值:20150806125346 - *- */ - @SerializedName(value = "out_trade_no") - private String outTradeNo; - - /** - *
- * 字段名:二级商户号 - * 变量名:sub_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 二级商户商户号,由微信支付生成并下发。 - * 注意:仅适用于电商平台 服务商 - * 示例值:1900000109 - *- */ - @SerializedName(value = "sub_mchid") - private String subMchid; - - /** - *
- * 字段名:商品描述 - * 变量名:description - * 是否必填:是 - * 类型:string(128) - * 描述: - * 商品简单描述。需传入应用市场上的APP名字-实际商品名称,例如:天天爱消除-游戏充值。 - * 示例值:腾讯充值中心-QQ会员充值 - *- */ - @SerializedName(value = "description") - private String description; - - /** - *
- * 字段名:+结算信息 - * 变量名:settle_info - * 是否必填:否 - * 类型:Object - * 描述:结算信息 - *- */ - @SerializedName(value = "settle_info") - private SettleInfo settleInfo; - - } - - @Data - @NoArgsConstructor - public static class CombinePayerInfo implements Serializable { - /** - *
- * 字段名:用户标识 - * 变量名:openid - * 是否必填:是 - * 类型:string(128) - * 描述: - * 使用合单appid获取的对应用户openid。是用户在商户appid下的唯一标识。 - * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o - *- */ - @SerializedName(value = "openid") - private String openid; - - } - - @Data - @NoArgsConstructor - public static class Amount implements Serializable { - /** - *
- * 字段名:标价金额 - * 变量名:total_amount - * 是否必填:是 - * 类型:int64 - * 描述: - * 子单金额,单位为分。 - * 示例值:100 - *- */ - @SerializedName(value = "total_amount") - private Integer totalAmount; - - /** - *
- * 字段名:标价币种 - * 变量名:currency - * 是否必填:是 - * 类型:string(8) - * 描述: - * 符合ISO 4217标准的三位字母代码,人民币:CNY。 - * 示例值:CNY - *- */ - @SerializedName(value = "currency") - private String currency; - - } - - @Data - @NoArgsConstructor - public static class SettleInfo implements Serializable { - /** - *
- * 字段名:是否指定分账 - * 变量名:profit_sharing - * 是否必填:否 - * 类型:bool - * 描述: - * 是否分账,与外层profit_sharing同时存在时,以本字段为准。 - * true:是 - * false:否 - * 示例值:true - *- */ - @SerializedName(value = "profit_sharing") - private Boolean profitSharing; - - /** - *
- * 字段名:补差金额 - * 变量名:subsidy_amount - * 是否必填:否 - * 类型:int64 - * 描述: - * SettleInfo.profit_sharing为true时,该金额才生效。 - * 示例值:10 - *- */ - @SerializedName(value = "subsidy_amount") - private Integer subsidyAmount; - - } - - @Data - @NoArgsConstructor - public static class H5Info implements Serializable { - - /** - *
- * 字段名:场景类型 - * 变量名:type - * 是否必填:是 - * 类型:string(32) - * 描述: - * 场景类型,枚举值: - * iOS:IOS移动应用; - * Android:安卓移动应用; - * Wap:WAP网站应用; - * 示例值:iOS - *- */ - @SerializedName(value = "type") - private String type; - - /** - *
- * 字段名:应用名称 - * 变量名:app_name - * 是否必填:否 - * 类型:string(64) - * 描述: - * 应用名称 - * 示例值:王者荣耀 - *- */ - @SerializedName(value = "app_name") - private String appName; - - /** - *
- * 字段名:网站URL - * 变量名:app_url - * 是否必填:否 - * 类型:string(128) - * 描述: - * 网站URL - * 示例值:https://pay.qq.com - *- */ - @SerializedName(value = "app_url") - private String appUrl; - - /** - *
- * 字段名:iOS平台BundleID - * 变量名:bundle_id - * 是否必填:否 - * 类型:string(128) - * 描述: - * iOS平台BundleID - * 示例值:com.tencent.wzryiOS - *- */ - @SerializedName(value = "bundle_id") - private String bundleId; - - /** - *
- * 字段名:Android平台PackageName - * 变量名:package_name - * 是否必填:否 - * 类型:string(128) - * 描述: - * Android平台PackageName - * 示例值:com.tencent.tmgp.sgame - *- */ - @SerializedName(value = "package_name") - private String packageName; - - } - -} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsResult.java deleted file mode 100644 index 1b929ed96f..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsResult.java +++ /dev/null @@ -1,353 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import com.google.gson.annotations.SerializedName; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; -import java.util.List; - -/** - * 合单支付 查询结果 - *
- * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/combine/chapter3_3.shtml - *- */ -@Data -@NoArgsConstructor -public class CombineTransactionsResult implements Serializable { - - /** - *
- * 字段名:合单商户appid - * 变量名:combine_appid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 合单发起方的appid。(即电商平台appid) - * 示例值:wxd678efh567hg6787 - *- */ - @SerializedName(value = "combine_appid") - private String combineAppid; - - /** - *
- * 字段名:合单商户号 - * 变量名:combine_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 合单发起方商户号。(即电商平台mchid) - * 示例值:1900000109 - *- */ - @SerializedName(value = "combine_mchid") - private String combineMchid; - - /** - *
- * 字段名:合单商户订单号 - * 变量名:combine_out_trade_no - * 是否必填:是 - * 类型:string(32) - * 描述: - * 合单支付总订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 - * 示例值:P20150806125346 - *- */ - @SerializedName(value = "combine_out_trade_no") - private String combineOutTradeNo; - - /** - *
- * 字段名:+场景信息 - * 变量名:scene_info - * 是否必填:否 - * 类型:object - * 描述:支付场景信息描述 - *- */ - @SerializedName(value = "scene_info") - private SceneInfo sceneInfo; - - /** - *
- * 字段名:+子单信息 - * 变量名:sub_orders - * 是否必填:是 - * 类型:array - * 描述: - * 最多支持子单条数:50 - * - *- */ - @SerializedName(value = "sub_orders") - private List
- * 字段名:+支付者 - * 变量名:combine_payer_info - * 是否必填:否 - * 类型:object - * 描述:示例值:见请求示例 - *- */ - @SerializedName(value = "combine_payer_info") - private CombinePayerInfo combinePayerInfo; - - @Data - @NoArgsConstructor - public static class SubOrders implements Serializable { - /** - *
- * 字段名:子单商户号 - * 变量名:mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 子单发起方商户号,必须与发起方Appid有绑定关系。(即电商平台mchid) - * 示例值:1900000109 - *- */ - @SerializedName(value = "mchid") - private String mchid; - - /** - *
- * 字段名:交易类型 - * 变量名:trade_type - * 是否必填:是 - * 类型:string (16) - * 描述: - * 枚举值: - * NATIVE:扫码支付 - * JSAPI:公众号支付 - * APP:APP支付 - * MWEB:H5支付 - * 示例值: JSAPI - *- */ - @SerializedName(value = "trade_type") - private String tradeType; - - /** - *
- * 字段名:交易状态 - * 变量名:trade_state - * 是否必填:是 - * 类型:string (32) - * 描述: - * 枚举值: - * SUCCESS:支付成功 - * REFUND:转入退款 - * NOTPAY:未支付 - * CLOSED:已关闭 - * USERPAYING:用户支付中 - * PAYERROR:支付失败(其他原因,如银行返回失败) - * 示例值: SUCCESS - *- */ - @SerializedName(value = "trade_state") - private String tradeState; - - /** - *
- * 字段名:付款银行 - * 变量名:bank_type - * 是否必填:否 - * 类型:string(16) - * 描述: - * 银行类型,采用字符串类型的银行标识。 - * 示例值:CMC - *- */ - @SerializedName(value = "bank_type") - private String bankType; - - /** - *
- * 字段名:附加信息 - * 变量名:attach - * 是否必填:是 - * 类型:string(128) - * 描述: - * 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用。 - * 示例值:深圳分店 - *- */ - @SerializedName(value = "attach") - private String attach; - - /** - *
- * 字段名:支付完成时间 - * 变量名:success_time - * 是否必填:是 - * 类型:string(16) - * 描述: - * 订单支付时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss:sss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss:sss表示时分秒毫秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35.120+08:00表示,北京时间2015年5月20日 13点29分35秒。 - * 示例值:2015-05-20T13:29:35.120+08:00 - *- */ - @SerializedName(value = "success_time") - private String successTime; - - /** - *
- * 字段名:微信订单号 - * 变量名:transaction_id - * 是否必填:是 - * 类型:string(32) - * 描述: - * 微信支付订单号。 - * 示例值: 1009660380201506130728806387 - *- */ - @SerializedName(value = "transaction_id") - private String transactionId; - - /** - *
- * 字段名:子单商户订单号 - * 变量名:out_trade_no - * 是否必填:是 - * 类型:string(32) - * 描述: - * 商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 - * 特殊规则:最小字符长度为6 - * 示例值:20150806125346 - *- */ - @SerializedName(value = "out_trade_no") - private String outTradeNo; - - /** - *
- * 字段名:二级商户号 - * 变量名:sub_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 二级商户商户号,由微信支付生成并下发。 - * 注意:仅适用于电商平台 服务商 - * 示例值:1900000109 - *- */ - @SerializedName(value = "sub_mchid") - private String subMchid; - - /** - *
- * 字段名:+订单金额 - * 变量名:amount - * 是否必填:是 - * 类型:object - * 描述:订单金额信息 - *- */ - @SerializedName(value = "amount") - private Amount amount; - - } - - @Data - @NoArgsConstructor - public static class SceneInfo implements Serializable { - /** - *
- * 字段名:商户端设备号 - * 变量名:device_id - * 是否必填:否 - * 类型:string(16) - * 描述: - * 终端设备号(门店号或收银设备ID)。 - * 特殊规则:长度最小7个字节 - * 示例值:POS1:1 - *- */ - @SerializedName(value = "device_id") - private String deviceId; - - } - - @Data - @NoArgsConstructor - public static class CombinePayerInfo implements Serializable { - /** - *
- * 字段名:用户标识 - * 变量名:openid - * 是否必填:是 - * 类型:string(128) - * 描述: - * 使用合单appid获取的对应用户openid。是用户在商户appid下的唯一标识。 - * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o - *- */ - @SerializedName(value = "openid") - private String openid; - - } - - @Data - @NoArgsConstructor - public static class Amount implements Serializable { - /** - *
- * 字段名:标价金额 - * 变量名:total_amount - * 是否必填:是 - * 类型:int64 - * 描述: - * 子单金额,单位为分。 - * 示例值:100 - *- */ - @SerializedName(value = "total_amount") - private Integer totalAmount; - - /** - *
- * 字段名:标价币种 - * 变量名:currency - * 是否必填:是 - * 类型:string(8) - * 描述: - * 符合ISO 4217标准的三位字母代码,人民币:CNY。 - * 示例值:CNY - *- */ - @SerializedName(value = "currency") - private String currency; - - /** - *
- * 字段名:现金支付金额 - * 变量名:payer_amount - * 是否必填:是 - * 类型:int64 - * 描述: - * 订单现金支付金额。 - * 示例值:10 - *- */ - @SerializedName(value = "payer_amount") - private Integer payerAmount; - - /** - *
- * 字段名:现金支付币种 - * 变量名:payer_currency - * 是否必填:是 - * 类型:string(8) - * 描述: - * 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY。 - * 示例值: CNY - *- */ - @SerializedName(value = "payer_currency") - private String payerCurrency; - } -} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsCloseRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsCloseRequest.java deleted file mode 100644 index c09c1aede6..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsCloseRequest.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import com.google.gson.annotations.SerializedName; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - * 关闭普通订单请求 - * - * @author f00lish - * created on 2020/12/09 - */ -@Data -@NoArgsConstructor -public class PartnerTransactionsCloseRequest implements Serializable { - - private static final long serialVersionUID = -7602636370950088329L; - - /** - *
- * 字段名:服务商户号 - * 变量名:sp_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 服务商户号,由微信支付生成并下发 - * 示例值:1230000109 - *- */ - @SerializedName(value = "sp_mchid") - private String spMchid; - - /** - *
- * 字段名:二级商户号 - * 变量名:sub_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 二级商户的商户号,有微信支付生成并下发。 - * 示例值:1900000109 - *- */ - @SerializedName(value = "sub_mchid") - private String subMchid; - - /** - *
- * 字段名:商户订单号 - * 变量名:out_trade_no - * 是否必填:是 - * 类型:string(32) - * 描述: - * 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。 - * 特殊规则:最小字符长度为6 - * 示例值:1217752501201407033233368018 - *- */ - private transient String outTradeNo; -} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsNotifyResult.java deleted file mode 100644 index 03d9535fa8..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsNotifyResult.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - * 普通支付 通知结果 - *
- * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/e_transactions/chapter3_11.shtml - *- */ -@Data -@NoArgsConstructor -public class PartnerTransactionsNotifyResult implements Serializable { - private static final long serialVersionUID = -6602962275015706689L; - /** - * 源数据 - */ - private NotifyResponse rawData; - - /** - * 解密后的数据 - */ - private PartnerTransactionsResult result; -} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsQueryRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsQueryRequest.java deleted file mode 100644 index 2b90e432bb..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsQueryRequest.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import com.google.gson.annotations.SerializedName; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -@Data -@NoArgsConstructor -public class PartnerTransactionsQueryRequest implements Serializable { - - - /** - *
- * 字段名:服务商户号 - * 变量名:sp_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 服务商户号,由微信支付生成并下发 - * 示例值:1230000109 - *- */ - @SerializedName(value = "sp_mchid") - private String spMchid; - - /** - *
- * 字段名:二级商户号 - * 变量名:sub_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 二级商户的商户号,有微信支付生成并下发。 - * 示例值:1900000109 - *- */ - @SerializedName(value = "sub_mchid") - private String subMchid; - - /** - *
- * 字段名:微信支付订单号 - * 变量名:transaction_id - * 是否必填:是 - * 类型:string(32) - * 描述: - * 微信支付系统生成的订单号 - * 示例值:1217752501201407033233368018 - *- */ - @SerializedName(value = "transaction_id") - private String transactionId; - /** - *
- * 字段名:商户订单号 - * 变量名:out_trade_no - * 是否必填:是 - * 类型:string(32) - * 描述: - * 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。 - * 特殊规则:最小字符长度为6 - * 示例值:1217752501201407033233368018 - *- */ - @SerializedName(value = "out_trade_no") - private String outTradeNo; -} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsRequest.java deleted file mode 100644 index efe0978247..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsRequest.java +++ /dev/null @@ -1,646 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.List; - -/** - * 普通支付(电商收付通)API - *
- * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/e_transactions.shtml - *- * - * @author cloudX - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class PartnerTransactionsRequest implements Serializable { - private static final long serialVersionUID = -1550405819444680465L; - - /** - *
- * 字段名:服务商公众号ID - * 变量名:sp_appid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 服务商申请的公众号或移动应用appid - * 示例值:wx8888888888888888 - *- */ - @SerializedName(value = "sp_appid") - private String spAppid; - /** - *
- * 字段名:服务商户号 - * 变量名:sp_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 服务商户号,由微信支付生成并下发 - * 示例值:1230000109 - *- */ - @SerializedName(value = "sp_mchid") - private String spMchid; - /** - *
- * 字段名:子商户公众号ID - * 变量名:sub_appid - * 是否必填:否 - * 类型:string(32) - * 描述: - * 子商户申请的公众号或移动应用appid。 - * 示例值:wxd678efh567hg6999 - *- */ - @SerializedName(value = "sub_appid") - private String subAppid; - /** - *
- * 字段名:二级商户号 - * 变量名:sub_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 二级商户的商户号,有微信支付生成并下发。 - * 示例值:1900000109 - *- */ - @SerializedName(value = "sub_mchid") - private String subMchid; - /** - *
- * 字段名:商品描述 - * 变量名:description - * 是否必填:是 - * 类型:string(127) - * 描述: - * 商品描述 - * 示例值:Image形象店-深圳腾大-QQ公仔 - *- */ - @SerializedName(value = "description") - private String description; - /** - *
- * 字段名:商户订单号 - * 变量名:out_trade_no - * 是否必填:是 - * 类型:string(127) - * 描述: - * 商户系统内部订单号, 只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】 - * 特殊规则:最小字符长度为6 - * 示例值:1217752501201407033233368018 - *- */ - @SerializedName(value = "out_trade_no") - private String outTradeNo; - /** - *
- * 字段名:交易结束时间 - * 变量名:time_expire - * 是否必填:否 - * 类型:string(14) - * 描述: - * 订单失效时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 - * 示例值:2019-12-31T15:59:60+08:00 - *- */ - @SerializedName(value = "time_expire") - private String timeExpire; - /** - *
- * 字段名:附加数据 - * 变量名:attach - * 是否必填:否 - * 类型:string(128) - * 描述: - * 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用。 - * 示例值:自定义数据 - *- */ - @SerializedName(value = "attach") - private String attach; - /** - *
- * 字段名:通知地址 - * 变量名:notify_url - * 是否必填:是 - * 类型:string(127) - * 描述: - * 通知URL必须为直接可访问的URL,不允许携带查询串。 - * 示例值:https://www.weixin.qq.com/wxpay/pay.php - *- */ - @SerializedName(value = "notify_url") - private String notifyUrl; - /** - *
- * 字段名:订单优惠标记 - * 变量名:goods_tag - * 是否必填:否 - * 类型:string(32) - * 描述: - * 订单优惠标记 - * 示例值:WXG - *- */ - @SerializedName(value = "goods_tag") - private String goodsTag; - /** - *
- * 字段名:电子发票入口开放标识 - * 变量名:support_fapiao - * 是否必填:否 - * 类型:boolean - * 描述:传入true时,支付成功消息和支付详情页将出现开票入口。需要在微信支付商户平台或微信公众平台开通电子发票功能,传此字段才可生效。 - *- */ - @SerializedName(value = "support_fapiao") - private Boolean supportFapiao; - /** - *
- * 字段名:+结算信息 - * 变量名:settle_info - * 是否必填:否 - * 类型:Object - * 描述:结算信息 - *- */ - @SerializedName(value = "settle_info") - private SettleInfo settleInfo; - /** - *
- * 字段名:订单金额 - * 变量名:amount - * 是否必填:是 - * 类型:object - * 描述: - * 订单金额信息 - *- */ - @SerializedName(value = "amount") - private Amount amount; - /** - *
- * 字段名:优惠功能 - * 变量名:detail - * 是否必填:否 - * 类型:object - * 描述: - * 优惠功能 - *- */ - @SerializedName(value = "detail") - private Discount detail; - /** - *
- * 字段名:支付者 - * 变量名:payer - * 是否必填:是(仅JSAPI支付必传) - * 类型:object - * 描述: - * 支付者信息 - *- */ - @SerializedName(value = "payer") - private Payer payer; - /** - *
- * 字段名:场景信息 - * 变量名:scene_info - * 是否必填:是(仅H5支付必传) - * 类型:object - * 描述: - * 支付场景描述 - *- */ - @SerializedName(value = "scene_info") - private SceneInfo sceneInfo; - - @Data - @NoArgsConstructor - public static class Discount implements Serializable { - private static final long serialVersionUID = 1090134053810201492L; - - /** - *
- * 字段名:订单原价 - * 变量名:cost_price - * 是否必填:否 - * 类型:int64 - * 描述: - * 1、商户侧一张小票订单可能被分多次支付,订单原价用于记录整张小票的交易金额。 - * 2、当订单原价与支付金额不相等,则不享受优惠。 - * 3、该字段主要用于防止同一张小票分多次支付,以享受多次优惠的情况,正常支付订单不必上传此参数。 - * 示例值:608800 - *- */ - @SerializedName(value = "cost_price") - private Integer costPrice; - /** - *
- * 字段名:商品小票ID - * 变量名:invoice_id - * 是否必填:否 - * 类型:string(32) - * 描述: - * 商品小票ID - * 示例值:微信123 - *- */ - @SerializedName(value = "invoice_id") - private String invoiceId; - /** - *
- * 字段名:单品列表 - * 变量名:goods_detail - * 是否必填:否 - * 类型:array - * 描述: - * 单品列表信息 - * 条目个数限制:【1,undefined】 - *- */ - @SerializedName(value = "goods_detail") - private List
- * 字段名:总金额 - * 变量名:total - * 是否必填:是 - * 类型:int64 - * 描述: - * 订单总金额,单位为分。 - * 示例值:100 - *- */ - @SerializedName(value = "total") - private Integer total; - /** - *
- * 字段名:币类型 - * 变量名:currency - * 是否必填:否 - * 类型:string(16) - * 描述: - * CNY:人民币,境内商户号仅支持人民币。 - * 示例值:CNY - *- */ - @SerializedName(value = "currency") - private String currency; - } - - @Data - @NoArgsConstructor - @AllArgsConstructor - public static class Payer implements Serializable { - private static final long serialVersionUID = -3946401119476159971L; - - /** - *
- * 字段名:用户服务标识 - * 变量名:sp_openid - * 是否必填:是 - * 类型:string(128) - * 描述: - * 用户在服务商appid下的唯一标识。 - * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o - *- */ - @SerializedName(value = "sp_openid") - private String spOpenid; - /** - *
- * 字段名:用户子标识 - * 变量名:sub_openid - * 是否必填:否 - * 类型:string(128) - * 描述: - * 用户在子商户appid下的唯一标识。 - * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o - *- */ - @SerializedName(value = "sub_openid") - private String subOpenid; - } - - @Data - @NoArgsConstructor - public static class SettleInfo implements Serializable { - private static final long serialVersionUID = 4438958789491671746L; - - /** - *
- * 字段名:是否指定分账 - * 变量名:profit_sharing - * 是否必填:否 - * 类型:bool - * 描述: - * 是否分账,与外层profit_sharing同时存在时,以本字段为准。 - * true:是 - * false:否 - * 示例值:true - *- */ - @SerializedName(value = "profit_sharing") - private Boolean profitSharing; - /** - *
- * 字段名:补差金额 - * 变量名:subsidy_amount - * 是否必填:否 - * 类型:int64 - * 描述: - * SettleInfo.profit_sharing为true时,该金额才生效。 - * 注意:单笔订单最高补差金额为5000元 - * 示例值:10 - *- */ - @SerializedName(value = "subsidy_amount") - private BigDecimal subsidyAmount; - } - - @Data - @NoArgsConstructor - public static class GoodsDetail implements Serializable { - private static final long serialVersionUID = -2574001236925022932L; - - /** - *
- * 字段名:商户侧商品编码 - * 变量名:merchant_goods_id - * 是否必填:是 - * 类型:string(32) - * 描述: - * 由半角的大小写字母、数字、中划线、下划线中的一种或几种组成。 - * 示例值:商品编码 - *- */ - @SerializedName(value = "merchant_goods_id") - private String merchantGoodsId; - /** - *
- * 字段名:微信侧商品编码 - * 变量名:wechatpay_goods_id - * 是否必填:否 - * 类型:string(32) - * 描述: - * 微信支付定义的统一商品编号(没有可不传) - * 示例值:1001 - *- */ - @SerializedName(value = "wechatpay_goods_id") - private String wechatpayGoodsId; - /** - *
- * 字段名:商品名称 - * 变量名:goods_name - * 是否必填:否 - * 类型:string(256) - * 描述: - * 商品的实际名称 - * 示例值:iPhoneX 256G - *- */ - @SerializedName(value = "goods_name") - private String goodsName; - /** - *
- * 字段名:商品数量 - * 变量名:quantity - * 是否必填:是 - * 类型:int64 - * 描述: - * 用户购买的数量 - * 示例值:1 - *- */ - @SerializedName(value = "quantity") - private Integer quantity; - /** - *
- * 字段名:商品单价 - * 变量名:unit_price - * 是否必填:是 - * 类型:int64 - * 描述: - * 商品单价,单位为分 - * 示例值:828800 - *- */ - @SerializedName(value = "unit_price") - private Integer unitPrice; - } - - @Data - @NoArgsConstructor - public static class SceneInfo implements Serializable { - private static final long serialVersionUID = 4678263124015070957L; - - /** - *
- * 字段名:商户端设备号 - * 变量名:device_id - * 是否必填:否 - * 类型:string(16) - * 描述: - * 终端设备号(门店号或收银设备ID)。 - * 特殊规则:长度最小7个字节 - * 示例值:POS1:1 - *- */ - @SerializedName(value = "device_id") - private String deviceId; - /** - *
- * 字段名:用户终端IP - * 变量名:payer_client_ip - * 是否必填:是 - * 类型:string(45) - * 描述: - * 用户端实际ip - * 格式: ip(ipv4+ipv6) - * 示例值:14.17.22.32 - *- */ - @SerializedName(value = "payer_client_ip") - private String payerClientIp; - /** - *
- * 字段名:H5场景信息 - * 变量名:h5_info - * 是否必填:否(H5支付必填) - * 类型:object - * 描述: - * H5场景信息 - *- */ - @SerializedName(value = "h5_info") - private H5Info h5Info; - /** - *
- * 字段名:商户门店信息 - * 变量名:store_info - * 是否必填:否(H5支付必填) - * 类型:object - * 描述: - * 商户门店信息 - *- */ - @SerializedName(value = "store_info") - private StoreInfo storeInfo; - } - - @Data - @NoArgsConstructor - public static class H5Info implements Serializable { - private static final long serialVersionUID = -6865738707329486532L; - - /** - *
- * 字段名:场景类型 - * 变量名:type - * 是否必填:是 - * 类型:string(32) - * 描述: - * 场景类型,枚举值: - * iOS:IOS移动应用; - * Android:安卓移动应用; - * Wap:WAP网站应用; - * 示例值:iOS - *- */ - @SerializedName(value = "type") - private String type; - /** - *
- * 字段名:应用名称 - * 变量名:app_name - * 是否必填:否 - * 类型:string(64) - * 描述: - * 应用名称 - * 示例值:王者荣耀 - *- */ - @SerializedName(value = "app_name") - private String appName; - /** - *
- * 字段名:网站URL - * 变量名:app_url - * 是否必填:否 - * 类型:string(128) - * 描述: - * 网站URL - * 示例值:https://pay.qq.com - *- */ - @SerializedName(value = "app_url") - private String appUrl; - /** - *
- * 字段名:iOS平台BundleID - * 变量名:bundle_id - * 是否必填:否 - * 类型:string(128) - * 描述: - * iOS平台BundleID - * 示例值:com.tencent.wzryiOS - *- */ - @SerializedName(value = "bundle_id") - private String bundleId; - /** - *
- * 字段名:Android平台PackageName - * 变量名:package_name - * 是否必填:否 - * 类型:string(128) - * 描述: - * Android平台PackageName - * 示例值:com.tencent.tmgp.sgame - *- */ - @SerializedName(value = "package_name") - private String packageName; - } - - @Data - @NoArgsConstructor - public static class StoreInfo implements Serializable { - private static final long serialVersionUID = -8002411737407580701L; - - /** - *
- * 字段名:门店编号 - * 变量名:id - * 是否必填:否 - * 类型:string(32) - * 描述: - * 商户侧门店编号 - * 示例值:0001 - *- */ - @SerializedName(value = "id") - private String id; - /** - *
- * 字段名:门店名称 - * 变量名:name - * 是否必填:是 - * 类型:string(256) - * 描述: - * 商户侧门店名称 - * 示例值:腾讯大厦分店 - *- */ - @SerializedName(value = "name") - private String name; - /** - *
- * 字段名:地区编码 - * 变量名:area_code - * 是否必填:是 - * 类型:string(32) - * 描述: - * 地区编码,详细请见省市区编号对照表(https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter4_1.shtml)。 - * 示例值:440305 - *- */ - @SerializedName(value = "area_code") - private String areaCode; - /** - *
- * 字段名:详细地址 - * 变量名:address - * 是否必填:是 - * 类型:string(512) - * 描述: - * 详细的商户门店地址 - * 示例值:广东省深圳市南山区科技中一道10000号 - *- */ - @SerializedName(value = "address") - private String address; - } -} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsResult.java deleted file mode 100644 index 2c9086e7f4..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsResult.java +++ /dev/null @@ -1,600 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import com.google.gson.annotations.SerializedName; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; -import java.util.List; - -/** - * 普通支付 查询结果 - *
- * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/e_transactions/chapter3_5.shtml - *- * @author cloudX - */ -@Data -@NoArgsConstructor -public class PartnerTransactionsResult implements Serializable { - private static final long serialVersionUID = 2371448241965534820L; - - /** - *
- * 字段名:服务商公众号ID - * 变量名:sp_appid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 服务商申请的公众号或移动应用appid。 - * 示例值:wx8888888888888888 - *- */ - @SerializedName(value = "sp_appid") - private String spAppid; - - /** - *
- * 字段名:服务商户号 - * 变量名:sp_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 服务商户号,由微信支付生成并下发 - * 示例值:1230000109 - *- */ - @SerializedName(value = "sp_mchid") - private String spMchid; - - /** - *
- * 字段名:二级商户公众号ID - * 变量名:sub_appid - * 是否必填:否 - * 类型:string(32) - * 描述: - * 二级商户申请的公众号或移动应用appid。 - * 示例值:wxd678efh567hg6999 - *- */ - @SerializedName(value = "sub_appid") - private String subAppid; - - /** - *
- * 字段名:二级商户号 - * 变量名:sub_mchid - * 是否必填:是 - * 类型:string(32) - * 描述: - * 二级商户的商户号,有微信支付生成并下发。 - * 示例值:1900000109 - *- */ - @SerializedName(value = "sub_mchid") - private String subMchid; - - /** - *
- * 字段名:+商户订单号 - * 变量名:out_trade_no - * 是否必填:是 - * 类型:string(32) - * 描述:商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。 - * 特殊规则:最小字符长度为6 - * 示例值:1217752501201407033233368018 - *- */ - @SerializedName(value = "out_trade_no") - private String outTradeNo; - - /** - *
- * 字段名:微信支付订单号 - * 变量名:transaction_id - * 是否必填:否 - * 类型:string(32) - * 描述:微信支付系统生成的订单号。 - * 示例值:1217752501201407033233368018 - *- */ - @SerializedName(value = "transaction_id") - private String transactionId; - - /** - *
- * 字段名:交易类型 - * 变量名:trade_type - * 是否必填:否 - * 类型:string(16) - * 描述:交易类型,枚举值: - * JSAPI:公众号支付 - * NATIVE:扫码支付 - * APP:APP支付 - * MICROPAY:付款码支付 - * MWEB:H5支付 - * FACEPAY:刷脸支付 - * - * 示例值: MICROPAY - *- */ - @SerializedName(value = "trade_type") - private String tradeType; - - /** - *
- * 字段名:交易状态 - * 变量名:trade_state - * 是否必填:是 - * 类型:string(32) - * 描述:交易状态,枚举值: - * SUCCESS:支付成功 - * REFUND:转入退款 - * NOTPAY:未支付 - * CLOSED:已关闭 - * REVOKED:已撤销(付款码支付) - * USERPAYING:用户支付中(付款码支付) - * PAYERROR:支付失败(其他原因,如银行返回失败) - * - * 示例值:SUCCESS - *- */ - @SerializedName(value = "trade_state") - private String tradeState; - - /** - *
- * 字段名:交易状态描述 - * 变量名:trade_state_desc - * 是否必填:是 - * 类型:string(256) - * 描述:交易状态描述 - * 示例值:支付失败,请重新下单支付 - *- */ - @SerializedName(value = "trade_state_desc") - private String tradeStateDesc; - - /** - *
- * 字段名:付款银行 - * 变量名:bank_type - * 是否必填:否 - * 类型:string(16) - * 描述:银行类型,采用字符串类型的银行标识。 - * 示例值:CMC - *- */ - @SerializedName(value = "bank_type") - private String bankType; - - /** - *
- * 字段名:附加数据 - * 变量名:attach - * 是否必填:否 - * 类型:string(128) - * 描述:附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用 - * 示例值:自定义数据 - *- */ - @SerializedName(value = "attach") - private String attach; - - /** - *
- * 字段名:支付完成时间 - * 变量名:success_time - * 是否必填:否 - * 类型:string(64) - * 描述:支付完成时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 - * 示例值:2018-06-08T10:34:56+08:00 - *- */ - @SerializedName(value = "success_time") - private String successTime; - - /** - *
- * 字段名:支付者信息 - * 变量名:payer - * 是否必填:是 - * 类型:object - * 描述:基础支付支付者信息 - *- */ - private CombinePayerInfo payer; - - /** - *
- * 字段名:支付者 - * 变量名:combine_payer_info - * 是否必填:否 - * 类型:object - * 描述:合单支付支付者信息,示例值:见请求示例 - *- */ - @SerializedName(value = "combine_payer_info") - private CombinePayerInfo combinePayerInfo; - - /** - *
- * 字段名:订单金额 - * 变量名:amount - * 是否必填:是 - * 类型:object - * 描述:订单金额信息 - *- */ - @SerializedName(value = "amount") - private Amount amount; - - /** - *
- * 字段名:场景信息 - * 变量名:scene_info - * 是否必填:否 - * 类型:object - * 描述:支付场景信息描述 - *- */ - @SerializedName(value = "scene_info") - private SceneInfo sceneInfo; - - /** - *
- * 字段名:优惠功能 - * 变量名:promotion_detail - * 是否必填:否 - * 类型:array - * 描述:优惠功能,享受优惠时返回该字段。 - *- */ - @SerializedName(value = "promotion_detail") - private List
- * 字段名:商户端设备号 - * 变量名:device_id - * 是否必填:否 - * 类型:string(16) - * 描述: - * 终端设备号(门店号或收银设备ID)。 - * 特殊规则:长度最小7个字节 - * 示例值:POS1:1 - *- */ - @SerializedName(value = "device_id") - private String deviceId; - - } - - @Data - @NoArgsConstructor - public static class CombinePayerInfo implements Serializable { - /** - *
- * 字段名:用户标识 - * 变量名:sp_openid - * 是否必填:是 - * 类型:string(128) - * 描述: - * 用户在服务商appid下的唯一标识。 - * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o - *- */ - @SerializedName(value = "sp_openid") - private String spOpenid; - - - /** - *
- * 字段名:二级商户用户标识 - * 变量名:sub_openid - * 是否必填:否 - * 类型:string(128) - * 描述: - * 用户在二级商户appid下的唯一标识。 - * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o - *- */ - @SerializedName(value = "sub_openid") - private String subOpenid; - - } - - @Data - @NoArgsConstructor - public static class Amount implements Serializable { - /** - *
- * 字段名:总金额 - * 变量名:total - * 是否必填:否 - * 类型:int - * 描述: - * 订单总金额,单位为分 - * 示例值:100 - *- */ - @SerializedName(value = "total") - private Integer total; - - - /** - *
- * 字段名:用户支付金额 - * 变量名:payer_total - * 是否必填:否 - * 类型:int - * 描述: - * 用户支付金额,单位为分。 - * 示例值:100 - *- */ - @SerializedName(value = "payer_total") - private Integer payerTotal; - - - /** - *
- * 字段名:货币类型 - * 变量名:currency - * 是否必填:否 - * 类型:string(16) - * 描述: - * CNY:人民币,境内商户号仅支持人民币。 - * 示例值:CNY - *- */ - @SerializedName(value = "currency") - private String currency; - - - /** - *
- * 字段名:用户支付币种 - * 变量名:payer_currency - * 是否必填:否 - * 类型:string(8) - * 描述: - * 用户支付币种 - * 示例值: CNY - *- */ - @SerializedName(value = "payer_currency") - private String payerCurrency; - } - - @Data - @NoArgsConstructor - public static class PromotionDetail implements Serializable { - - /** - *
- * 字段名:券ID - * 变量名:coupon_id - * 是否必填:是 - * 类型:string(32) - * 描述: 券ID - * 示例值:109519 - *- */ - @SerializedName(value = "coupon_id") - private String couponId; - - /** - *
- * 字段名:优惠名称 - * 变量名:name - * 是否必填:否 - * 类型:string(64) - * 描述: 优惠名称 - * 示例值:单品惠-6 - *- */ - @SerializedName(value = "name") - private String name; - /** - *
- * 字段名:优惠范围 - * 变量名:scope - * 是否必填:否 - * 类型:string(32) - * 描述: 优惠名称 - * 示例值: - * GLOBAL:全场代金券 - * SINGLE:单品优惠 - * 示例值:GLOBAL - *- */ - @SerializedName(value = "scope") - private String scope; - - /** - *
- * 字段名:优惠类型 - * 变量名:type - * 是否必填:否 - * 类型:string(32) - * 描述: - * CASH:充值 - * NOCASH:预充值 - * 示例值:CASH - *- */ - @SerializedName(value = "type") - private String type; - - /** - *
- * 字段名:优惠券面额 - * 变量名:amount - * 是否必填:是 - * 类型:int - * 描述: 优惠券面额 - * 示例值:100 - *- */ - @SerializedName(value = "amount") - private Integer amount; - - /** - *
- * 字段名:活动ID - * 变量名:stock_id - * 是否必填:否 - * 类型:string(32) - * 描述:活动ID - * 示例值:931386 - *- */ - @SerializedName(value = "stock_id") - private String stockId; - - /** - *
- * 字段名:微信出资 - * 变量名:wechatpay_contribute - * 是否必填:否 - * 类型:int - * 描述:微信出资,单位为分 - * 示例值:0 - *- */ - @SerializedName(value = "wechatpay_contribute") - private Integer wechatpayContribute; - - /** - *
- * 字段名:商户出资 - * 变量名:merchant_contribute - * 是否必填:否 - * 类型:int - * 描述:商户出资,单位为分 - * 示例值:0 - *- */ - @SerializedName(value = "merchant_contribute") - private Integer merchantContribute; - - /** - *
- * 字段名:其他出资 - * 变量名:other_contribute - * 是否必填:否 - * 类型:int - * 描述:其他出资,单位为分 - * 示例值:0 - *- */ - @SerializedName(value = "other_contribute") - private Integer otherContribute; - - /** - *
- * 字段名:优惠币种 - * 变量名:currency - * 是否必填:否 - * 类型:String(16) - * 描述: - * CNY:人民币,境内商户号仅支持人民币。 - * 示例值:CNY - *- */ - @SerializedName(value = "currency") - private String currency; - - /** - *
- * 字段名:单品列表 - * 变量名:goods_detail - * 是否必填:否 - * 类型:array - * 描述:单品列表信息 - *- */ - @SerializedName(value = "goods_detail") - private List
- * 字段名:商品编码 - * 变量名:goods_id - * 是否必填:是 - * 类型:string(32) - * 描述:商品编码 - * 示例值:M1006 - *- */ - @SerializedName(value = "goods_id") - private String goodsId; - - /** - *
- * 字段名:商品数量 - * 变量名:quantity - * 是否必填:是 - * 类型:int64 - * 描述: - * 用户购买的数量 - * 示例值:1 - *- */ - @SerializedName(value = "quantity") - private Integer quantity; - - /** - *
- * 字段名:商品单价 - * 变量名:unit_price - * 是否必填:是 - * 类型:int64 - * 描述: - * 商品单价,单位为分 - * 示例值:100 - *- */ - @SerializedName(value = "unit_price") - private Integer unitPrice; - - /** - *
- * 字段名:商品优惠金额 - * 变量名:discount_amount - * 是否必填:是 - * 类型:int - * 描述:商品优惠金额 - * 示例值:0 - *- */ - @SerializedName(value = "discount_amount") - private Integer discountAmount; - - /** - *
- * 字段名:商品备注 - * 变量名:goods_remark - * 是否必填:否 - * 类型:string(128) - * 描述:商品备注信息 - * 示例值:商品备注信息 - *- */ - @SerializedName(value = "goods_remark") - private String goodsRemark; - } - -} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SignatureHeader.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SignatureHeader.java deleted file mode 100644 index 498a788c07..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SignatureHeader.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - * 微信通知接口头部信息,需要做签名验证 - * 文档地址: https://wechatpay-api.gitbook.io/wechatpay-api-v3/qian-ming-zhi-nan-1/qian-ming-yan-zheng - * - * @author cloudX - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class SignatureHeader implements Serializable { - private static final long serialVersionUID = -6958015499416059949L; - /** - * 时间戳 - */ - private String timeStamp; - - /** - * 随机串 - */ - private String nonce; - - /** - * 已签名字符串 - */ - private String signed; - - /** - * 证书序列号 - */ - private String serialNo; -} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/TransactionsResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/TransactionsResult.java deleted file mode 100644 index 8e11d859b6..0000000000 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/TransactionsResult.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.github.binarywang.wxpay.bean.ecommerce; - -import com.github.binarywang.wxpay.bean.ecommerce.enums.TradeTypeEnum; -import com.github.binarywang.wxpay.v3.util.SignUtils; -import com.google.gson.annotations.SerializedName; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.security.PrivateKey; - -/** - * 合单支付 JSAPI支付结果响应 - */ -@Data -@NoArgsConstructor -public class TransactionsResult implements Serializable { - private static final long serialVersionUID = 1760592667519950149L; - /** - *
- * 字段名:预支付交易会话标识 (APP支付、JSAPI支付 会返回) - * 变量名:prepay_id - * 是否必填:是 - * 类型:string(64) - * 描述: - * 数字和字母。微信生成的预支付会话标识,用于后续接口调用使用。 - * 示例值:wx201410272009395522657a690389285100 - *- */ - @SerializedName("prepay_id") - private String prepayId; - - /** - *
- * 字段名:支付跳转链接 (H5支付 会返回) - * 变量名:h5_url - * 是否必填:是 - * 类型:string(512) - * 描述: - * 支付跳转链接 - * 示例值:https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx2016121516420242444321ca0631331346&package=1405458241 - *- */ - @SerializedName("h5_url") - private String h5Url; - - /** - *
- * 字段名:二维码链接 (NATIVE支付 会返回) - * 变量名:h5_url - * 是否必填:是 - * 类型:string(512) - * 描述: - * 二维码链接 - * 示例值:weixin://pay.weixin.qq.com/bizpayurl/up?pr=NwY5Mz9&groupid=00 - *- */ - @SerializedName("code_url") - private String codeUrl; - - @Data - @Accessors(chain = true) - public static class JsapiResult implements Serializable { - private String appId; - private String timeStamp; - private String nonceStr; - /** - * 由于package为java保留关键字,因此改为packageValue,序列化时会自动转换为package字段名 - */ - @SerializedName("package") - private String packageValue; - private String signType; - private String paySign; - - private String getSignStr() { - return String.format("%s\n%s\n%s\n%s\n", appId, timeStamp, nonceStr, packageValue); - } - } - - @Data - @Accessors(chain = true) - public static class AppResult implements Serializable { - private String appid; - private String partnerid; - private String prepayid; - /** - * 由于package为java保留关键字,因此改为packageValue,序列化时会自动转换为package字段名 - */ - @SerializedName("package") - private String packageValue; - private String noncestr; - private String timestamp; - private String sign; - - private String getSignStr() { - return String.format("%s\n%s\n%s\n%s\n", appid, timestamp, noncestr, prepayid); - } - } - - public
+ * 字段名:补差金额 + * 变量名:subsidy_amount + * 是否必填:否 + * 类型:int64 + * 描述: + * SettleInfo.profit_sharing为true时,该金额才生效。 + * 注意:单笔订单最高补差金额为5000元 + * 示例值:10 + *+ */ + @SerializedName(value = "subsidy_amount") + private Integer subsidyAmount; } } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/enums/TradeTypeEnum.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/enums/TradeTypeEnum.java index 80edf2d99b..460da8f509 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/enums/TradeTypeEnum.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/enums/TradeTypeEnum.java @@ -29,9 +29,9 @@ public enum TradeTypeEnum { H5("/v3/pay/transactions/h5", "/v3/combine-transactions/h5", "/v3/pay/partner/transactions/h5"); /** - * 单独下单url + * 直连商户支付url */ - private final String partnerUrl; + private final String merchantUrl; /** * 合并下单url @@ -39,7 +39,7 @@ public enum TradeTypeEnum { private final String combineUrl; /** - * 服务商下单 + * 服务商支付url */ - private final String basePartnerUrl; + private final String partnerUrl; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/BusinessCircleService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/BusinessCircleService.java index 21af39ae16..7fef47ed23 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/BusinessCircleService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/BusinessCircleService.java @@ -4,7 +4,7 @@ import com.github.binarywang.wxpay.bean.businesscircle.PaidResult; import com.github.binarywang.wxpay.bean.businesscircle.PointsNotifyRequest; import com.github.binarywang.wxpay.bean.businesscircle.RefundResult; -import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader; +import com.github.binarywang.wxpay.bean.notify.SignatureHeader; import com.github.binarywang.wxpay.exception.WxPayException; /** diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java index b630ce1785..5ef94e531d 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java @@ -3,7 +3,15 @@ import com.github.binarywang.wxpay.bean.ecommerce.*; import com.github.binarywang.wxpay.bean.ecommerce.enums.FundBillTypeEnum; import com.github.binarywang.wxpay.bean.ecommerce.enums.SpAccountTypeEnum; -import com.github.binarywang.wxpay.bean.ecommerce.enums.TradeTypeEnum; +import com.github.binarywang.wxpay.bean.notify.CombineNotifyResult; +import com.github.binarywang.wxpay.bean.notify.SignatureHeader; +import com.github.binarywang.wxpay.bean.notify.WxPayPartnerNotifyV3Result; +import com.github.binarywang.wxpay.bean.request.*; +import com.github.binarywang.wxpay.bean.result.CombineQueryResult; +import com.github.binarywang.wxpay.bean.result.CombineTransactionsResult; +import com.github.binarywang.wxpay.bean.result.WxPayPartnerOrderQueryV3Result; +import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result; +import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum; import com.github.binarywang.wxpay.exception.WxPayException; import java.io.File; @@ -13,7 +21,7 @@ /** *
* 电商收付通相关服务类. - * 接口规则:https://wechatpay-api.gitbook.io/wechatpay-api-v3 + * 产品介绍 ** * @author cloudX @@ -24,7 +32,7 @@ public interface EcommerceService { *
* 二级商户进件API
* 接口地址: https://api.mch.weixin.qq.com/v3/ecommerce/applyments/
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_1_8.shtml
+ * 接口文档
*
*
*
@@ -38,7 +46,7 @@ public interface EcommerceService {
*
* 查询申请状态API
* 请求URL: https://api.mch.weixin.qq.com/v3/ecommerce/applyments/{applyment_id}
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter3_2.shtml
+ * 接口文档
*
*
* @param applymentId 申请单ID
@@ -51,7 +59,7 @@ public interface EcommerceService {
*
* 查询申请状态API
* 请求URL: https://api.mch.weixin.qq.com/v3/ecommerce/applyments/out-request-no/{out_request_no}
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter3_2.shtml
+ * 接口文档
*
*
* @param outRequestNo 业务申请编号
@@ -64,21 +72,21 @@ public interface EcommerceService {
*
* 合单支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
* 请求URL:https://api.mch.weixin.qq.com/v3/combine-transactions/jsapi
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/e-combine.shtml
+ * 接口文档
*
*
* @param tradeType 支付方式
* @param request 请求对象
- * @return 微信合单支付返回 transactions result
+ * @return 微信合单支付返回 CombineTransactionsResult
* @throws WxPayException the wx pay exception
*/
- TransactionsResult combine(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException;
+ CombineTransactionsResult combine(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException;
/**
*
* 合单支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
* 请求URL:https://api.mch.weixin.qq.com/v3/combine-transactions/jsapi
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/e-combine.shtml
+ * 接口文档
*
*
* @param
* 合单支付通知回调数据处理
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/e-combine.shtml
+ * 接口文档
*
*
* @param notifyData 通知数据
* @param header 通知头部数据,不传则表示不校验头
- * @return 解密后通知数据 combine transactions notify result
+ * @return 解密后通知数据 CombineNotifyResult
* @throws WxPayException the wx pay exception
*/
- CombineTransactionsNotifyResult parseCombineNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
+ CombineNotifyResult parseCombineNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
/**
*
* 合单查询订单API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/combine/chapter3_3.shtml
+ * 接口文档
*
*
- * @param outTradeNo 合单商户订单号
+ * @param combineOutTradeNo 合单商户订单号
* @return 支付订单信息
* @throws WxPayException the wx pay exception
*/
- CombineTransactionsResult queryCombineTransactions(String outTradeNo) throws WxPayException;
+ CombineQueryResult queryCombine(String combineOutTradeNo) throws WxPayException;
+
+ /**
+ *
+ * 合单关闭订单API
+ * 请求URL: https://api.mch.weixin.qq.com/v3/combine-transactions/out-trade-no/{combine_out_trade_no}/close
+ * 接口文档
+ *
+ *
+ * @param request 请求对象
+ * @throws WxPayException the wx pay exception
+ */
+ void closeCombine(CombineCloseRequest request) throws WxPayException;
/**
*
* 服务商模式普通支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
* 请求URL:https://api.mch.weixin.qq.com/v3/pay/partner/transactions/jsapi
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/transactions_sl.shtml
+ * 接口文档
*
*
* @param tradeType 支付方式
* @param request 请求对象
- * @return 调起支付需要的参数 transactions result
+ * @return 调起支付需要的参数 WxPayUnifiedOrderV3Result
* @throws WxPayException the wx pay exception
*/
- TransactionsResult partner(TradeTypeEnum tradeType, PartnerTransactionsRequest request) throws WxPayException;
+ WxPayUnifiedOrderV3Result unifiedPartnerOrder(TradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException;
/**
*
* 服务商模式普通支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
* 请求URL:https://api.mch.weixin.qq.com/v3/pay/partner/transactions/jsapi
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/transactions_sl.shtml
+ * 接口文档
*
*
* @param
* 普通支付通知回调数据处理
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/e_transactions.shtml
+ * 接口文档
*
*
* @param notifyData 通知数据
* @param header 通知头部数据,不传则表示不校验头
- * @return 解密后通知数据 partner transactions notify result
+ * @return 解密后通知数据 WxPayPartnerNotifyV3Result
* @throws WxPayException the wx pay exception
*/
- PartnerTransactionsNotifyResult parsePartnerNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
+ WxPayPartnerNotifyV3Result parsePartnerNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
/**
*
* 普通查询订单API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/e_transactions/chapter3_5.shtml
+ * 接口文档
*
*
* @param request 商户订单信息
* @return 支付订单信息
* @throws WxPayException the wx pay exception
*/
- PartnerTransactionsResult queryPartnerTransactions(PartnerTransactionsQueryRequest request) throws WxPayException;
+ WxPayPartnerOrderQueryV3Result queryPartnerOrder(WxPayPartnerOrderQueryV3Request request) throws WxPayException;
/**
*
* 关闭普通订单API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/e_transactions/chapter3_6.shtml
+ * 接口文档
*
*
- * @param request 关闭普通订单请求
+ * @param request 请求对象
* @throws WxPayException the wx pay exception
- * @return
*/
- String closePartnerTransactions(PartnerTransactionsCloseRequest request) throws WxPayException;
+ void closePartnerOrder(WxPayPartnerOrderCloseV3Request request) throws WxPayException;
/**
*
* 服务商账户实时余额
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/amount.shtml
+ * 接口文档
*
*
* @param accountType 服务商账户类型
@@ -195,7 +214,7 @@ public interface EcommerceService {
/**
*
* 服务商账户日终余额
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/amount.shtml
+ * 接口文档
*
*
* @param accountType 服务商账户类型
@@ -208,7 +227,7 @@ public interface EcommerceService {
/**
*
* 二级商户号账户实时余额
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/amount.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号
@@ -220,7 +239,7 @@ public interface EcommerceService {
/**
*
* 二级商户号账户实时余额
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter4_3_11.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号
@@ -233,7 +252,7 @@ public interface EcommerceService {
/**
*
* 二级商户号账户日终余额
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/amount.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号
@@ -246,7 +265,7 @@ public interface EcommerceService {
/**
*
* 请求分账API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_1.shtml
+ * 接口文档
*
*
* @param request 分账请求
@@ -258,7 +277,7 @@ public interface EcommerceService {
/**
*
* 查询分账结果API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_2.shtml
+ * 接口文档
*
*
* @param request 查询分账请求
@@ -270,7 +289,7 @@ public interface EcommerceService {
/**
*
* 查询订单剩余待分金额API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_4_9.shtml
+ * 接口文档
*
*
* @param request 查询订单剩余待分金额请求
@@ -282,7 +301,7 @@ public interface EcommerceService {
/**
*
* 添加分账接收方API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_7.shtml
+ * 接口文档
*
*
* @param request 添加分账接收方
@@ -294,7 +313,7 @@ public interface EcommerceService {
/**
*
* 删除分账接收方API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_8.shtml
+ * 接口文档
*
*
* @param request 删除分账接收方
@@ -306,7 +325,7 @@ public interface EcommerceService {
/**
*
* 请求分账回退API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_3.shtml
+ * 接口文档
*
*
* @param request 分账回退请求
@@ -318,7 +337,7 @@ public interface EcommerceService {
/**
*
* 查询分账回退API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_3.shtml
+ * 接口文档
*
*
* @param request 查询分账回退请求
@@ -330,7 +349,7 @@ public interface EcommerceService {
/**
*
* 完结分账API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_5.shtml
+ * 接口文档
*
*
* @param request 完结分账请求
@@ -342,7 +361,7 @@ public interface EcommerceService {
/**
*
* 退款申请API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/refunds/chapter3_1.shtml
+ * 接口文档
*
*
* @param request 退款请求
@@ -354,7 +373,7 @@ public interface EcommerceService {
/**
*
* 查询退款API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/refunds/chapter3_2.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号
@@ -368,7 +387,7 @@ public interface EcommerceService {
/**
*
* 垫付退款回补API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_4.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号
@@ -382,7 +401,7 @@ public interface EcommerceService {
/**
*
* 查询垫付回补结果API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_5.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号
@@ -394,7 +413,7 @@ public interface EcommerceService {
/**
*
* 查询退款API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/refunds/chapter3_2.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号
@@ -407,7 +426,7 @@ public interface EcommerceService {
/**
*
* 退款通知回调数据处理
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/refunds/chapter3_3.shtml
+ * 接口文档
*
*
* @param notifyData 通知数据
@@ -420,7 +439,7 @@ public interface EcommerceService {
/**
*
* 提现状态变更通知回调数据处理
- * 文档地址: https://pay.weixin.qq.com/doc/v3/partner/4013049135
+ * 接口文档
*
*
* @param notifyData 通知数据
@@ -433,7 +452,7 @@ public interface EcommerceService {
/**
*
* 二级商户账户余额提现API
- * 文档地址: https://pay.weixin.qq.com/doc/v3/partner/4012476652
+ * 接口文档
*
*
* @param request 提现请求
@@ -445,7 +464,7 @@ public interface EcommerceService {
/**
*
* 电商平台提现API
- * 文档地址: https://pay.weixin.qq.com/doc/v3/partner/4012476670
+ * 接口文档
*
*
* @param request 提现请求
@@ -457,7 +476,7 @@ public interface EcommerceService {
/**
*
* 二级商户查询提现状态API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/fund/chapter3_3.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号
@@ -470,7 +489,7 @@ public interface EcommerceService {
/**
*
* 电商平台查询提现状态API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/fund/chapter3_6.shtml
+ * 接口文档
*
*
* @param outRequestNo 商户提现单号
@@ -482,7 +501,7 @@ public interface EcommerceService {
/**
*
* 平台查询预约提现状态(根据微信支付预约提现单号查询)
- * 文档地址: https://pay.weixin.qq.com/doc/v3/partner/4012476674
+ * 接口文档
*
*
* @param withdrawId 微信支付提现单号
@@ -494,7 +513,7 @@ public interface EcommerceService {
/**
*
* 二级商户按日终余额预约提现
- * 文档地址: https://pay.weixin.qq.com/doc/v3/partner/4013328143
+ * 接口文档
*
*
* @param request 提现请求
@@ -506,7 +525,7 @@ public interface EcommerceService {
/**
*
* 查询二级商户按日终余额预约提现状态
- * 文档地址: https://pay.weixin.qq.com/doc/v3/partner/4013328163
+ * 接口文档
*
*
* @param subMchid 二级商户号
@@ -519,7 +538,7 @@ public interface EcommerceService {
/**
*
* 修改结算账号API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter3_4.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号。
@@ -531,7 +550,7 @@ public interface EcommerceService {
/**
*
* 查询结算账户API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter3_5.shtml
+ * 接口文档
*
*
* @param subMchid 二级商户号。
@@ -543,7 +562,7 @@ public interface EcommerceService {
/**
*
* 请求账单API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/bill.shtml
+ * 接口文档
*
*
* @param request 请求信息。
@@ -555,7 +574,7 @@ public interface EcommerceService {
/**
*
* 申请资金账单API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/bill/chapter3_2.shtml
+ * 接口文档
*
*
* @param billType 账单类型。
@@ -568,7 +587,7 @@ public interface EcommerceService {
/**
*
* 下载账单API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/bill.shtml
+ * 接口文档
*
*
* @param url 微信返回的账单地址。
@@ -581,7 +600,7 @@ public interface EcommerceService {
/**
*
* 请求补差API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_5_1.shtml
+ * 接口文档
*
*
* @param subsidiesCreateRequest 请求补差。
@@ -593,7 +612,7 @@ public interface EcommerceService {
/**
*
* 请求补差回退API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_5_2.shtml
+ * 接口文档
*
*
* @param subsidiesReturnRequest 请求补差。
@@ -605,7 +624,7 @@ public interface EcommerceService {
/**
*
* 取消补差API
- * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_5_3.shtml
+ * 接口文档
*
*
* @param subsidiesCancelRequest 请求补差。
@@ -617,7 +636,7 @@ public interface EcommerceService {
/**
*
* 提交注销申请单
- * 文档地址: https://pay.weixin.qq.com/docs/partner/apis/ecommerce-cancel/cancel-applications/create-cancel-application.html
+ * 接口文档
*
*
* @param accountCancelApplicationsRequest 提交注销申请单
@@ -629,7 +648,7 @@ public interface EcommerceService {
/**
*
* 查询注销单状态
- * 文档地址: https://pay.weixin.qq.com/docs/partner/apis/ecommerce-cancel/cancel-applications/get-cancel-application.html
+ * 接口文档
*
*
* @param outApplyNo 注销申请单号
@@ -641,7 +660,7 @@ public interface EcommerceService {
/**
*
* 注销单资料图片上传
- * 文档地址: https://pay.weixin.qq.com/docs/partner/apis/ecommerce-cancel/media/upload-media.html
+ * 接口文档
*
*
* @param imageFile 图片
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/MarketingFavorService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/MarketingFavorService.java
index ac0ed5212f..47e7035510 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/MarketingFavorService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/MarketingFavorService.java
@@ -1,6 +1,6 @@
package com.github.binarywang.wxpay.service;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.marketing.*;
import com.github.binarywang.wxpay.exception.WxPayException;
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PartnerPayScoreService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PartnerPayScoreService.java
index c5c4e06796..0bb9b82af1 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PartnerPayScoreService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PartnerPayScoreService.java
@@ -1,6 +1,6 @@
package com.github.binarywang.wxpay.service;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.payscore.PayScoreNotifyData;
import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreRequest;
import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreResult;
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PartnerPayScoreSignPlanService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PartnerPayScoreSignPlanService.java
index 3e51ebd7f0..f72f004fb8 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PartnerPayScoreSignPlanService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PartnerPayScoreSignPlanService.java
@@ -1,6 +1,6 @@
package com.github.binarywang.wxpay.service;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.payscore.PartnerUserSignPlanEntity;
import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreSignPlanRequest;
import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreSignPlanResult;
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayScoreService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayScoreService.java
index 5b4f692033..ee816f1ab3 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayScoreService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayScoreService.java
@@ -1,6 +1,6 @@
package com.github.binarywang.wxpay.service;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.payscore.PayScoreNotifyData;
import com.github.binarywang.wxpay.bean.payscore.UserAuthorizationStatusNotifyResult;
import com.github.binarywang.wxpay.bean.payscore.WxPayScoreRequest;
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java
index a460d5f248..9cf5aba4a4 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java
@@ -5,12 +5,13 @@
import com.github.binarywang.wxpay.bean.notify.*;
import com.github.binarywang.wxpay.bean.request.*;
import com.github.binarywang.wxpay.bean.result.*;
-import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
import com.github.binarywang.wxpay.bean.result.enums.GlobalTradeTypeEnum;
+import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.github.binarywang.wxpay.exception.WxPayException;
+import com.github.binarywang.wxpay.exception.WxSignTestException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
@@ -1069,6 +1070,16 @@ WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, Stri
*/
WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String signType) throws WxPayException;
+ /**
+ * 校验通知签名
+ *
+ * @param header 通知头信息
+ * @param data 通知数据
+ * @return true:校验通过 false:校验不通过
+ * @throws WxSignTestException 微信支付签名探测流量异常
+ */
+ boolean verifyNotifySign(SignatureHeader header, String data) throws WxSignTestException;
+
/**
* 解析支付结果v3通知. 直连商户模式
* 详见https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_5.shtml
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 2574e969d7..943894146c 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -1,21 +1,17 @@
package com.github.binarywang.wxpay.service.impl;
-import static com.github.binarywang.wxpay.constant.WxPayConstants.QUERY_COMMENT_DATE_FORMAT;
-import static com.github.binarywang.wxpay.constant.WxPayConstants.TarType;
-import com.github.binarywang.wxpay.bean.coupon.*;
-import com.github.binarywang.wxpay.bean.notify.*;
-import com.github.binarywang.wxpay.bean.request.*;
-import com.github.binarywang.wxpay.bean.result.*;
-import com.github.binarywang.wxpay.service.*;
-import java.util.*;
-import com.github.binarywang.wxpay.bean.result.enums.GlobalTradeTypeEnum;
-import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
import com.github.binarywang.utils.qrcode.QrcodeUtils;
import com.github.binarywang.wxpay.bean.WxPayApiData;
+import com.github.binarywang.wxpay.bean.coupon.*;
+import com.github.binarywang.wxpay.bean.notify.*;
import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult;
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
import com.github.binarywang.wxpay.bean.order.WxPayMwebOrderResult;
import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
+import com.github.binarywang.wxpay.bean.request.*;
+import com.github.binarywang.wxpay.bean.result.*;
+import com.github.binarywang.wxpay.bean.result.enums.GlobalTradeTypeEnum;
+import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.config.WxPayConfigHolder;
@@ -23,6 +19,7 @@
import com.github.binarywang.wxpay.constant.WxPayConstants.TradeType;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.exception.WxSignTestException;
+import com.github.binarywang.wxpay.service.*;
import com.github.binarywang.wxpay.util.SignUtils;
import com.github.binarywang.wxpay.util.XmlConfig;
import com.github.binarywang.wxpay.util.ZipUtils;
@@ -32,6 +29,14 @@
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxRuntimeException;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.reflect.ConstructorUtils;
+import org.apache.http.entity.ContentType;
+
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -40,15 +45,12 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
+import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.zip.ZipException;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.common.error.WxRuntimeException;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.reflect.ConstructorUtils;
-import org.apache.http.entity.ContentType;
+
+import static com.github.binarywang.wxpay.constant.WxPayConstants.QUERY_COMMENT_DATE_FORMAT;
+import static com.github.binarywang.wxpay.constant.WxPayConstants.TarType;
/**
*
@@ -526,7 +528,8 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign
* @param data 通知数据
* @return true:校验通过 false:校验不通过
*/
- private boolean verifyNotifySign(SignatureHeader header, String data) throws WxSignTestException {
+ @Override
+ public boolean verifyNotifySign(SignatureHeader header, String data) throws WxSignTestException {
String wxPaySign = header.getSignature();
if (wxPaySign.startsWith("WECHATPAY/SIGNTEST/")) {
throw new WxSignTestException("微信支付签名探测流量");
@@ -959,7 +962,7 @@ public WxPayUnifiedOrderV3Result unifiedPartnerOrderV3(TradeTypeEnum tradeType,
request.setSubMchId(this.getConfig().getSubMchId());
}
- String url = this.getPayBaseUrl() + tradeType.getBasePartnerUrl();
+ String url = this.getPayBaseUrl() + tradeType.getPartnerUrl();
String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(response, WxPayUnifiedOrderV3Result.class);
}
@@ -976,7 +979,7 @@ public WxPayUnifiedOrderV3Result unifiedOrderV3(TradeTypeEnum tradeType, WxPayUn
request.setNotifyUrl(this.getConfig().getNotifyUrl());
}
- String url = this.getPayBaseUrl() + tradeType.getPartnerUrl();
+ String url = this.getPayBaseUrl() + tradeType.getMerchantUrl();
String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(response, WxPayUnifiedOrderV3Result.class);
}
@@ -1360,8 +1363,8 @@ public WxPayMicropayResult micropay(WxPayMicropayRequest request) throws WxPayEx
@Override
public WxPayCodepayResult codepay(WxPayCodepayRequest request) throws WxPayException {
// 判断是否为服务商模式:如果设置了sp_appid或sp_mchid或sub_mchid中的任何一个,则认为是服务商模式
- boolean isPartnerMode = StringUtils.isNotBlank(request.getSpAppid())
- || StringUtils.isNotBlank(request.getSpMchid())
+ boolean isPartnerMode = StringUtils.isNotBlank(request.getSpAppid())
+ || StringUtils.isNotBlank(request.getSpMchid())
|| StringUtils.isNotBlank(request.getSubMchid());
if (isPartnerMode) {
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BusinessCircleServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BusinessCircleServiceImpl.java
index 49c400538d..8ed8286c9a 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BusinessCircleServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BusinessCircleServiceImpl.java
@@ -4,7 +4,7 @@
import com.github.binarywang.wxpay.bean.businesscircle.PaidResult;
import com.github.binarywang.wxpay.bean.businesscircle.PointsNotifyRequest;
import com.github.binarywang.wxpay.bean.businesscircle.RefundResult;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.BusinessCircleService;
import com.github.binarywang.wxpay.service.WxPayService;
@@ -16,7 +16,6 @@
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.util.Objects;
@@ -38,22 +37,9 @@ public void notifyPoints(PointsNotifyRequest request) throws WxPayException {
this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request));
}
- /**
- * 校验通知签名
- *
- * @param header 通知头信息
- * @param data 通知数据
- * @return true:校验通过 false:校验不通过
- */
- private boolean verifyNotifySign(SignatureHeader header, String data) {
- String beforeSign = String.format("%s\n%s\n%s\n", header.getTimeStamp(), header.getNonce(), data);
- return payService.getConfig().getVerifier().verify(header.getSerialNo(),
- beforeSign.getBytes(StandardCharsets.UTF_8), header.getSigned());
- }
-
@Override
public BusinessCircleNotifyData parseNotifyData(String data, SignatureHeader header) throws WxPayException {
- if (Objects.nonNull(header) && !this.verifyNotifySign(header, data)) {
+ if (Objects.nonNull(header) && !this.payService.verifyNotifySign(header, data)) {
throw new WxPayException("非法请求,头部信息验证失败");
}
return GSON.fromJson(data, BusinessCircleNotifyData.class);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
index 171535c992..0f99d428fc 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
@@ -3,7 +3,15 @@
import com.github.binarywang.wxpay.bean.ecommerce.*;
import com.github.binarywang.wxpay.bean.ecommerce.enums.FundBillTypeEnum;
import com.github.binarywang.wxpay.bean.ecommerce.enums.SpAccountTypeEnum;
-import com.github.binarywang.wxpay.bean.ecommerce.enums.TradeTypeEnum;
+import com.github.binarywang.wxpay.bean.notify.CombineNotifyResult;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.WxPayPartnerNotifyV3Result;
+import com.github.binarywang.wxpay.bean.request.*;
+import com.github.binarywang.wxpay.bean.result.CombineQueryResult;
+import com.github.binarywang.wxpay.bean.result.CombineTransactionsResult;
+import com.github.binarywang.wxpay.bean.result.WxPayPartnerOrderQueryV3Result;
+import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result;
+import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.EcommerceService;
import com.github.binarywang.wxpay.service.WxPayService;
@@ -28,9 +36,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URI;
-import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
-import java.text.DateFormat;
import java.util.*;
@RequiredArgsConstructor
@@ -38,10 +44,6 @@ public class EcommerceServiceImpl implements EcommerceService {
private static final Gson GSON = new GsonBuilder().create();
- // https://stackoverflow.com/questions/6873020/gson-date-format
- // gson default date format not match, so custom DateFormat
- // detail DateFormat: FULL,LONG,SHORT,MEDIUM
- private static final Gson GSON_CUSTOM = new GsonBuilder().setDateFormat(DateFormat.FULL, DateFormat.FULL).create();
private final WxPayService payService;
@Override
@@ -68,104 +70,53 @@ public ApplymentsStatusResult queryApplyStatusByOutRequestNo(String outRequestNo
}
@Override
- public TransactionsResult combine(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException {
- String url = this.payService.getPayBaseUrl() + tradeType.getCombineUrl();
- String response = this.payService.postV3(url, GSON.toJson(request));
- return GSON.fromJson(response, TransactionsResult.class);
+ public CombineTransactionsResult combine(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException {
+ return this.payService.combine(tradeType, request);
}
@Override
public T combineTransactions(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException {
- TransactionsResult result = this.combine(tradeType, request);
- return result.getPayInfo(tradeType, request.getCombineAppid(),
- request.getCombineMchid(), payService.getConfig().getPrivateKey());
+ return this.payService.combineTransactions(tradeType, request);
}
@Override
- public CombineTransactionsNotifyResult parseCombineNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
- if (Objects.nonNull(header) && !this.verifyNotifySign(header, notifyData)) {
- throw new WxPayException("非法请求,头部信息验证失败");
- }
- NotifyResponse response = GSON.fromJson(notifyData, NotifyResponse.class);
- NotifyResponse.Resource resource = response.getResource();
- String cipherText = resource.getCiphertext();
- String associatedData = resource.getAssociatedData();
- String nonce = resource.getNonce();
- String apiV3Key = this.payService.getConfig().getApiV3Key();
- try {
- String result = AesUtils.decryptToString(associatedData, nonce, cipherText, apiV3Key);
- CombineTransactionsResult transactionsResult = GSON.fromJson(result, CombineTransactionsResult.class);
-
- CombineTransactionsNotifyResult notifyResult = new CombineTransactionsNotifyResult();
- notifyResult.setRawData(response);
- notifyResult.setResult(transactionsResult);
- return notifyResult;
- } catch (GeneralSecurityException | IOException e) {
- throw new WxPayException("解析报文异常!", e);
- }
+ public CombineNotifyResult parseCombineNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
+ return this.payService.parseCombineNotifyResult(notifyData, header);
}
@Override
- public CombineTransactionsResult queryCombineTransactions(String outTradeNo) throws WxPayException {
- String url = String.format("%s/v3/combine-transactions/out-trade-no/%s", this.payService.getPayBaseUrl(), outTradeNo);
- String response = this.payService.getV3(url);
- return GSON.fromJson(response, CombineTransactionsResult.class);
+ public CombineQueryResult queryCombine(String combineOutTradeNo) throws WxPayException {
+ return this.payService.queryCombine(combineOutTradeNo);
}
@Override
- public TransactionsResult partner(TradeTypeEnum tradeType, PartnerTransactionsRequest request) throws WxPayException {
- String url = this.payService.getPayBaseUrl() + tradeType.getPartnerUrl();
- String response = this.payService.postV3(url, GSON.toJson(request));
- return GSON.fromJson(response, TransactionsResult.class);
+ public void closeCombine(CombineCloseRequest request) throws WxPayException {
+ this.payService.closeCombine(request);
}
@Override
- public T partnerTransactions(TradeTypeEnum tradeType, PartnerTransactionsRequest request) throws WxPayException {
- TransactionsResult result = this.partner(tradeType, request);
- String appId = request.getSubAppid() != null ? request.getSubAppid() : request.getSpAppid();
- return result.getPayInfo(tradeType, appId,
- request.getSpMchid(), payService.getConfig().getPrivateKey());
+ public WxPayUnifiedOrderV3Result unifiedPartnerOrder(TradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException {
+ return this.payService.unifiedPartnerOrderV3(tradeType, request);
}
@Override
- public PartnerTransactionsNotifyResult parsePartnerNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
- if (Objects.nonNull(header) && !this.verifyNotifySign(header, notifyData)) {
- throw new WxPayException("非法请求,头部信息验证失败");
- }
- NotifyResponse response = GSON.fromJson(notifyData, NotifyResponse.class);
- NotifyResponse.Resource resource = response.getResource();
- String cipherText = resource.getCiphertext();
- String associatedData = resource.getAssociatedData();
- String nonce = resource.getNonce();
- String apiV3Key = this.payService.getConfig().getApiV3Key();
- try {
- String result = AesUtils.decryptToString(associatedData, nonce, cipherText, apiV3Key);
- PartnerTransactionsResult transactionsResult = GSON.fromJson(result, PartnerTransactionsResult.class);
+ public T createPartnerOrder(TradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException {
+ return this.payService.createPartnerOrderV3(tradeType, request);
+ }
- PartnerTransactionsNotifyResult notifyResult = new PartnerTransactionsNotifyResult();
- notifyResult.setRawData(response);
- notifyResult.setResult(transactionsResult);
- return notifyResult;
- } catch (GeneralSecurityException | IOException e) {
- throw new WxPayException("解析报文异常!", e);
- }
+ @Override
+ public WxPayPartnerNotifyV3Result parsePartnerNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
+ return this.payService.parsePartnerOrderNotifyV3Result(notifyData, header);
}
@Override
- public PartnerTransactionsResult queryPartnerTransactions(PartnerTransactionsQueryRequest request) throws WxPayException {
- String url = String.format("%s/v3/pay/partner/transactions/out-trade-no/%s", this.payService.getPayBaseUrl(), request.getOutTradeNo());
- if (Objects.isNull(request.getOutTradeNo())) {
- url = String.format("%s/v3/pay/partner/transactions/id/%s", this.payService.getPayBaseUrl(), request.getTransactionId());
- }
- String query = String.format("?sp_mchid=%s&sub_mchid=%s", request.getSpMchid(), request.getSubMchid());
- String response = this.payService.getV3(url + query);
- return GSON.fromJson(response, PartnerTransactionsResult.class);
+ public WxPayPartnerOrderQueryV3Result queryPartnerOrder(WxPayPartnerOrderQueryV3Request request) throws WxPayException {
+ return this.payService.queryPartnerOrderV3(request);
}
@Override
- public String closePartnerTransactions(PartnerTransactionsCloseRequest request) throws WxPayException {
- String url = String.format("%s/v3/pay/partner/transactions/out-trade-no/%s/close", this.payService.getPayBaseUrl(), request.getOutTradeNo());
- return this.payService.postV3(url, GSON.toJson(request));
+ public void closePartnerOrder(WxPayPartnerOrderCloseV3Request request) throws WxPayException {
+ this.payService.closePartnerOrderV3(request);
}
@Override
@@ -318,7 +269,7 @@ public RefundQueryResult queryRefundByOutRefundNo(String subMchid, String outRef
@Override
public RefundNotifyResult parseRefundNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
- if (Objects.nonNull(header) && !this.verifyNotifySign(header, notifyData)) {
+ if (Objects.nonNull(header) && !payService.verifyNotifySign(header, notifyData)) {
throw new WxPayException("非法请求,头部信息验证失败");
}
NotifyResponse response = GSON.fromJson(notifyData, NotifyResponse.class);
@@ -339,7 +290,7 @@ public RefundNotifyResult parseRefundNotifyResult(String notifyData, SignatureHe
@Override
public WithdrawNotifyResult parseWithdrawNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
- if (Objects.nonNull(header) && !this.verifyNotifySign(header, notifyData)) {
+ if (Objects.nonNull(header) && !payService.verifyNotifySign(header, notifyData)) {
throw new WxPayException("非法请求,头部信息验证失败");
}
NotifyResponse response = GSON.fromJson(notifyData, NotifyResponse.class);
@@ -491,22 +442,6 @@ public AccountCancelApplicationsMediaResult uploadMediaAccountCancelApplication(
}
}
- /**
- * 校验通知签名
- *
- * @param header 通知头信息
- * @param data 通知数据
- * @return true:校验通过 false:校验不通过
- */
- private boolean verifyNotifySign(SignatureHeader header, String data) {
- String beforeSign = String.format("%s\n%s\n%s\n",
- header.getTimeStamp(),
- header.getNonce(),
- data);
- return payService.getConfig().getVerifier().verify(header.getSerialNo(),
- beforeSign.getBytes(StandardCharsets.UTF_8), header.getSigned());
- }
-
/**
* 对象拼接到url
*
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MarketingFavorServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MarketingFavorServiceImpl.java
index 0f84d5f126..6352eb8f40 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MarketingFavorServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MarketingFavorServiceImpl.java
@@ -1,6 +1,6 @@
package com.github.binarywang.wxpay.service.impl;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.marketing.*;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.MarketingFavorService;
@@ -175,22 +175,9 @@ public FavorStocksRestartResult restartFavorStocksV3(String stockId, FavorStocks
return GSON.fromJson(result, FavorStocksRestartResult.class);
}
- /**
- * 校验通知签名
- *
- * @param header 通知头信息
- * @param data 通知数据
- * @return true:校验通过 false:校验不通过
- */
- private boolean verifyNotifySign(SignatureHeader header, String data) {
- String beforeSign = String.format("%s\n%s\n%s\n", header.getTimeStamp(), header.getNonce(), data);
- return payService.getConfig().getVerifier().verify(header.getSerialNo(),
- beforeSign.getBytes(StandardCharsets.UTF_8), header.getSigned());
- }
-
@Override
public UseNotifyData parseNotifyData(String data, SignatureHeader header) throws WxPayException {
- if (Objects.nonNull(header) && !this.verifyNotifySign(header, data)) {
+ if (Objects.nonNull(header) && !payService.verifyNotifySign(header, data)) {
throw new WxPayException("非法请求,头部信息验证失败");
}
return GSON.fromJson(data, UseNotifyData.class);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreServiceImpl.java
index 55c913e79c..b7ba4a6c03 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreServiceImpl.java
@@ -1,6 +1,6 @@
package com.github.binarywang.wxpay.service.impl;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.payscore.*;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.exception.WxPayException;
@@ -316,7 +316,7 @@ public WxPartnerUserAuthorizationStatusNotifyResult parseUserAuthorizationStatus
@Override
public PayScoreNotifyData parseNotifyData(String data, SignatureHeader header) throws WxPayException {
- if (Objects.nonNull(header) && !this.verifyNotifySign(header, data)) {
+ if (Objects.nonNull(header) && !this.payService.verifyNotifySign(header, data)) {
throw new WxPayException("非法请求,头部信息验证失败");
}
return GSON.fromJson(data, PayScoreNotifyData.class);
@@ -335,20 +335,4 @@ public WxPartnerPayScoreResult decryptNotifyDataResource(PayScoreNotifyData data
throw new WxPayException("解析报文异常!", e);
}
}
-
- /**
- * 校验通知签名
- *
- * @param header 通知头信息
- * @param data 通知数据
- * @return true:校验通过 false:校验不通过
- */
- private boolean verifyNotifySign(SignatureHeader header, String data) {
- String beforeSign = String.format("%s\n%s\n%s\n", header.getTimeStamp(), header.getNonce(), data);
- return this.payService.getConfig().getVerifier().verify(
- header.getSerialNo(),
- beforeSign.getBytes(StandardCharsets.UTF_8),
- header.getSigned()
- );
- }
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreSignPlanServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreSignPlanServiceImpl.java
index e81454bb75..4553bf9797 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreSignPlanServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreSignPlanServiceImpl.java
@@ -1,6 +1,6 @@
package com.github.binarywang.wxpay.service.impl;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.payscore.*;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.PartnerPayScoreService;
@@ -260,7 +260,7 @@ public PartnerUserSignPlanEntity parseSignPlanNotifyResult(String notifyData, Si
* @return {@link PayScoreNotifyData}
**/
public PayScoreNotifyData parseNotifyData(String data, SignatureHeader header) throws WxPayException {
- if (Objects.nonNull(header) && !verifyNotifySign(header, data)) {
+ if (Objects.nonNull(header) && !payService.verifyNotifySign(header, data)) {
throw new WxPayException("非法请求,头部信息验证失败");
}
return GSON.fromJson(data, PayScoreNotifyData.class);
@@ -289,20 +289,4 @@ public PartnerUserSignPlanEntity decryptNotifyDataResource(PayScoreNotifyData da
}
}
- /**
- * 校验通知签名
- *
- * @param header 通知头信息
- * @param data 通知数据
- *
- * @return true:校验通过 false:校验不通过
- */
- private boolean verifyNotifySign(SignatureHeader header, String data) {
- String beforeSign = String.format("%s\n%s\n%s\n", header.getTimeStamp(), header.getNonce(), data);
- return this.payService.getConfig().getVerifier().verify(
- header.getSerialNo(),
- beforeSign.getBytes(StandardCharsets.UTF_8),
- header.getSigned()
- );
- }
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java
index ee92c6611a..63c3a5220d 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java
@@ -1,6 +1,6 @@
package com.github.binarywang.wxpay.service.impl;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.payscore.PayScoreNotifyData;
import com.github.binarywang.wxpay.bean.payscore.UserAuthorizationStatusNotifyResult;
import com.github.binarywang.wxpay.bean.payscore.WxPayScoreRequest;
@@ -301,7 +301,7 @@ public UserAuthorizationStatusNotifyResult parseUserAuthorizationStatusNotifyRes
@Override
public PayScoreNotifyData parseNotifyData(String data, SignatureHeader header) throws WxPayException {
- if (Objects.nonNull(header) && !this.verifyNotifySign(header, data)) {
+ if (Objects.nonNull(header) && !payService.verifyNotifySign(header, data)) {
throw new WxPayException("非法请求,头部信息验证失败");
}
return GSON.fromJson(data, PayScoreNotifyData.class);
@@ -321,20 +321,4 @@ public WxPayScoreResult decryptNotifyDataResource(PayScoreNotifyData data) throw
}
}
- /**
- * 校验通知签名
- *
- * @param header 通知头信息
- * @param data 通知数据
- * @return true:校验通过 false:校验不通过
- */
- private boolean verifyNotifySign(SignatureHeader header, String data) throws WxSignTestException {
- String wxPaySign = header.getSigned();
- if(wxPaySign.startsWith("WECHATPAY/SIGNTEST/")){
- throw new WxSignTestException("微信支付签名探测流量");
- }
- String beforeSign = String.format("%s\n%s\n%s\n", header.getTimeStamp(), header.getNonce(), data);
- return payService.getConfig().getVerifier().verify(header.getSerialNo(),
- beforeSign.getBytes(StandardCharsets.UTF_8), header.getSigned());
- }
}
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/BusinessCircleServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/BusinessCircleServiceImplTest.java
index d07392f17e..02edae7d84 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/BusinessCircleServiceImplTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/BusinessCircleServiceImplTest.java
@@ -4,7 +4,7 @@
import com.github.binarywang.wxpay.bean.businesscircle.PaidResult;
import com.github.binarywang.wxpay.bean.businesscircle.PointsNotifyRequest;
import com.github.binarywang.wxpay.bean.businesscircle.RefundResult;
-import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.testbase.ApiTestModule;
@@ -52,10 +52,10 @@ public void testNotifyPointsV3() throws WxPayException {
@Test
public void testDecryptPaidNotifyDataResource() throws WxPayException {
SignatureHeader header = new SignatureHeader();
- header.setSerialNo("Wechatpay-Serial");
+ header.setSerial("Wechatpay-Serial");
header.setTimeStamp("Wechatpay-Timestamp");
header.setNonce("Wechatpay-Nonce");
- header.setSigned("Wechatpay-Signature");
+ header.setSignature("Wechatpay-Signature");
String data = "body";
BusinessCircleNotifyData notifyData = wxPayService.getBusinessCircleService().parseNotifyData(data, header);
PaidResult result = wxPayService.getBusinessCircleService().decryptPaidNotifyDataResource(notifyData);
@@ -66,10 +66,10 @@ public void testDecryptPaidNotifyDataResource() throws WxPayException {
@Test
public void testDecryptRefundNotifyDataResource() throws WxPayException {
SignatureHeader header = new SignatureHeader();
- header.setSerialNo("Wechatpay-Serial");
+ header.setSerial("Wechatpay-Serial");
header.setTimeStamp("Wechatpay-Timestamp");
header.setNonce("Wechatpay-Nonce");
- header.setSigned("Wechatpay-Signature");
+ header.setSignature("Wechatpay-Signature");
String data = "body";
BusinessCircleNotifyData notifyData = wxPayService.getBusinessCircleService().parseNotifyData(data, header);
RefundResult result = wxPayService.getBusinessCircleService().decryptRefundNotifyDataResource(notifyData);
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImplTest.java
index e250b9ea1c..73aff7f6bb 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImplTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImplTest.java
@@ -1,13 +1,17 @@
package com.github.binarywang.wxpay.service.impl;
-import com.google.common.collect.Lists;
import com.github.binarywang.wxpay.bean.ecommerce.*;
import com.github.binarywang.wxpay.bean.ecommerce.enums.SpAccountTypeEnum;
-import com.github.binarywang.wxpay.bean.ecommerce.enums.TradeTypeEnum;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
+import com.github.binarywang.wxpay.bean.request.CombineTransactionsRequest;
+import com.github.binarywang.wxpay.bean.request.WxPayPartnerOrderQueryV3Request;
+import com.github.binarywang.wxpay.bean.result.CombineTransactionsResult;
+import com.github.binarywang.wxpay.bean.result.WxPayPartnerOrderQueryV3Result;
+import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.testbase.ApiTestModule;
-import com.google.gson.GsonBuilder;
+import com.google.common.collect.Lists;
import com.google.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.util.RandomUtils;
@@ -42,16 +46,16 @@ public void testNotifySign() {
SignatureHeader header = new SignatureHeader();
header.setNonce(nonce);
- header.setSerialNo(serialNo);
+ header.setSerial(serialNo);
header.setTimeStamp(timeStamp);
- header.setSigned(signed);
+ header.setSignature(signed);
String beforeSign = String.format("%s\n%s\n%s\n",
header.getTimeStamp(),
header.getNonce(),
notifyData);
- boolean signResult = wxPayService.getConfig().getVerifier().verify(header.getSerialNo(),
- beforeSign.getBytes(StandardCharsets.UTF_8), header.getSigned());
+ boolean signResult = wxPayService.getConfig().getVerifier().verify(header.getSerial(),
+ beforeSign.getBytes(StandardCharsets.UTF_8), header.getSignature());
log.info("签名结果:{} \nheader:{} \ndata:{}", signResult, header, notifyData);
}
@@ -97,23 +101,23 @@ public void testCombinePay() throws WxPayException {
subOrder2.setAmount(requestAmount);
request.setSubOrders(Arrays.asList(subOrder1, subOrder2));
- TransactionsResult result = wxPayService.getEcommerceService().combine(TradeTypeEnum.JSAPI, request);
+ CombineTransactionsResult result = wxPayService.getEcommerceService().combine(TradeTypeEnum.JSAPI, request);
System.out.println("result = " + result);
}
@Test
public void testQueryPartnerTransactions() throws WxPayException {
- PartnerTransactionsQueryRequest request = new PartnerTransactionsQueryRequest();
+ WxPayPartnerOrderQueryV3Request request = new WxPayPartnerOrderQueryV3Request();
//服务商商户号
- request.setSpMchid("");
+ request.setSpMchId("");
//二级商户号
- request.setSubMchid("");
+ request.setSubMchId("");
//商户订单号
request.setOutTradeNo("");
//微信订单号
request.setTransactionId("");
- PartnerTransactionsResult result = wxPayService.getEcommerceService().queryPartnerTransactions(request);
+ WxPayPartnerOrderQueryV3Result result = wxPayService.getEcommerceService().queryPartnerOrder(request);
System.out.println("result = " + result);
}