com.foxinmy.weixin4j.sign.WeixinPaymentSignature Maven / Gradle / Ivy
package com.foxinmy.weixin4j.sign;
import com.foxinmy.weixin4j.type.SignType;
import com.foxinmy.weixin4j.util.DigestUtil;
/**
* 微信支付签名实现
*
* @className WeixinPaymentSignature
* @author jinyu([email protected])
* @date 2016年3月26日
* @since JDK 1.6
* @see 支付签名说明
* @deprecated 迁移到子模块weixin4j-pay
*/
@Deprecated
public class WeixinPaymentSignature extends AbstractWeixinSignature {
/**
* 支付密钥
*/
private final String paySignKey;
public WeixinPaymentSignature(String paySignKey) {
this.paySignKey = paySignKey;
}
@Override
public SignType getSignType() {
return SignType.MD5;
}
@Override
public String sign(Object obj) {
StringBuilder sb = join(obj).append("&key=").append(paySignKey);
return DigestUtil.MD5(sb.toString()).toUpperCase();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy