1 package com.foxinmy.weixin4j.sign;
2
3 import com.foxinmy.weixin4j.type.SignType;
4 import com.foxinmy.weixin4j.util.DigestUtil;
5
6
7
8
9
10
11
12
13
14
15
16
17 @Deprecated
18 public class WeixinPaymentSignature extends AbstractWeixinSignature {
19
20
21
22 private final String paySignKey;
23
24 public WeixinPaymentSignature(String paySignKey) {
25 this.paySignKey = paySignKey;
26 }
27
28 @Override
29 public SignType getSignType() {
30 return SignType.MD5;
31 }
32
33 @Override
34 public String sign(Object obj) {
35 StringBuilder sb = join(obj).append("&key=").append(paySignKey);
36 return DigestUtil.MD5(sb.toString()).toUpperCase();
37 }
38 }