Skip to content
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 @@ -4,6 +4,7 @@
import me.chanjar.weixin.common.util.http.ApacheHttpClientBuilder;

import javax.net.ssl.SSLContext;

import java.io.File;
import java.util.concurrent.locks.Lock;

Expand Down Expand Up @@ -81,6 +82,23 @@ public interface WxMpConfigStorage {
String getPartnerId();

String getPartnerKey();

/**
* 微信支付异步回掉地址,通知url必须为直接可访问的url,不能携带参数。
* @since 2.5.0
* @return
*/
String getNotifyURL();

/**
* 交易类型
* <pre>
* JSAPI--公众号支付、NATIVE--原生扫码支付、APP--app支付
* </pre>
* @since 2.5.0
* @return
*/
String getTradeType();

String getToken();

Expand Down Expand Up @@ -112,4 +130,5 @@ public interface WxMpConfigStorage {
* 是否自动刷新token
*/
boolean autoRefreshToken();

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class WxMpInMemoryConfigStorage implements WxMpConfigStorage {
protected volatile String secret;
protected volatile String partnerId;
protected volatile String partnerKey;
protected volatile String notifyURL;
protected volatile String tradeType;
protected volatile String token;
protected volatile String accessToken;
protected volatile String aesKey;
Expand Down Expand Up @@ -267,8 +269,25 @@ public String getPartnerKey() {
public void setPartnerKey(String partnerKey) {
this.partnerKey = partnerKey;
}


public String getNotifyURL() {
return notifyURL;
}

@Override
public void setNotifyURL(String notifyURL) {
this.notifyURL = notifyURL;
}

public String getTradeType() {
return tradeType;
}

public void setTradeType(String tradeType) {
this.tradeType = tradeType;
}

@Override
public File getTmpDirFile() {
return this.tmpDirFile;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.chanjar.weixin.mp.api;

import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.mp.bean.pay.WxPayJsSDKCallback;
import me.chanjar.weixin.mp.bean.pay.request.WxEntPayRequest;
import me.chanjar.weixin.mp.bean.pay.request.WxPayRefundRequest;
import me.chanjar.weixin.mp.bean.pay.request.WxPaySendRedpackRequest;
Expand Down Expand Up @@ -107,15 +106,82 @@ public interface WxMpPayService {
* 读取支付结果通知
* 详见http://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7
*/
WxPayJsSDKCallback getJSSDKCallbackData(String xmlData) throws WxErrorException;
WxPayOrderNotifyResult getOrderNotifyResult(String xmlData) throws WxErrorException;

/**
* 微信公众号支付签名算法(详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=4_3)
*
* @param xmlbean Bean需要标记有XML注解,默认使用配置中的PartnerKey进行签名
* @since 2.5.0
* @return 签名字符串
* @see #createSign(Map, String)
*/
String createSign(Object xmlbean);

/**
* 微信公众号支付签名算法(详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=4_3)
* @param xmlbean Bean需要标记有XML注解
* @param signKey 签名Key
* @return 签名字符串
* @see #createSign(Map, String)
*/
String createSign(Object xmlbean, String signKey);

/**
* 微信公众号支付签名算法(详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=4_3)
* @param prams 参数信息,默认使用配置中的PartnerKey进行签名
* @param signKey 签名Key
* @return 签名字符串
* @see #createSign(Map, String)
*/
String createSign(Map<String, String> prams);


/**
* 微信公众号支付签名算法(详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=4_3)
* @param prams 参数信息
* @param signKey 签名Key
* @return 签名字符串
*/
String createSign(Map<String, String> prams, String signKey);



/**
* <pre>
* 计算Map键值对是否和签名相符,
* 按照字段名的 ASCII 码从小到大排序(字典序)后,使用 URL 键值对的 格式(即 key1=value1&key2=value2...)拼接成字符串
* </pre>
* 校验签名是否正确,默认使用配置中的PartnerKey进行签名
* @param xmlbean Bean需要标记有XML注解
* @return true - 签名校验成功,false - 签名校验失败
* @see #checkSign(Map, String)
*/
boolean checkSign(Object xmlbean);

/**
* 校验签名是否正确
* @param xmlbean Bean需要标记有XML注解
* @param signKey 校验的签名Key
* @return true - 签名校验成功,false - 签名校验失败
* @see #checkSign(Map, String)
*/
boolean checkSign(Object xmlbean, String signKey);

/**
* 校验签名是否正确,默认使用配置中的PartnerKey进行签名
* @param prams 需要校验的参数Map
* @return true - 签名校验成功,false - 签名校验失败
* @see #checkSign(Map, String)
*/
boolean checkSign(Map<String, String> prams);

/**
* 校验签名是否正确
* @param prams 需要校验的参数Map
* @param signKey 校验的签名Key
* @return true - 签名校验成功,false - 签名校验失败
* @see #checkSign(Map, String)
*/
boolean checkJSSDKCallbackDataSignature(Map<String, String> kvm, String signature);
boolean checkSign(Map<String, String> prams, String signKey);



/**
* 发送微信红包给个人用户
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import me.chanjar.weixin.mp.api.WxMpMenuService;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.menu.WxMpGetSelfMenuInfoResult;
import me.chanjar.weixin.mp.bean.menu.WxMpSelfMenuInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Loading