String jsonString = JSON.toJSONString(map2);
log.info("异步支付下单,请求参数####{}", jsonString);
String post = Utils.sendPostByJsonString(PAYHTTPURL, jsonString);
return Utils.desEncrypt(post);
}
package com.bkgx.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import static com.bkgx.utils.Constants.OFFSET;
import static com.bkgx.utils.Constants.SECRETKEY;
/**
* @author iszengziqiang@163.com
* @date 2021/1/22 09:58
* @Version: 1.0
* @desc //todo
工具类
*/
@Slf4j
public class Utils {