From da433d0b63338f668dc0d221ca3c7126c040b498 Mon Sep 17 00:00:00 2001 From: lemos Date: Tue, 19 Dec 2023 09:37:46 +0800 Subject: [PATCH] =?UTF-8?q?:new=20=E3=80=90=E5=BC=80=E6=94=BE=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E3=80=91=E5=A2=9E=E5=8A=A0=E8=AF=95=E7=94=A8=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=BF=AB=E9=80=9F=E8=AE=A4=E8=AF=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/open/api/WxOpenMaService.java | 27 +++++++-- .../open/api/impl/WxOpenMaServiceImpl.java | 7 +++ .../ma/WxMaVerifybetaweappVerifyInfo.java | 57 +++++++++++++++++++ .../WxOpenMaVerifybetaweappMessage.java | 24 ++++++++ 4 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxMaVerifybetaweappVerifyInfo.java create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenMaVerifybetaweappMessage.java diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java index cb3595836c..afbcd3c2d7 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java @@ -6,6 +6,7 @@ import me.chanjar.weixin.open.bean.ma.WxMaPrefetchDomain; import me.chanjar.weixin.open.bean.ma.WxMaScheme; import me.chanjar.weixin.open.bean.message.WxOpenMaSubmitAuditMessage; +import me.chanjar.weixin.open.bean.message.WxOpenMaVerifybetaweappMessage; import me.chanjar.weixin.open.bean.result.*; import java.io.File; @@ -113,17 +114,22 @@ public interface WxOpenMaService extends WxMaService { String API_TEST_QRCODE = "https://api.weixin.qq.com/wxa/get_qrcode"; /** - * 3. 获取授权小程序帐号的可选类目 + * 3. 试用小程序快速认证 + */ + String API_VERIFYBETAWEAPP = "https://api.weixin.qq.com/wxa/verifybetaweapp"; + + /** + * 4. 获取授权小程序帐号的可选类目 */ String API_GET_CATEGORY = "https://api.weixin.qq.com/wxa/get_category"; /** - * 4. 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用) + * 5. 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用) */ String API_GET_PAGE = "https://api.weixin.qq.com/wxa/get_page"; /** - * 5. 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用) + * 6. 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用) */ String API_SUBMIT_AUDIT = "https://api.weixin.qq.com/wxa/submit_audit"; @@ -278,13 +284,14 @@ public interface WxOpenMaService extends WxMaService { /** * 修改域名 * 文档地址 + * * @param action delete删除, set覆盖, get获取 * @param requestDomains request 合法域名;当 action 是 get 时不需要此字段 * @param wsRequestDomains socket 合法域名;当 action 是 get 时不需要此字段 * @param uploadDomains uploadFile 合法域名;当 action 是 get 时不需要此字段 * @param downloadDomains downloadFile 合法域名;当 action 是 get 时不需要此字段 - * @param tcpDomains tcp 合法域名;当 action 是 get 时不需要此字段 - * @param udpDomains udp 合法域名;当 action 是 get 时不需要此字段 + * @param tcpDomains tcp 合法域名;当 action 是 get 时不需要此字段 + * @param udpDomains udp 合法域名;当 action 是 get 时不需要此字段 * @return the wx open ma domain result * @throws WxErrorException the wx error exception */ @@ -441,6 +448,15 @@ WxOpenMaDomainResult modifyDomain(String action, List requestDomains, Li */ File getTestQrcode(String pagePath, Map params) throws WxErrorException; + /** + * 试用小程序快速认证 + * + * @param verifybetaweappMessage the verify mini program message + * @return the wx open result + * @throws WxErrorException the wx error exception + */ + WxOpenResult verifybetaweapp(WxOpenMaVerifybetaweappMessage verifybetaweappMessage) throws WxErrorException; + /** * 获取授权小程序帐号的可选类目 *

@@ -689,6 +705,7 @@ WxOpenMaDomainResult modifyDomain(String action, List requestDomains, Li /** * 购物订单 + * * @return 购物订单服务 */ WxOpenMaShoppingOrdersService getShoppingOrdersService(); diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java index 146273f4e0..71790a44d4 100644 --- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java @@ -18,6 +18,7 @@ import me.chanjar.weixin.open.bean.ma.WxMaQrcodeParam; import me.chanjar.weixin.open.bean.ma.WxMaScheme; import me.chanjar.weixin.open.bean.message.WxOpenMaSubmitAuditMessage; +import me.chanjar.weixin.open.bean.message.WxOpenMaVerifybetaweappMessage; import me.chanjar.weixin.open.bean.result.*; import me.chanjar.weixin.open.executor.MaQrCodeRequestExecutor; @@ -218,6 +219,12 @@ public File getTestQrcode(String pagePath, Map params) throws Wx return wxMaService.execute(MaQrCodeRequestExecutor.create(getRequestHttp()), API_TEST_QRCODE, qrcodeParam); } + @Override + public WxOpenResult verifybetaweapp(WxOpenMaVerifybetaweappMessage verifybetaweappMessage) throws WxErrorException { + String response = post(API_VERIFYBETAWEAPP, GSON.toJson(verifybetaweappMessage)); + return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class); + } + @Override public WxOpenMaCategoryListResult getCategoryList() throws WxErrorException { String response = get(API_GET_CATEGORY, null); diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxMaVerifybetaweappVerifyInfo.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxMaVerifybetaweappVerifyInfo.java new file mode 100644 index 0000000000..881163b675 --- /dev/null +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxMaVerifybetaweappVerifyInfo.java @@ -0,0 +1,57 @@ +package me.chanjar.weixin.open.bean.ma; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 企业法人认证需要的信息 + * + * @author lg + * created on 2023/12/19 + */ +@Data +public class WxMaVerifybetaweappVerifyInfo implements Serializable { + + /** + * 企业名(需与工商部门登记信息一致);如果是“无主体名称个体工商户”则填“个体户+法人姓名”,例如“个体户张三” + */ + @SerializedName("enterprise_name") + private String enterpriseName; + + /** + * 企业代码 + */ + private String code; + + /** + * 企业代码类型 1:统一社会信用代码(18 位) 2:组织机构代码(9 位 xxxxxxxx-x) 3:营业执照注册号(15 位) + */ + @SerializedName("code_type") + private String codeType; + + /** + * 法人微信号 + */ + @SerializedName("legal_persona_wechat") + private String legalPersonaWechat; + + /** + * 法人姓名(绑定银行卡) + */ + @SerializedName("legal_persona_name") + private String legalPersonaName; + + /** + * 第三方联系电话 + */ + @SerializedName("component_phone") + private String componentPhone; + + /** + * 法人身份证号 + */ + @SerializedName("legal_persona_idcard") + private String legalPersonaIdcard; +} diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenMaVerifybetaweappMessage.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenMaVerifybetaweappMessage.java new file mode 100644 index 0000000000..63a8291119 --- /dev/null +++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenMaVerifybetaweappMessage.java @@ -0,0 +1,24 @@ +package me.chanjar.weixin.open.bean.message; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import me.chanjar.weixin.open.bean.ma.WxMaVerifybetaweappVerifyInfo; + +import java.io.Serializable; + +/** + * 试用小程序快速认证(仅供第三方开发者代小程序调用) + * + * @author yqx + * created on 2018/9/13 + */ +@Data +public class WxOpenMaVerifybetaweappMessage implements Serializable { + private static final long serialVersionUID = 4595618023108631478L; + + /** + * 企业法人认证需要的信息 + */ + @SerializedName("verify_info") + private WxMaVerifybetaweappVerifyInfo verifyInfo; +}