From f53eed6779d56b33da6609034bda9d108e946618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=BC=E7=A6=84=C2=B7saber=C2=B7=E6=BD=8D=E7=B4=8D?= =?UTF-8?q?=E6=96=AF?= Date: Fri, 29 Sep 2023 16:38:41 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20#3136=20=E3=80=90=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E6=A0=B9=E6=8D=AE=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E5=AE=98=E6=96=B9=E6=96=87=E6=A1=A3=E8=A1=A5=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=8E=A5=E5=8F=A3=E7=9A=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 普通服务商->特约商户进件 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter11_1_1.shtml 文档更新时间:2023.7.14 1.SubjectTypeEnum 枚举移除SUBJECT_TYPE_MICRO小微主体类型 2.WxPayApplyment4SubCreateRequest内部类SubjectInfo对象下删除组织机构代码证OrganizationInfo对象及字段;删除MicroBizInfo对象及字段;新增finance_institution_info 对象 3.新增枚举:金融机构类型->FinanceTypeEnum 4.Applyment4SubService 新增查询结算账户修改申请状态接口 5.新增枚举:结算账号修改审核状态->SettlementVerifyStateEnum ------------------------------------------------------------------------- 服务商微信支付分 文档地址:https://pay.weixin.qq.com/docs/partner/apis/partner-weixin-pay-score/partner-service-auth/apply-partner-permissions.html 文档更新时间:2023.08.23 1.更新PartnerPayScoreService 接口文档描述 2.WxPayScoreResult新增 user_risk_level:用户分层字段;risk_level_version:分层版本字段 (商户查询与用户授权记录返回参数); 新增total_amount:总金额字段(支付分订单查询返回参数) 3.TimeRange对象新增start_time_remark:服务开始时间备注;end_time_remark:服务结束时间备注字段; 4.新增优惠详情对象:PromotionDetail;优惠商品详情对象:GoodsDetail; 5.WxPayScoreRequest 新增字段完结服务时间:completeTime;修改detail字段类型:Detail=>SyncDetail(入参里唯一用到detail字段对应的类应该是SyncDetail,而WxPayScoreResult返回的collection字段下的details字段对应的类才是Detail,之前的提交者可能写错了 详见文档:同步订单信息=>https://pay.weixin.qq.com/docs/partner/apis/partner-weixin-pay-score/partner-service-order/sync-partner-service-order.html; 查询订单=>https://pay.weixin.qq.com/docs/partner/apis/partner-weixin-pay-score/partner-service-order/get-partner-service-order.html) * WxPayRefundV3Result.Amount 新增退款手续费字段; * WxPayRefundQueryV3Result.Amount 新增退款手续费字段; --- .../SettlementModifyStateQueryResult.java | 80 +++++++ .../WxPayApplyment4SubCreateRequest.java | 222 ++---------------- .../bean/applyment/enums/FinanceTypeEnum.java | 33 +++ .../enums/SettlementVerifyStateEnum.java | 22 ++ .../bean/applyment/enums/SubjectTypeEnum.java | 5 +- .../wxpay/bean/payscore/Detail.java | 3 + .../wxpay/bean/payscore/GoodsDetail.java | 27 +++ .../bean/payscore/PayScoreNotifyData.java | 15 +- .../wxpay/bean/payscore/PromotionDetail.java | 41 ++++ .../wxpay/bean/payscore/SyncDetail.java | 24 ++ .../wxpay/bean/payscore/TimeRange.java | 12 + .../payscore/WxPartnerPayScoreRequest.java | 2 + .../payscore/WxPartnerPayScoreResult.java | 3 + .../bean/payscore/WxPayScoreRequest.java | 13 +- .../wxpay/bean/payscore/WxPayScoreResult.java | 24 ++ .../bean/result/WxPayRefundQueryV3Result.java | 7 + .../bean/result/WxPayRefundV3Result.java | 6 + .../wxpay/service/Applyment4SubService.java | 15 +- .../wxpay/service/PartnerPayScoreService.java | 177 +++++++------- .../impl/Applyment4SubServiceImpl.java | 4 +- .../bean/payscore/WxPayScoreRequestTest.java | 2 +- 21 files changed, 416 insertions(+), 321 deletions(-) create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/SettlementModifyStateQueryResult.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/FinanceTypeEnum.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/SettlementVerifyStateEnum.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/GoodsDetail.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PromotionDetail.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/SyncDetail.java diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/SettlementModifyStateQueryResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/SettlementModifyStateQueryResult.java new file mode 100644 index 0000000000..41da7fee76 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/SettlementModifyStateQueryResult.java @@ -0,0 +1,80 @@ +package com.github.binarywang.wxpay.bean.applyment; + +import com.github.binarywang.wxpay.bean.applyment.enums.AccountTypeEnum; +import com.github.binarywang.wxpay.bean.applyment.enums.SettlementVerifyStateEnum; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + + +import java.io.Serializable; + + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +public class SettlementModifyStateQueryResult implements Serializable { + + private static final long serialVersionUID = 464614116838248296L; + /** + * 开户名称 + */ + @SerializedName("account_name") + private String accountName; + + /** + * 账户类型 + */ + @SerializedName("account_type") + private AccountTypeEnum accountType; + + /** + * 开户银行 + */ + @SerializedName("account_bank") + private String accountBank; + + /** + * 开户银行全称(含支行) + */ + @SerializedName("bank_name") + private String bankName; + + /** + * 开户银行联行号 + */ + @SerializedName("bank_branch_id") + private String bankBranchId; + + /** + * 银行账号 + */ + @SerializedName("account_number") + private String accountNumber; + + /** + * 审核状态 + * @see SettlementVerifyStateEnum + */ + @SerializedName("verify_result") + private SettlementVerifyStateEnum verifyResult; + + /** + * 审核驳回原因 + */ + @SerializedName("verify_fail_reason") + private String verifyFailReason; + + /** + * 审核结果更新时间 + */ + @SerializedName("verify_finish_time") + private String verifyFinishTime; + + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java index 52c9fb3a8c..c204e2911e 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java @@ -236,18 +236,18 @@ public static class SubjectInfo implements Serializable { @SerializedName("certificate_info") private CertificateInfo certificateInfo; - /** - * 组织机构代码证 - */ - @SerializedName("organization_info") - private OrganizationInfo organizationInfo; - /** * 单位证明函照片 */ @SerializedName("certificate_letter_copy") private String certificateLetterCopy; + /** + * 金融机构许可证信息 + */ + @SerializedName("finance_institution_info") + private FinanceInstitutionInfo financeInstitutionInfo; + /** * 经营者/法人身份证件 */ @@ -262,12 +262,6 @@ public static class SubjectInfo implements Serializable { @SpecEncrypt private List uboInfoList; - /** - * 小微辅助证明材料(subjectType为小微商户时必填) - */ - @SerializedName("micro_biz_info") - private MicroBizInfo microBizInfo; - @Data @Builder @NoArgsConstructor @@ -381,29 +375,22 @@ public static class CertificateInfo implements Serializable { @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) - public static class OrganizationInfo implements Serializable { - private static final long serialVersionUID = 6497045652770046337L; - /** - * 组织机构代码证照片 - */ - @SerializedName("organization_copy") - private String organizationCopy; - /** - * 组织机构代码 - */ - @SerializedName("organization_code") - private String organizationCode; + public static class FinanceInstitutionInfo implements Serializable { + + private static final long serialVersionUID = 6016563999835704297L; /** - * 组织机构代码证有效期开始日期 + * 金融机构类型 + * + * @see FinanceTypeEnum */ - @SerializedName("org_period_begin") - private String orgPeriodBegin; + @SerializedName("finance_type") + private FinanceTypeEnum financeType; + /** - * 组织机构代码证有效期结束日期 + * 金融机构许可证图片 */ - @SerializedName("org_period_end") - private String orgPeriodEnd; - + @SerializedName("finance_license_pics") + private List financeLicensePics; } @Data @@ -605,179 +592,6 @@ public static class UboInfo implements Serializable { @SerializedName("ubo_period_end") private String uboPeriodEnd; } - - @Data - @Builder - @NoArgsConstructor - @AllArgsConstructor - @Accessors(chain = true) - public static class MicroBizInfo implements Serializable { - private static final long serialVersionUID = -5679477993681265764L; - /** - * 小微经营类型 - */ - @SerializedName("micro_biz_type") - private MicroBizTypeEnum microBizType; - - /** - * 门店场所---经营类型为“门店场所”时填写 - */ - @SerializedName("micro_store_info") - private MicroStoreInfo microStoreInfo; - - /** - * 经营类型为“流动经营/便民服务”时填写 - */ - @SerializedName("micro_mobile_info") - private MicroMobileInfo microMobileInfo; - - /** - * 经营类型为“线上商品/服务交易”时填写 - */ - @SerializedName("micro_online_info") - private MicroOnlineInfo microOnlineInfo; - - /** - * 门店场所 - */ - @Data - @Builder - @NoArgsConstructor - @AllArgsConstructor - @Accessors(chain = true) - public static class MicroStoreInfo implements Serializable { - private static final long serialVersionUID = 5277440587305558389L; - /** - * 门店名称 - */ - @SerializedName("micro_name") - private String microName; - /** - * 门店省市编码 填写门店省市编码,只能由数字组成,详细参见《微信支付提供的省市对照表》 - * - * @see 下载微信支付提供的省市对照表 - */ - @SerializedName("micro_address_code") - private String microAddressCode; - /** - * 门店地址(填写店铺详细地址,具体区/县及街道门牌号或大厦楼层) - */ - @SerializedName("micro_address") - private String microAddress; - /** - * 门店门头照片 - * - * 1、提交门店门口照片,要求招牌清晰可见 - * 2、可上传1张图片,请填写通过《图片上传API》预先上传图片生成好的MediaID - * - * - * @see 图片上传API - */ - @SerializedName("store_entrance_pic") - private String storeEntrancePic; - /** - * 店内环境照片 - * - * 1、提交店内环境照片 - * 2、可上传1张图片,请填写通过《图片上传API》预先上传图片生成好的MediaID - * - * - * @see 图片上传API - */ - @SerializedName("micro_indoor_copy") - private String microIndoorCopy; - /** - * 门店经度 - */ - @SerializedName("store_longitude") - private String storeLongitude; - /** - * 门店纬度 - */ - @SerializedName("store_latitude") - private String storeLatitude; - } - - /** - * 流动经营/便民服务 - */ - @Data - @Builder - @NoArgsConstructor - @AllArgsConstructor - @Accessors(chain = true) - public static class MicroMobileInfo implements Serializable { - private static final long serialVersionUID = -1308090894511066935L; - /** - * 经营/服务名称 - */ - @SerializedName("micro_mobile_name") - private String microMobileName; - /** - * 经营/服务所在地省市 - */ - @SerializedName("micro_mobile_city") - private String microMobileCity; - /** - * 经营/服务所在地(不含省市) 填写“无" - */ - @SerializedName("micro_mobile_address") - private String microMobileAddress; - /** - * 经营/服务现场照片 - * - * 1、提交经营/服务现场照片 - * 2、可上传多张图片,请填写通过《图片上传API》预先上传图片生成好的MediaID - * - * - * @see 图片上传API - */ - @SerializedName("micro_mobile_pics") - private String microMobilePics; - } - - /** - * 线上商品/服务交易 - */ - @Data - @Builder - @NoArgsConstructor - @AllArgsConstructor - @Accessors(chain = true) - public static class MicroOnlineInfo implements Serializable { - private static final long serialVersionUID = 9029168841403055743L; - /** - * 线上店铺名称 - */ - @SerializedName("micro_online_store") - private String microOnlineStore; - /** - * 电商平台名称 - */ - @SerializedName("micro_ec_name") - private String microEcName; - /** - * 店铺二维码 - * - * 1、店铺二维码或店铺链接二选一必填 - * 2、可上传多张图片,请填写通过《图片上传API》预先上传图片生成好的MediaID - * - * - * @see 图片上传API - */ - @SerializedName("micro_qrcode") - private String microQrcode; - /** - * 店铺二维码 - * - * 1、店铺二维码或店铺链接二选一必填 - * 2、请填写店铺主页链接,需符合网站规范 - * - */ - @SerializedName("micro_link") - private String microLink; - } - } } /** diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/FinanceTypeEnum.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/FinanceTypeEnum.java new file mode 100644 index 0000000000..59a2d2acd9 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/FinanceTypeEnum.java @@ -0,0 +1,33 @@ +package com.github.binarywang.wxpay.bean.applyment.enums; + +/** + * 金融机构类型 + **/ +public enum FinanceTypeEnum { + + /** + * 银行业, 适用于商业银行、政策性银行、农村合作银行、村镇银行、开发性金融机构等 + */ + BANK_AGENT, + + /** + * 支付机构, 适用于非银行类支付机构 + */ + PAYMENT_AGENT, + + /** + * 保险业, 适用于保险、保险中介、保险代理、保险经纪等保险类业务 + */ + INSURANCE, + + /** + * 交易及结算类金融机构, 适用于交易所、登记结算类机构、银行卡清算机构、资金清算中心等 + */ + TRADE_AND_SETTLE, + + /** + * 其他金融机构, 适用于财务公司、信托公司、金融资产管理公司、金融租赁公司、汽车金融公司、贷款公司、货币经纪公司、消费金融公司、证券业、金融控股公司、股票、期货、货币兑换、小额贷款公司、金融资产管理、担保公司、商业保理公司、典当行、融资租赁公司、财经咨询等其他金融业务 + */ + OTHER, + ; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/SettlementVerifyStateEnum.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/SettlementVerifyStateEnum.java new file mode 100644 index 0000000000..9ff3952adf --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/SettlementVerifyStateEnum.java @@ -0,0 +1,22 @@ +package com.github.binarywang.wxpay.bean.applyment.enums; + +/** + * 结算账户修改审核状态 + **/ +public enum SettlementVerifyStateEnum { + /** + * 审核成功 + */ + AUDIT_SUCCESS, + + /** + * 审核中 + */ + AUDITING, + + /** + * 审核驳回 + */ + AUDIT_FAIL, + ; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/SubjectTypeEnum.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/SubjectTypeEnum.java index 11020b9267..79950fd792 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/SubjectTypeEnum.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/SubjectTypeEnum.java @@ -9,6 +9,7 @@ * @author zhouyongshen * @author 狂龙骄子 * @since 2023.01.14 新增{@link #SUBJECT_TYPE_GOVERNMENT} + * @since 2023.09.19 移除SUBJECT_TYPE_MICRO小微主体 * @see 服务商平台>>商户进件>>特约商户进件>>提交申请单>>请求参数>>主体资料>>主体类型 */ public enum SubjectTypeEnum { @@ -32,9 +33,5 @@ public enum SubjectTypeEnum { * (社会组织):包括社会团体、民办非企业、基金会、基层群众性自治组织、农村集体经济组织等组织。 */ SUBJECT_TYPE_OTHERS, - /** - * (小微):无营业执照、免办理工商注册登记的实体商户 - */ - SUBJECT_TYPE_MICRO; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Detail.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Detail.java index 94f62fbead..d576a97c34 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Detail.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Detail.java @@ -5,6 +5,7 @@ import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.List; /** * 明细. @@ -33,4 +34,6 @@ public class Detail implements Serializable { private String paidTime; @SerializedName("transaction_id") private String transactionId; + @SerializedName("promotion_detail") + private List promotionDetail; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/GoodsDetail.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/GoodsDetail.java new file mode 100644 index 0000000000..694c99f1a1 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/GoodsDetail.java @@ -0,0 +1,27 @@ +package com.github.binarywang.wxpay.bean.payscore; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 优惠商品信息 + **/ +@Data +@NoArgsConstructor +public class GoodsDetail implements Serializable { + + private static final long serialVersionUID = 7139782546598279686L; + @SerializedName("goods_id") + private String goodsId; + @SerializedName("quantity") + private Integer quantity; + @SerializedName("unit_price") + private Integer unitPrice; + @SerializedName("discount_amount") + private Integer discountAmount; + @SerializedName("goods_remark") + private String goodsRemark; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScoreNotifyData.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScoreNotifyData.java index 9711645ecc..9aea8e631e 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScoreNotifyData.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScoreNotifyData.java @@ -29,17 +29,22 @@ public class PayScoreNotifyData implements Serializable { @SerializedName("create_time") private String createTime; + /** + * 通知类型 + *

