diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ApplymentsStatusResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ApplymentsStatusResult.java index 7defd21452..b3704d6526 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ApplymentsStatusResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ApplymentsStatusResult.java @@ -7,6 +7,10 @@ import java.io.Serializable; import java.util.List; +/** + * 二级商户进件 查询申请状态结果响应 + * + */ @Data @NoArgsConstructor public class ApplymentsStatusResult implements Serializable { 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 new file mode 100644 index 0000000000..3b138b4882 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsRequest.java @@ -0,0 +1,455 @@ +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; + +/** + * 合单支付 对象 + */ +@Data +@NoArgsConstructor +public class CombineTransactionsRequest implements Serializable { + /** + *
+ * 字段名:合单商户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 new file mode 100644 index 0000000000..cd4edc9d57 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsResult.java @@ -0,0 +1,119 @@ +package com.github.binarywang.wxpay.bean.ecommerce; + +import com.github.binarywang.wxpay.bean.ecommerce.enums.TradeTypeEnum; +import com.github.binarywang.wxpay.v3.util.AesUtils; +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; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; +import java.util.UUID; + +/** + * 合单支付 JSAPI支付结果响应 + */ +@Data +@NoArgsConstructor +public class CombineTransactionsResult implements Serializable { + + /** + *
+ * 字段名:预支付交易会话标识 (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; + 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; + private String packageValue; + private String noncestr; + private String timestamp; + + } + + public
+ * 合单下单-JS支付API. + * 请求URL:https://api.mch.weixin.qq.com/v3/combine-transactions/jsapi + * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/combine/chapter3_2.shtml + *+ * + * @param request 请求对象 + * @return 预支付交易会话标识, 数字和字母。微信生成的预支付会话标识,用于后续接口调用使用。 + */ +