@@ -28,7 +28,23 @@ public class SignUtils {
2828 private static final Logger log = LoggerFactory .getLogger (SignUtils .class );
2929
3030 /**
31- * 微信公众号支付签名算法(详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=4_3)
31+ * 请参考并使用 {@link #createSign(Object, String, String, boolean)}
32+ */
33+ @ Deprecated
34+ public static String createSign (Object xmlBean , String signKey ) {
35+ return createSign (BeanUtils .xmlBean2Map (xmlBean ), signKey );
36+ }
37+
38+ /**
39+ * 请参考并使用 {@link #createSign(Map, String, String, boolean)}
40+ */
41+ @ Deprecated
42+ public static String createSign (Map <String , String > params , String signKey ) {
43+ return createSign (params , null , signKey , false );
44+ }
45+
46+ /**
47+ * 微信支付签名算法(详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=4_3)
3248 *
3349 * @param xmlBean Bean里的属性如果存在XML注解,则使用其作为key,否则使用变量名
3450 * @param signType 签名类型,如果为空,则默认为MD5
@@ -41,7 +57,7 @@ public static String createSign(Object xmlBean, String signType, String signKey,
4157 }
4258
4359 /**
44- * 微信公众号支付签名算法 (详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=4_3)
60+ * 微信支付签名算法 (详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=4_3)
4561 *
4662 * @param params 参数信息
4763 * @param signType 签名类型,如果为空,则默认为MD5
@@ -97,7 +113,6 @@ private static String createHMACSha256Sign(String message, String key) {
97113 * @param signType 签名类型,如果为空,则默认为MD5
98114 * @param signKey 校验的签名Key
99115 * @return true - 签名校验成功,false - 签名校验失败
100- * @see #checkSign(Map, String, String)
101116 */
102117 public static boolean checkSign (Object xmlBean , String signType , String signKey ) {
103118 return checkSign (BeanUtils .xmlBean2Map (xmlBean ), signType , signKey );
@@ -110,7 +125,6 @@ public static boolean checkSign(Object xmlBean, String signType, String signKey)
110125 * @param signType 签名类型,如果为空,则默认为MD5
111126 * @param signKey 校验的签名Key
112127 * @return true - 签名校验成功,false - 签名校验失败
113- * @see #checkSign(Map, String, String)
114128 */
115129 public static boolean checkSign (Map <String , String > params , String signType , String signKey ) {
116130 String sign = createSign (params , signType , signKey , false );
0 commit comments