Skip to content

Commit b01f919

Browse files
authored
🆕 #3189 【开放平台】增加试用小程序快速认证接口
1 parent c72c54d commit b01f919

File tree

4 files changed

+110
-5
lines changed

4 files changed

+110
-5
lines changed

weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import me.chanjar.weixin.open.bean.ma.WxMaPrefetchDomain;
77
import me.chanjar.weixin.open.bean.ma.WxMaScheme;
88
import me.chanjar.weixin.open.bean.message.WxOpenMaSubmitAuditMessage;
9+
import me.chanjar.weixin.open.bean.message.WxOpenMaVerifybetaweappMessage;
910
import me.chanjar.weixin.open.bean.result.*;
1011

1112
import java.io.File;
@@ -113,17 +114,22 @@ public interface WxOpenMaService extends WxMaService {
113114
String API_TEST_QRCODE = "https://api.weixin.qq.com/wxa/get_qrcode";
114115

115116
/**
116-
* 3. 获取授权小程序帐号的可选类目
117+
* 3. 试用小程序快速认证
118+
*/
119+
String API_VERIFYBETAWEAPP = "https://api.weixin.qq.com/wxa/verifybetaweapp";
120+
121+
/**
122+
* 4. 获取授权小程序帐号的可选类目
117123
*/
118124
String API_GET_CATEGORY = "https://api.weixin.qq.com/wxa/get_category";
119125

120126
/**
121-
* 4. 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用)
127+
* 5. 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用)
122128
*/
123129
String API_GET_PAGE = "https://api.weixin.qq.com/wxa/get_page";
124130

125131
/**
126-
* 5. 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用)
132+
* 6. 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用)
127133
*/
128134
String API_SUBMIT_AUDIT = "https://api.weixin.qq.com/wxa/submit_audit";
129135

@@ -278,13 +284,14 @@ public interface WxOpenMaService extends WxMaService {
278284
/**
279285
* 修改域名
280286
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Mini_Program_Basic_Info/Server_Address_Configuration.html">文档地址</a>
287+
*
281288
* @param action delete删除, set覆盖, get获取
282289
* @param requestDomains request 合法域名;当 action 是 get 时不需要此字段
283290
* @param wsRequestDomains socket 合法域名;当 action 是 get 时不需要此字段
284291
* @param uploadDomains uploadFile 合法域名;当 action 是 get 时不需要此字段
285292
* @param downloadDomains downloadFile 合法域名;当 action 是 get 时不需要此字段
286-
* @param tcpDomains tcp 合法域名;当 action 是 get 时不需要此字段
287-
* @param udpDomains udp 合法域名;当 action 是 get 时不需要此字段
293+
* @param tcpDomains tcp 合法域名;当 action 是 get 时不需要此字段
294+
* @param udpDomains udp 合法域名;当 action 是 get 时不需要此字段
288295
* @return the wx open ma domain result
289296
* @throws WxErrorException the wx error exception
290297
*/
@@ -441,6 +448,15 @@ WxOpenMaDomainResult modifyDomain(String action, List<String> requestDomains, Li
441448
*/
442449
File getTestQrcode(String pagePath, Map<String, String> params) throws WxErrorException;
443450

451+
/**
452+
* 试用小程序快速认证
453+
*
454+
* @param verifybetaweappMessage the verify mini program message
455+
* @return the wx open result
456+
* @throws WxErrorException the wx error exception
457+
*/
458+
WxOpenResult verifybetaweapp(WxOpenMaVerifybetaweappMessage verifybetaweappMessage) throws WxErrorException;
459+
444460
/**
445461
* 获取授权小程序帐号的可选类目
446462
* <p>
@@ -689,6 +705,7 @@ WxOpenMaDomainResult modifyDomain(String action, List<String> requestDomains, Li
689705

690706
/**
691707
* 购物订单
708+
*
692709
* @return 购物订单服务
693710
*/
694711
WxOpenMaShoppingOrdersService getShoppingOrdersService();

weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import me.chanjar.weixin.open.bean.ma.WxMaQrcodeParam;
1919
import me.chanjar.weixin.open.bean.ma.WxMaScheme;
2020
import me.chanjar.weixin.open.bean.message.WxOpenMaSubmitAuditMessage;
21+
import me.chanjar.weixin.open.bean.message.WxOpenMaVerifybetaweappMessage;
2122
import me.chanjar.weixin.open.bean.result.*;
2223
import me.chanjar.weixin.open.executor.MaQrCodeRequestExecutor;
2324

@@ -218,6 +219,12 @@ public File getTestQrcode(String pagePath, Map<String, String> params) throws Wx
218219
return wxMaService.execute(MaQrCodeRequestExecutor.create(getRequestHttp()), API_TEST_QRCODE, qrcodeParam);
219220
}
220221

222+
@Override
223+
public WxOpenResult verifybetaweapp(WxOpenMaVerifybetaweappMessage verifybetaweappMessage) throws WxErrorException {
224+
String response = post(API_VERIFYBETAWEAPP, GSON.toJson(verifybetaweappMessage));
225+
return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
226+
}
227+
221228
@Override
222229
public WxOpenMaCategoryListResult getCategoryList() throws WxErrorException {
223230
String response = get(API_GET_CATEGORY, null);
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package me.chanjar.weixin.open.bean.ma;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Data;
5+
6+
import java.io.Serializable;
7+
8+
/**
9+
* 企业法人认证需要的信息
10+
*
11+
* @author lg
12+
* created on 2023/12/19
13+
*/
14+
@Data
15+
public class WxMaVerifybetaweappVerifyInfo implements Serializable {
16+
17+
/**
18+
* 企业名(需与工商部门登记信息一致);如果是“无主体名称个体工商户”则填“个体户+法人姓名”,例如“个体户张三”
19+
*/
20+
@SerializedName("enterprise_name")
21+
private String enterpriseName;
22+
23+
/**
24+
* 企业代码
25+
*/
26+
private String code;
27+
28+
/**
29+
* 企业代码类型 1:统一社会信用代码(18 位) 2:组织机构代码(9 位 xxxxxxxx-x) 3:营业执照注册号(15 位)
30+
*/
31+
@SerializedName("code_type")
32+
private String codeType;
33+
34+
/**
35+
* 法人微信号
36+
*/
37+
@SerializedName("legal_persona_wechat")
38+
private String legalPersonaWechat;
39+
40+
/**
41+
* 法人姓名(绑定银行卡)
42+
*/
43+
@SerializedName("legal_persona_name")
44+
private String legalPersonaName;
45+
46+
/**
47+
* 第三方联系电话
48+
*/
49+
@SerializedName("component_phone")
50+
private String componentPhone;
51+
52+
/**
53+
* 法人身份证号
54+
*/
55+
@SerializedName("legal_persona_idcard")
56+
private String legalPersonaIdcard;
57+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package me.chanjar.weixin.open.bean.message;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Data;
5+
import me.chanjar.weixin.open.bean.ma.WxMaVerifybetaweappVerifyInfo;
6+
7+
import java.io.Serializable;
8+
9+
/**
10+
* 试用小程序快速认证(仅供第三方开发者代小程序调用)
11+
*
12+
* @author yqx
13+
* created on 2018/9/13
14+
*/
15+
@Data
16+
public class WxOpenMaVerifybetaweappMessage implements Serializable {
17+
private static final long serialVersionUID = 4595618023108631478L;
18+
19+
/**
20+
* 企业法人认证需要的信息
21+
*/
22+
@SerializedName("verify_info")
23+
private WxMaVerifybetaweappVerifyInfo verifyInfo;
24+
}

0 commit comments

Comments
 (0)