业务场景:申请组织活动时,需要支付保证金。
1.点击提交申请后生出支付二维码,
调取VX提供的方法,生成二维码
2.支付方法,生成支付信息
@GetMapping("/getWxMiniPayData")
public Object getWxMiniPayData(HttpServletRequest request,
@RequestParam("thirdSession") String thirdSession){
String userIdStr = WeixinXcxUtil.getUserId(redisTemplate,thirdSession);
if(userIdStr == null){
throw new RRException("userId 不合法,请先登录");
}
long userId = Long.parseLong(userIdStr);
String pay_activity_bond =
systemParameterInfoDubboService.selectValueByKey("pay_activity_bond");
double payCount=Double.parseDouble(pay_activity_bond);//支付的数额(如果是现金可能是10,如果是金币:100)分为单位
//获取用户redis的数据根据userId
UserBaseInfoDubbo userBaseInfoDubbo = userBaseInfoDubboService.selectRedisUserByUid(userId);
String openId = userBaseInfoDubbo.getBak1();//微信的openId
//Long orgId = userBaseInfoDubbo.getOrgId();//获取组织名称
String product = "申请活动保证金【"+orgBaseInfoService.selectOrgBaseByOrgId(orgId).getOrgName()+"】";//产品名称
//获取组织配置信息
SystemSetConfigDubbo systemSetConfigDubbo = systemSetConfigDubboService.getObject(orgId);
String appId = systemSetConfigDubbo.getWeixinMiniAppId();//平台微信小程序的appid
String apiSecret = systemSetConfigDubbo.getBak3();//商户系统里面的AIP秘钥,不是appSecret!!!
String mchId = systemSetConfigDubbo.getBak2();//小程序支付的商户号
//插入支付订单
Str