Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:new 【开放平台】增加试用小程序快速认证接口 #3189

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -278,13 +284,14 @@ public interface WxOpenMaService extends WxMaService {
/**
* 修改域名
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Mini_Program_Basic_Info/Server_Address_Configuration.html">文档地址</a>
*
* @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
*/
Expand Down Expand Up @@ -441,6 +448,15 @@ WxOpenMaDomainResult modifyDomain(String action, List<String> requestDomains, Li
*/
File getTestQrcode(String pagePath, Map<String, String> 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;

/**
* 获取授权小程序帐号的可选类目
* <p>
Expand Down Expand Up @@ -689,6 +705,7 @@ WxOpenMaDomainResult modifyDomain(String action, List<String> requestDomains, Li

/**
* 购物订单
*
* @return 购物订单服务
*/
WxOpenMaShoppingOrdersService getShoppingOrdersService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -218,6 +219,12 @@ public File getTestQrcode(String pagePath, Map<String, String> 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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}