cgi_bin_ticket_getticket, cgibin_add_template, cgibin_send_data, cgibin_set_industry, cgibin_token, close_order, micro_mch_add, micro_mch_qry, oauth2_access_token, oauth2_refresh_token, pay_micropay, pay_orderquery, pay_refund, pay_reverse, pay_unifiedorder, sns_auth_token, sns_userinfo| 构造器和说明 |
|---|
WechatOfficial() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
generateWechatUrl(String appId,
String scope,
String callback,
String bizData)
wechat URL链接生成,
scope取值为:snsapi_base[无需用户授权] 或 userinfo[需用户授权]
state 为自定义参数,非必须
redirect_uri 微信处理完成后,会直接转向至该地址
|
static boolean |
IsvalidOauthAccessToken(Map<String,Object> mapToken)
检验授权凭证(access_token)是否有效
|
static TokenOutput |
obtainAccessToken(String appid,
String secret)
access_token是公众号的全局唯一接口调用凭据,公众号调用各接口时都需使用access_token。
|
static JsApiTicketOutput |
obtainJsApiTicket(String token)
获取jsapi_ticket,jsapi_ticket是公众号用于调用微信JS接口的临时票据。
|
static JsApiTicketOutput |
obtainJsApiTicket(String appid,
String secret)
功能同上,但不建议使用,token需要中控服务器维护
|
static OauthTokenOutput |
obtainOauthAccessToken(Map<String,Object> mapToken)
通过code换取网页授权access_token
access_token是调用授权关系接口的调用凭证,有效期为2个小时,频率限制:1万/分钟
|
static TemplateOutput |
obtainTemplateId(String access_token,
String template_id_short)
获取微信消息模板ID{根据微信template_id_short得到,实际动作是调用API往 ‘我的模板’ 中添加了模板}
|
static UserInfoOutput |
obtainUserInfo(Map<String,Object> userInfoMap)
获取微信用户个人信息
所需参数:access_token、openid、lang[非必须]
lang 国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语,默认为zh-CN
频率限制:5万/分钟
|
static OauthTokenOutput |
refreshOauthAccessToken(Map<String,Object> mapToken)
刷新access_token(如果需要)
当access_token超时后,可以使用refresh_token进行刷新,access_token刷新结果有两种
1.
|
static SendDataOutput |
sendData2wechat(String access_token,
String data)
发送数据至于用户公微信所关注的微信公账号
|
static IndustryOutput |
setupIndustry(String access_token,
String industry_id1,
String industry_id2)
设置行业属性
|
public static OauthTokenOutput obtainOauthAccessToken(Map<String,Object> mapToken)
mapToken - the map tokenpublic static OauthTokenOutput refreshOauthAccessToken(Map<String,Object> mapToken)
mapToken - the map tokenpublic static String generateWechatUrl(String appId, String scope, String callback, String bizData)
appId - the app idscope - the scopecallback - the callbackbizData - the biz datapublic static UserInfoOutput obtainUserInfo(Map<String,Object> userInfoMap)
userInfoMap - the user info mappublic static boolean IsvalidOauthAccessToken(Map<String,Object> mapToken)
mapToken - the map tokenpublic static TokenOutput obtainAccessToken(String appid, String secret)
appid - the appidsecret - the secretpublic static JsApiTicketOutput obtainJsApiTicket(String token)
token - 普通tokenpublic static JsApiTicketOutput obtainJsApiTicket(String appid, String secret)
appid - the appidsecret - the secretpublic static TemplateOutput obtainTemplateId(String access_token, String template_id_short)
access_token - the access tokentemplate_id_short - the template id shortpublic static IndustryOutput setupIndustry(String access_token, String industry_id1, String industry_id2)
access_token - the access tokenindustry_id1 - the industry id 1industry_id2 - the industry id 2public static SendDataOutput sendData2wechat(String access_token, String data)
access_token - the access tokendata - json格式数据Copyright © 2017. All rights reserved.