记得上下班打卡 | git大法好,push需谨慎

Commit f6968b4e authored by zhengfuxin's avatar zhengfuxin

修改appid 传入错误问题

parent b0ad23d9
...@@ -7,6 +7,7 @@ import com.liquidnet.service.dragon.channel.wepay.strategy.impl.AbstractWepayStr ...@@ -7,6 +7,7 @@ import com.liquidnet.service.dragon.channel.wepay.strategy.impl.AbstractWepayStr
import com.liquidnet.service.dragon.constant.DragonConstant; import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto; import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto; import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import com.liquidnet.service.dragon.utils.PayDouYinpayUtils;
import com.liquidnet.service.dragon.utils.PayWepayUtils; import com.liquidnet.service.dragon.utils.PayWepayUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -30,7 +31,7 @@ public class DouYinPayStrategyAppletImpl extends AbstractDouYinPayStrategy { ...@@ -30,7 +31,7 @@ public class DouYinPayStrategyAppletImpl extends AbstractDouYinPayStrategy {
@Override @Override
SortedMap<String, Object> appendRequestParam(SortedMap<String, Object> requestMap, DragonPayBaseReqDto dragonPayBaseReqDto) { SortedMap<String, Object> appendRequestParam(SortedMap<String, Object> requestMap, DragonPayBaseReqDto dragonPayBaseReqDto) {
requestMap.put("app_id", PayWepayUtils.getInstance().getAPP_ID()); requestMap.put("app_id", PayDouYinpayUtils.getInstance().getAPP_ID());
return requestMap; return requestMap;
} }
......
...@@ -128,6 +128,27 @@ public class PayDouYinpayUtils { ...@@ -128,6 +128,27 @@ public class PayDouYinpayUtils {
return sb.toString(); return sb.toString();
} }
public static String md5FromStr(String inStr) {
MessageDigest md5;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return "";
}
byte[] byteArray = inStr.getBytes(StandardCharsets.UTF_8);
byte[] md5Bytes = md5.digest(byteArray);
StringBuilder hexValue = new StringBuilder();
for (byte md5Byte : md5Bytes) {
int val = ((int) md5Byte) & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}
public String createSign(SortedMap<String, Object> paramsMap) { public String createSign(SortedMap<String, Object> paramsMap) {
List<String> paramsArr = new ArrayList<>(); List<String> paramsArr = new ArrayList<>();
for (Map.Entry<String, Object> entry : paramsMap.entrySet()) { for (Map.Entry<String, Object> entry : paramsMap.entrySet()) {
...@@ -165,7 +186,7 @@ public class PayDouYinpayUtils { ...@@ -165,7 +186,7 @@ public class PayDouYinpayUtils {
} }
return md5FromStr(signStr.toString()); return md5FromStr(signStr.toString());
} }
public static String md5FromStr(String inStr) { /*public static String md5FromStr(String inStr) {
MessageDigest md5; MessageDigest md5;
try { try {
md5 = MessageDigest.getInstance("MD5"); md5 = MessageDigest.getInstance("MD5");
...@@ -185,7 +206,7 @@ public class PayDouYinpayUtils { ...@@ -185,7 +206,7 @@ public class PayDouYinpayUtils {
hexValue.append(Integer.toHexString(val)); hexValue.append(Integer.toHexString(val));
} }
return hexValue.toString(); return hexValue.toString();
} }*/
public String getPartnerKey() { public String getPartnerKey() {
return this.partnerKey; return this.partnerKey;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment