Map params = new HashMap<>();
String callbackUrl = "https://www.weixin.qq.com/wxpay/pay.php";
params.put("appid", "wxc97b***********793");
params.put("mchid", "16******73");
params.put("description", "商品信息");
params.put("out_trade_no", "000OI20230309619581952910950400");
Map amount = new HashMap<>();
amount.put("total",1);
amount.put("currency","CNY");
params.put("amount", amount);
Map payer = new HashMap<>();
payer.put("openid","oIjI35FU******Qrca7k5bhiU4");
params.put("payer",payer);
params.put("notify_url", callbackUrl);
System.out.println(JSONObject.toJSONString(params));
String post = getToken("POST", "/v3/pay/transactions/jsapi", JSONObject.toJSONString(params));
String authorization ="WECHATPAY2-SHA256-RSA2048"+post;
System.out.println("获取签名==========================");
System.out.println(authorization);
String prepayId = HttpRequestUtils.HttpPostWithJson("https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi",JSONObject.toJSONString(params),authorization);
System.out.println(prepayId);