public interface WeiXinService
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
Access_Type_Normal |
static String |
Access_Type_Page |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
access(String token,
String signature,
String timestamp,
String nonce) |
ErrorMsg |
addKfAccount(String appid,
String secret,
KfSend kfSend)
添加客服账号
|
Map<String,Object> |
appPayV3(RequestParam payParam) |
List<WXUser> |
batchgetUserInfo(String appid,
String secret,
List<String> openidList) |
SendMessage |
builderSendByRecv(RecvMessage msg) |
ErrorMsg |
closeKfSession(String appid,
String secret,
KfSend kfSend)
关闭会话
|
String |
createCodeRequestUrl(String appid,
String secret,
String url) |
ErrorMsg |
createKfSession(String appid,
String secret,
KfSend kfSend)
创建会话
|
String |
createLimitQRCode(String ticket) |
String |
createUnscribeCodeRequestUrl(String appid,
String secret,
String url) |
String |
decryptV3(String associatedData,
String nonce,
String ciphertext)
v3报文解密
|
String |
decryptWxa(String appId,
String encryptedData,
String sessionKey,
String iv)
解密小程序数据
|
ErrorMsg |
delKfAccount(String appid,
String secret,
String kfAccount)
删除客服账号
|
void |
downloadPlatformCertificate()
下载平台证书(更新V3微信平台证书,12小时内调用一次)
|
String |
generateMassImgMessage(String mediaID,
List<String> openIDS)
生成群发图片消息
|
String |
generateMassMPNewsMessage(String mediaID,
List<String> openIDS)
生成群发图文消息
|
String |
generateMassTextMessage(String text,
List<String> openIDS)
生成群发文本消息
|
String |
generateMassVoiceMessage(String mediaID,
List<String> openIDS)
生成群发语音消息
|
String |
getAppletOpenID(String appid,
String secret,
String code) |
String |
getContacTway(String accessToken,
String configId)
获取企业配置的「联系我」二维码和「联系我」小程序按钮
|
String |
getDeliveryList(String appId,
String token)
获取运力id列表get_delivery_list
|
JSAPI |
getJSAPI(String appid,
String secret,
String url)
生成JSAPI
|
List<KfEntity> |
getKfList(String appid,
String secret)
获取客服列表
|
RecKfSessionEntity |
getKfSession(String appid,
String secret,
String openid)
获取客户会话状态
|
List<RecKfSessionEntity> |
getKfSessionList(String appid,
String secret,
String kfAccount)
获取客服会话列表
|
List<KfEntity> |
getOnlineKfList(String appid,
String secret)
获取在线客服列表
|
String |
getOpenID(String appid,
String secret,
String code) |
OpenIDList |
getOpenIDList(String appid,
String secret,
String next_openid) |
WxDeliverGoodsOrder |
getOrder(String appId,
String token,
String transaction_id,
String merchant_id,
String sub_merchant_id,
String merchant_trade_no)
查询订单发货状态
|
String |
getOrderList(String appId,
String token,
Long begin_time,
Long end_time,
Integer order_state,
String openid,
String last_index,
Long page_size) |
ResponseEntity |
getPaidUnionId(AppConfigParam appConfigParam,
RequestParam requestParam)
用户支付完成后,获取该用户的 UnionId,无需用户授权
调用前需要用户完成支付,且在支付后的五分钟内有效。
|
String |
getQRTicket(String appid,
String secret,
Long sceneID,
String sceneStr) |
String |
getToken(String appid,
String secret) |
String |
getTokenByCorp(String corpid,
String corpsecret)
企业微信获取token
|
WXUser |
getUserInfo(String appid,
String secret,
String openID) |
WXUser |
getUserInfoByCode(String appid,
String secret,
String code) |
RecKfSession |
getWaitcaseKfSessionList(String appid,
String secret)
获取未接入会话列表
|
String |
getWxaCodeUnlimited(AppConfigParam appConfigParam,
WxaCodeParam wxaCodeParam)
获取小程序码,适用于需要的码数量极多的业务场景。
|
ErrorMsg |
inviteKfAccount(String appid,
String secret,
KfSend kfSend)
邀请绑定客服账号
|
void |
massSendNewsMessageByOpenID(String appid,
String secret,
String content)
根据OpenID群发消息
|
String |
multiProfitSharing(String subMchId,
String appId,
String transactionId,
String outOrderNo,
List<Receiver> receivers,
String subAppId)
商户分账多次分账
|
String |
notifyConfirmReceive(String appId,
String token,
String transaction_id,
String merchant_id,
String sub_merchant_id,
String merchant_trade_no,
Long received_time)
确认收货提醒接口
注意事项
通过交易单号或商户号+商户单号来指定订单。
|
Map<String,Object> |
partnerPayV3(PayParam payParam,
String type)
服务商微信支付
|
SendMessage |
processMessage(SendMessage sendMsg,
String url) |
String |
profitSharing(String subMchId,
String transactionId,
String outOrderNo,
List<Receiver> receivers,
String subAppId)
商户分账单次分账
|
String |
profitSharingAddReceiver(String subMchId,
Receiver receiver,
String subAppId)
添加分账接收方
|
String |
profitSharingFinish(String subMchId,
String transactionId,
String outOrderNo,
String description)
完结分账
|
String |
profitSharingMerchantRatioQuery(String subMchId)
查询订单最大分账比例
|
String |
profitSharingOrderAmountQuery(String mchId,
String transactionId)
查询订单最大分账比例
|
String |
profitSharingRemoveReceiver(String subMchId,
Receiver receiver,
String subAppId)
删除分账接收方
|
String |
profitSharingReturn(String appId,
String subAppId,
String subMchId,
String orderId,
String outOrderNo,
String outReturnNo,
String returnAccount,
Integer returnAmount,
String description) |
boolean |
publishMenu(String appid,
String secret,
String menu) |
void |
putAppid_secret(String appid,
String secret) |
String |
queryMenu(String appid,
String secret) |
RecvMessage |
recv(InputStream in) |
Map<String,Object> |
refund(RefundInfo refundInfo,
String type) |
String |
refund(String appId,
String subMchId,
String transactionId,
String outTradeNo,
String outRefundNo,
Integer totalFee,
Integer refundFee,
String notifyUrl) |
boolean |
removeMenu(String appid,
String secret) |
void |
send(SendMessage msg,
OutputStream out) |
String |
sendAppletMessage(String appid,
String secret,
String content,
boolean asynchrony) |
String |
sendCustomMessage(String appid,
String secret,
String content,
boolean asynchrony) |
String |
sendSubscribeMessage(String appId,
SubscribeMessage subscribeMessage)
消息订阅
|
String |
sendTemplateMessage(String appid,
String secret,
String content,
boolean asynchrony) |
String |
setMsgJumpPath(String appId,
String token,
String path)
消息跳转路径设置接口
|
void |
setToken(String appid,
String token) |
void |
updateAccessToken() |
void |
updateAccessToken(String appid,
String secret) |
ErrorMsg |
updateKfAccount(String appid,
String secret,
KfSend kfSend)
设置客服信息
|
String |
uploadCombinedShippingInfo(String appId,
String token,
WxDeliverGoodsCombined wxDeliverGoodsCombined)
发货信息合单录入接口
注意事项
根据指定的订单单号类型,采用不同参数给指定订单上传物流信息,注意子单和主单的订单单号类型必须一致:
(1).
|
String |
uploadMedia(String appid,
String secret,
File file,
String type)
上传媒体消息素材
|
String |
uploadNews(String appid,
String secret,
String content)
上传多图文消息,需要先上传媒体消息,获取媒体消息ID
|
String |
uploadShippingInfo(String appId,
String token,
WxDeliverGoods wxDeliverGoods)
发货信息录入接口
注意事项
根据指定的订单单号类型,采用不同参数给指定订单上传物流信息:
(1).
|
ResponseEntity |
wxaCode2Session(String appid,
String secret,
String code)
登录凭证校验。
|
RecvMessage recv(InputStream in) throws org.jdom.JDOMException, IOException
org.jdom.JDOMExceptionIOExceptionvoid send(SendMessage msg, OutputStream out) throws org.jdom.JDOMException, IOException
org.jdom.JDOMExceptionIOExceptionSendMessage builderSendByRecv(RecvMessage msg)
String createUnscribeCodeRequestUrl(String appid, String secret, String url)
ResponseEntity wxaCode2Session(String appid, String secret, String code)
appid - secret - code - List<WXUser> batchgetUserInfo(String appid, String secret, List<String> openidList)
String sendTemplateMessage(String appid, String secret, String content, boolean asynchrony)
SendMessage processMessage(SendMessage sendMsg, String url)
String sendCustomMessage(String appid, String secret, String content, boolean asynchrony)
String sendAppletMessage(String appid, String secret, String content, boolean asynchrony)
ResponseEntity getPaidUnionId(AppConfigParam appConfigParam, RequestParam requestParam)
appid - secret - openId - openId - String getWxaCodeUnlimited(AppConfigParam appConfigParam, WxaCodeParam wxaCodeParam)
appConfigParam - appid信息wxaCodeParam - 二维码配置信息String decryptWxa(String appId, String encryptedData, String sessionKey, String iv)
appId - appid信息encryptedData - 加密字符串sessionKey - sessionKeyiv - ivString uploadMedia(String appid, String secret, File file, String type)
appid - secret - file - type - String uploadNews(String appid, String secret, String content)
appid - secret - content - void massSendNewsMessageByOpenID(String appid, String secret, String content)
appid - secret - content - String generateMassMPNewsMessage(String mediaID, List<String> openIDS)
mediaID - openIDS - String generateMassTextMessage(String text, List<String> openIDS)
text - openIDS - String generateMassVoiceMessage(String mediaID, List<String> openIDS)
mediaID - openIDS - String generateMassImgMessage(String mediaID, List<String> openIDS)
mediaID - openIDS - OpenIDList getOpenIDList(String appid, String secret, String next_openid)
void updateAccessToken()
ErrorMsg delKfAccount(String appid, String secret, String kfAccount)
kfAccount - 客服账号RecKfSessionEntity getKfSession(String appid, String secret, String openid)
openid - 客户openidList<RecKfSessionEntity> getKfSessionList(String appid, String secret, String kfAccount)
kfAccount - 客服账号RecKfSession getWaitcaseKfSessionList(String appid, String secret)
Map<String,Object> partnerPayV3(PayParam payParam, String type)
payParam - 支付配置type - 支付类型()Map<String,Object> appPayV3(RequestParam payParam)
Map<String,Object> refund(RefundInfo refundInfo, String type)
String decryptV3(String associatedData, String nonce, String ciphertext) throws GeneralSecurityException, IOException
associatedData - nonce - ciphertext - GeneralSecurityExceptionIOExceptionvoid downloadPlatformCertificate()
String profitSharing(String subMchId, String transactionId, String outOrderNo, List<Receiver> receivers, String subAppId)
transactionId - 微信支付订单号outOrderNo - 商户系统内部的分账单号,在商户系统内部唯一(单次分账、多次分账、完结分账应使用不同的商户分账单号),同一分账单号多次请求等同一次。只能是数字、大小写字母_-|*@subMchId - 子商户号receivers - 分账接收方subAppId - 特约商户appidString multiProfitSharing(String subMchId, String appId, String transactionId, String outOrderNo, List<Receiver> receivers, String subAppId)
transactionId - 微信支付订单号outOrderNo - 商户系统内部的分账单号,在商户系统内部唯一(单次分账、多次分账、完结分账应使用不同的商户分账单号),同一分账单号多次请求等同一次。只能是数字、大小写字母_-|*@subMchId - 子商户号receivers - 分账接收方subAppId - 特约商户appidString profitSharingAddReceiver(String subMchId, Receiver receiver, String subAppId)
subMchId - 子商户号receivers - 分账接收方subAppId - 特约商户appidString profitSharingRemoveReceiver(String subMchId, Receiver receiver, String subAppId)
subMchId - 子商户号receiver - 分账接收方subAppId - 特约商户appidString profitSharingFinish(String subMchId, String transactionId, String outOrderNo, String description)
transactionId - 微信支付订单号outOrderNo - 商户系统内部的分账单号,在商户系统内部唯一(单次分账、多次分账、完结分账应使用不同的商户分账单号),同一分账单号多次请求等同一次。只能是数字、大小写字母_-|*@description - 描述subMchId - 特约商户号String profitSharingMerchantRatioQuery(String subMchId)
subMchId - 特约商户号String profitSharingOrderAmountQuery(String mchId, String transactionId)
transactionId - 微信支付订单号String profitSharingReturn(String appId, String subAppId, String subMchId, String orderId, String outOrderNo, String outReturnNo, String returnAccount, Integer returnAmount, String description)
String refund(String appId, String subMchId, String transactionId, String outTradeNo, String outRefundNo, Integer totalFee, Integer refundFee, String notifyUrl)
String sendSubscribeMessage(String appId, SubscribeMessage subscribeMessage)
subscribeMessage - 订阅消息参数String uploadShippingInfo(String appId, String token, WxDeliverGoods wxDeliverGoods)
appId - token - access_token,不传的话由appid去找wxDeliverGoods - String uploadCombinedShippingInfo(String appId, String token, WxDeliverGoodsCombined wxDeliverGoodsCombined)
appId - token - access_token,不传的话由appid去找wxDeliverGoodsCombined - WxDeliverGoodsOrder getOrder(String appId, String token, String transaction_id, String merchant_id, String sub_merchant_id, String merchant_trade_no)
appId - token - access_token,不传的话由appid去找transaction_id - 原支付交易对应的微信订单号。merchant_id - 支付下单商户的商户号,由微信支付生成并下发。sub_merchant_id - 二级商户号。merchant_trade_no - 商户系统内部订单号,只能是数字、大小写字母`_-*`且在同一个商户号下唯一。String getOrderList(String appId, String token, Long begin_time, Long end_time, Integer order_state, String openid, String last_index, Long page_size)
appId - token - access_token,不传的话由appid去找begin_time - 支付时间所属范围。end_time - "pay_time_range": {
"begin_time": 1670563531,
"end_time": 1670563531
}order_state - 订单状态枚举:(1) 待发货;(2) 已发货;(3) 确认收货;(4) 交易完成;(5) 已退款。openid - 支付者openid。last_index - 翻页时使用,获取第一页时不用传入,如果查询结果中 has_more 字段为 true,则传入该次查询结果中返回的 last_index 字段可获取下一页。page_size - 翻页时使用,返回列表的长度,默认为100String notifyConfirmReceive(String appId, String token, String transaction_id, String merchant_id, String sub_merchant_id, String merchant_trade_no, Long received_time)
appId - token - access_token,不传的话由appid去找transaction_id - 原支付交易对应的微信订单号。merchant_id - 支付下单商户的商户号,由微信支付生成并下发。sub_merchant_id - 二级商户号。merchant_trade_no - 商户系统内部订单号,只能是数字、大小写字母`_-*`且在同一个商户号下唯一。received_time - 快递签收时间,时间戳形式 必填String setMsgJumpPath(String appId, String token, String path)
appId - token - access_token,不传的话由appid去找path - 商户自定义跳转路径。必填
注意事项
如设置为空路径或小程序中不存在的路径,将仍然跳转平台默认的确认收货页面,不会进入你的小程序。
平台会在路径后面增加支付单的 transaction_id、merchant_id、merchant_trade_no 作为query参数,如果存在二级商户号则还会再增加 sub_merchant_id 参数,开发者可以在小程序中通过onLaunch等方式获取。
如你需要在path中携带自定义的query参数,请注意与上面的参数进行区分String getDeliveryList(String appId, String token)
appId - token - access_token,不传的话由appid去找String getTokenByCorp(String corpid, String corpsecret)
corpid - corpsecret - Copyright © 2024. All rights reserved.