微信支付初始化参数
@ApiOperation("微信支付初始化参数")@PostMapping("getJsSignature")
public R getJsSignature(@RequestBody String body){
//(当前支付页面的URL,不包含#及其后面部分)
String url = JacksonUtil.parseString(body, "url");
if(IsNull.isNull(url)) {
return R.error("参数不能为空!");
}
Map<String, Object> res = new HashMap<>();
Map<String, String> jsSignature = GetToken.getJsSignature(WxParament.JSAPI_TICKET, url);
res.put("appId", ymlParament.getH_app_id());
res.put("timestamp",jsSignature.get("timestamp"));
res.put("nonceStr",jsSignature.get("nonceStr"));
res.put("signature",jsSignature.get("signature"));
return R.ok(res);
}
获取openid
可参考:
https://mp.weixin.qq.com/s/FrhpFTENjl9ITVFT-M_sIA 微信统一下单微信统一下单接口文档:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1