1、授权成功通知的类型为PAYSCORE.USER_OPEN_SERVICE

+ *

2、解除授权成功通知的类型为PAYSCORE.USER_CLOSE_SERVICE

+ *

3、用户确认成功通知的类型为PAYSCORE.USER_CONFIRM

+ *

4、支付成功通知的类型为PAYSCORE.USER_PAID

+ */ + @SerializedName("event_type") + private String eventType; + /** * 通知数据类型 */ @SerializedName("resource_type") private String resourceType; - /** - * 通知类型 - */ - @SerializedName("event_type") - private String eventType; /** * 通知数据 diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PromotionDetail.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PromotionDetail.java new file mode 100644 index 0000000000..78f88cc2ed --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PromotionDetail.java @@ -0,0 +1,41 @@ +package com.github.binarywang.wxpay.bean.payscore; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * 优惠详情 + **/ +@Data +@NoArgsConstructor +public class PromotionDetail implements Serializable { + + private static final long serialVersionUID = -4405156288317582934L; + + @SerializedName("coupon_id") + private String couponId; + @SerializedName("name") + private String name; + @SerializedName("scope") + private String scope; + @SerializedName("type") + private String type; + @SerializedName("amount") + private Integer amount; + @SerializedName("stock_id") + private String stockId; + @SerializedName("wechatpay_contribute") + private Integer wechatpayContribute; + @SerializedName("merchant_contribute") + private Integer merchantContribute; + @SerializedName("other_contribute") + private Integer otherContribute; + @SerializedName("currency") + private String currency; + @SerializedName("goods_detail") + private List goodsDetail; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/SyncDetail.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/SyncDetail.java new file mode 100644 index 0000000000..8675299c88 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/SyncDetail.java @@ -0,0 +1,24 @@ +package com.github.binarywang.wxpay.bean.payscore; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @description 内容信息详情 + * createTime: 2023/9/19 16:39 + **/ +@Data +@NoArgsConstructor +public class SyncDetail implements Serializable { + + private static final long serialVersionUID = 8173356554917822934L; + @SerializedName("seq") + private int seq; + @SerializedName("paid_time") + private String paidTime; + @SerializedName("paid_amount") + private Integer paidAmount; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/TimeRange.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/TimeRange.java index 034609f44c..3062f87212 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/TimeRange.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/TimeRange.java @@ -26,4 +26,16 @@ public class TimeRange implements Serializable { private String startTime; @SerializedName("end_time") private String endTime; + + /** + * 服务开始时间备注 + */ + @SerializedName("start_time_remark") + private String startTimeRemark; + + /** + * 服务结束时间备注 + */ + @SerializedName("end_time_remark") + private String endTimeRemark; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreRequest.java index f2c977e37d..a29e08bd92 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreRequest.java @@ -37,6 +37,8 @@ public String toJson() { /** * 子商户公众号下的用户表示sub_openid + * 微信用户在子商户公众号sub_appid下的唯一标识; + * need_user_confirm为false时,1. openid与sub_openid必须填写并且只能填写一个 2. 如果填写了sub_openid,那么sub_appid必填 */ @SerializedName("sub_openid") private String subOpenid; diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreResult.java index 45c7032d1a..cc80cc08f4 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreResult.java @@ -24,6 +24,9 @@ public static WxPartnerPayScoreResult fromJson(String json) { @SerializedName("sub_mchid") private String subMchid; + /** + * 子商户公众号下的用户标识 + */ @SerializedName("sub_openid") private String subOpenId; diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequest.java index 2e397cdbd1..3c58a62e80 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequest.java @@ -80,8 +80,19 @@ public String toJson() { @SerializedName("type") private String type; @SerializedName("detail") - private Detail detail; + private SyncDetail detail; @SerializedName("authorization_code") private String authorizationCode; + /** + * 完结服务时间 + * 时间使用ISO 8601所定义的格式。 + * 示例: + * - YYYY-MM-DDTHH:mm:ss.SSSZ + * - YYYY-MM-DDTHH:mm:ssZ + * - YYYY-MM-DDTHH:mm:ss.SSS+08:00 + * - YYYY-MM-DDTHH:mm:ss+08:00 + */ + @SerializedName("complete_time") + private String completeTime; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreResult.java index 2f16d2148d..31942a954b 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreResult.java @@ -103,6 +103,30 @@ public static WxPayScoreResult fromJson(String json) { @SerializedName("authorization_success_time") private String authorizationSuccessTime; + /** + * 用户分层 + */ + @SerializedName("user_risk_level") + private Integer userRiskLevel; + + /** + * 分层版本 + */ + @SerializedName("risk_level_version") + private Integer riskLevelVersion; + + /** + * 总金额 + */ + @SerializedName("total_amount") + private Integer totalAmount; + + /** + * 渠道商商户号 + */ + @SerializedName("channel_id") + private String channelId; + /** * 收款信息 */ diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayRefundQueryV3Result.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayRefundQueryV3Result.java index c203d75699..2ebd035a74 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayRefundQueryV3Result.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayRefundQueryV3Result.java @@ -17,6 +17,7 @@ @Data @NoArgsConstructor public class WxPayRefundQueryV3Result implements Serializable { + private static final long serialVersionUID = 532057810377362827L; /** *
    * 字段名:微信支付退款号
@@ -311,6 +312,12 @@ public static class Amount implements Serializable {
      */
     @SerializedName(value = "currency")
     private String currency;
+
+    /**
+     * 手续费退款金额
+     */
+    @SerializedName(value = "refund_fee")
+    private Integer refundFee;
   }
 
   @Data
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayRefundV3Result.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayRefundV3Result.java
index 8930bac83c..eed6ff254e 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayRefundV3Result.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayRefundV3Result.java
@@ -313,6 +313,12 @@ public static class Amount implements Serializable {
      */
     @SerializedName(value = "currency")
     private String currency;
+
+    /**
+     * 手续费退款金额
+     */
+    @SerializedName(value = "refund_fee")
+    private Integer refundFee;
   }
 
   @Data
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/Applyment4SubService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/Applyment4SubService.java
index 61412b75d1..c0b443a0da 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/Applyment4SubService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/Applyment4SubService.java
@@ -73,13 +73,16 @@ public interface Applyment4SubService {
 
   /**
    * 查询结算账户修改申请状态
-   * 文档详见:https://pay.weixin.qq.com/docs/partner/apis/modify-settlement/sub-merchants/get-application.html
-   * 接口链接:https://api.mch.weixin.qq.com/v3/apply4sub/sub_merchants/{sub_mchid}/application/{application_no}
    *
-   * @param subMchid
-   * @param applicationNo
-   * @return
+   * @param subMchid      特约商户号
+   * @param applicationNo 修改结算账户申请单号
+   *
+   * @return {@link SettlementModifyStateQueryResult}
    * @throws WxPayException
+   * @apiNote 查询结算账户修改申请状态
+   *
+   * 

接口链接:https://api.mch.weixin.qq.com/v3/apply4sub/sub_merchants/{sub_mchid}/application/{applicationNo}

*/ - SettlementApplicationResult settlementApplication(String subMchid, String applicationNo) throws WxPayException; + SettlementModifyStateQueryResult querySettlementModifyStatusByApplicationNo(String subMchid, String applicationNo) throws 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 1609929949..c5c4e06796 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,7 +1,10 @@ package com.github.binarywang.wxpay.service; import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader; -import com.github.binarywang.wxpay.bean.payscore.*; +import com.github.binarywang.wxpay.bean.payscore.PayScoreNotifyData; +import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreRequest; +import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreResult; +import com.github.binarywang.wxpay.bean.payscore.WxPartnerUserAuthorizationStatusNotifyResult; import com.github.binarywang.wxpay.exception.WxPayException; /** @@ -18,29 +21,26 @@ public interface PartnerPayScoreService { /** - *
-   * 支付分商户预授权API
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter5_1.shtml
-   * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions
-   * 
+ * 商户预授权 + * @param request {@link WxPartnerPayScoreRequest} 请求对象 * - * @param request 请求对象 * @return WxPartnerPayScoreResult wx partner payscore result * @throws WxPayException the wx pay exception + * @apiNote 商户预授权 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions */ WxPartnerPayScoreResult permissions(WxPartnerPayScoreRequest request) throws WxPayException; /** - *
-   * 支付分查询与用户授权记录(授权协议号)API
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter5_2.shtml
-   * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions/authorization-code/{authorization_code}
-   * 
+ * 商户查询与用户授权记录 (authorization_code) + * @apiNote 商户查询与用户授权记录 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions/authorization-code/{authorization_code} + * + * @param serviceId 服务id + * @param subMchid 特约子商户号 + * @param authorizationCode 授权协议号 * - * @param serviceId - * @param subMchid - * @param authorizationCode * @return WxPayScoreResult wx partner payscore result * @throws WxPayException the wx pay exception */ @@ -49,55 +49,53 @@ WxPartnerPayScoreResult permissionsQueryByAuthorizationCode(String serviceId, St /** - *
-   * 解除用户授权关系(授权协议号)API
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter5_4.shtml
-   * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions/authorization-code/{authorization_code}/terminate
-   * 
+ * 商户解除用户授权关系(authorization_code) + * + * @param serviceId 服务id + * @param subMchid 特约子商户号 + * @param authorizationCode 授权协议号 + * @param reason 撤销原因 * - * @param serviceId - * @param subMchid - * @param authorizationCode - * @param reason * @return WxPartnerPayScoreResult wx partner payscore result * @throws WxPayException the wx pay exception + * @apiNote : 商户解除用户授权关系 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions/authorization-code/{authorization_code}/terminate */ WxPartnerPayScoreResult permissionsTerminateByAuthorizationCode(String serviceId, String subMchid, String authorizationCode, String reason) throws WxPayException; /** - *
-   * 支付分查询与用户授权记录(openid)API
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter5_3.shtml
-   * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions/search
-   * 
+ * 商户查询与用户授权记录(OpenID) + * + * @param serviceId 服务id + * @param subMchid 特约子商户号 + * @param appId 服务商的公众号ID + * @param subAppid 子商户的公众号ID + * @param openId 服务商的用户标识 + * @param subOpenid 子商户的用户标识 * - * @param serviceId - * @param subMchid - * @param subAppid - * @param openId - * @param subOpenid * @return WxPayScoreResult wx partner payscore result * @throws WxPayException the wx pay exception + * @apiNote 商户查询与用户授权记录 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions/search */ WxPartnerPayScoreResult permissionsQueryByOpenId(String serviceId, String appId, String subMchid, String subAppid, String openId, String subOpenid) throws WxPayException; /** - *
-   * 解除用户授权关系(openid)API
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter5_5.shtml
-   * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions/openid/{openid}/terminate
-   * 
+ * 商户解除用户授权关系API(OpenID) + * @apiNote 商户解除用户授权关系API + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/permissions/terminate * - * @param serviceId - * @param subMchid - * @param subAppid - * @param openId - * @param subOpenid - * @param reason + * @param serviceId 服务id + * @param subMchid 特约子商户号 + * @param appId 服务商的公众号ID + * @param subAppid 子商户的公众号ID + * @param openId 服务商的用户标识 + * @param subOpenid 子商户的用户标识 + * @param reason 取消理由 * @return WxPayScoreResult wx partner payscore result * @throws WxPayException the wx pay exception */ @@ -106,106 +104,96 @@ WxPartnerPayScoreResult permissionsTerminateByOpenId(String serviceId, String ap /** - *
    * 支付分创建订单API.
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter3_1.shtml
-   * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder
-   * 
* * @param request 请求对象 + * * @return WxPayScoreResult wx partner payscore result * @throws WxPayException the wx pay exception + * @apiNote 创建订单 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder */ WxPartnerPayScoreResult createServiceOrder(WxPartnerPayScoreRequest request) throws WxPayException; /** - *
    * 支付分查询订单API.
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter3_2.shtml
-   * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder
-   * 
* - * @param serviceId - * @param subMchid - * @param outOrderNo the out order no - * @param queryId the query id + * @param serviceId 服务ID + * @param subMchid 子商户商户号 + * @param outOrderNo 商户订单号 + * @param queryId 单据查询ID + * * @return the wx pay score result * @throws WxPayException the wx pay exception + * @apiNote 查询订单 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder */ WxPartnerPayScoreResult queryServiceOrder(String serviceId, String subMchid, String outOrderNo, String queryId) throws WxPayException; /** - *
    * 支付分取消订单API.
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter3_3.shtml
-   * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/cancel
-   * 
- *

* - * @param serviceId - * @param subMchid - * @param outOrderNo the out order no - * @param reason the reason + * @param serviceId 服务ID + * @param subMchid 子商户商户号 + * @param outOrderNo 商户订单号 + * @param reason 撤销原因 + * * @return com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult wx pay score result * @throws WxPayException the wx pay exception + * @apiNote 取消订单 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/cancel */ WxPartnerPayScoreResult cancelServiceOrder(String serviceId, String appId, String subMchid, String outOrderNo, String reason) throws WxPayException; /** - *

    * 支付分修改订单金额API.
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter3_4.shtml
-   * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/modify
-   * 
- *

* * @param request the request + * * @return the wx pay score result * @throws WxPayException the wx pay exception + * @apiNote 修改订单金额 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/modify */ WxPartnerPayScoreResult modifyServiceOrder(WxPartnerPayScoreRequest request) throws WxPayException; /** - *

    * 支付分完结订单API.
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter3_5.shtml
-   * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/complete
-   * 
* * @param request the request + * * @return the wx pay score result * @throws WxPayException the wx pay exception + * @apiNote 完结订单 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/complete */ void completeServiceOrder(WxPartnerPayScoreRequest request) throws WxPayException; /** - *
-   * 商户发起催收扣款API.
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter3_6.shtml
-   * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/pay
+   * 订单收款
    *
-   * 
+ * @param serviceId 服务ID + * @param subMchid 子商户商户号 + * @param outOrderNo 商户订单号 * - * @param serviceId - * @param subMchid - * @param outOrderNo the out order no * @return the wx pay score result * @throws WxPayException the wx pay exception + * @apiNote 订单收款 + * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/pay */ WxPartnerPayScoreResult payServiceOrder(String serviceId, String appId, String subMchid, String outOrderNo) throws WxPayException; /** - *
-   * 支付分订单收款API.
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore_partner/chapter3_7.shtml
-   * 请求URL: https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/sync
-   * 
+ * 同步订单信息 * * @param request the request + * * @return the wx pay score result * @throws WxPayException the wx pay exception + * @apiNote 同步订单信息 + * 请求URL: https://api.mch.weixin.qq.com/v3/payscore/partner/serviceorder/{out_order_no}/sync */ WxPartnerPayScoreResult syncServiceOrder(WxPartnerPayScoreRequest request) throws WxPayException; @@ -236,23 +224,19 @@ WxPartnerPayScoreResult cancelServiceOrder(String serviceId, String appId, Strin WxPartnerPayScoreResult queryServiceAccountState(String outApplyNo) throws WxPayException; /** - *
-   * 授权/解除授权服务回调数据处理
-   * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter6_2_23.shtml
-   * 
+ * 授权/解除授权服务回调通知 * * @param notifyData 通知数据 * @param header 通知头部数据,不传则表示不校验头 + * * @return 解密后通知数据 return user authorization status notify result * @throws WxPayException the wx pay exception + * @apiNote 授权/解除授权服务回调通知 */ WxPartnerUserAuthorizationStatusNotifyResult parseUserAuthorizationStatusNotifyResult(String notifyData, SignatureHeader header) throws WxPayException; /** - *
    * 支付分回调内容解析方法
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter6_2_9.shtml
-   * 
* * @param data the data * @return the wx pay score result @@ -260,10 +244,7 @@ WxPartnerPayScoreResult cancelServiceOrder(String serviceId, String appId, Strin PayScoreNotifyData parseNotifyData(String data, SignatureHeader header) throws WxPayException; /** - *
    * 支付分回调NotifyData解密resource
-   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter5_2.shtml
-   * 
* * @param data the data * @return the wx pay score result diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java index 2ca5a1ba4f..7fd655824a 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java @@ -65,9 +65,9 @@ public String modifySettlement(String subMchid, ModifySettlementRequest request) } @Override - public SettlementApplicationResult settlementApplication(String subMchid, String applicationNo) throws WxPayException { + public SettlementModifyStateQueryResult querySettlementModifyStatusByApplicationNo(String subMchid, String applicationNo) throws WxPayException { String url = String.format("%s/v3/apply4sub/sub_merchants/%s/application/%s", this.payService.getPayBaseUrl(), subMchid, applicationNo); String result = payService.getV3(url); - return GSON.fromJson(result, SettlementApplicationResult.class); + return GSON.fromJson(result, SettlementModifyStateQueryResult.class); } } diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequestTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequestTest.java index 757f2aafa3..5d29f15a76 100644 --- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequestTest.java +++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequestTest.java @@ -14,7 +14,7 @@ public void testToJson() { .appid("123") .serviceId("345") .serviceIntroduction("租借服务") - .timeRange(new TimeRange("OnAccept", "20200520225840")) + .timeRange(new TimeRange("20230901011023", "20230930235959","开始时间","结束时间")) .build(); System.out.println(request.toJson()); /* {