修复支付宝条码付,校验问题

This commit is contained in:
egzosn
2017-06-15 23:44:54 -07:00
parent d01177ca6d
commit eb21606bbb

View File

@@ -90,6 +90,20 @@ public class AliPayService extends BasePayService {
@Override
public boolean signVerify(Map<String, Object> params, String sign) {
if (params instanceof JSONObject){
for (String key : params.keySet()){
if ("sign".equals(key)){
continue;
}
TreeMap response = new TreeMap((Map) params.get(key));
LinkedHashMap<Object, Object> linkedHashMap = new LinkedHashMap<>();
linkedHashMap.put("code", response.remove("code") );
linkedHashMap.put("msg", response.remove("msg") );
linkedHashMap.putAll(response);
return SignUtils.valueOf(payConfigStorage.getSignType()).verify(JSON.toJSONString(linkedHashMap), sign, payConfigStorage.getKeyPublic(), payConfigStorage.getInputCharset());
}
}
return SignUtils.valueOf(payConfigStorage.getSignType()).verify(params, sign, payConfigStorage.getKeyPublic(), payConfigStorage.getInputCharset());
}