| | |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 初始化微信支付信息 |
| | | * @param appId |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "init_wechatpay") |
| | | public BaseResponse<Boolean> initWechatpay(@RequestParam("appId") String appId) throws Exception { |
| | | if(appId == null || appId.trim().length() == 0) { |
| | | return BaseResponseUtils.buildErrorMsg("小程序唯一标识不能为空"); |
| | | } |
| | | appId = AES.encrypt(appId); |
| | | |
| | | SeWechatpay seWechatpay = paymentSv.getWechatpayByAppId(appId); |
| | | if(seWechatpay != null) { |
| | | PayInfo.appid = AES.decrypt(seWechatpay.getAppId()); |
| | | PayInfo.secret = AES.decrypt(seWechatpay.getAppSecret()); |
| | | PayInfo.mchid = AES.decrypt(seWechatpay.getMchId()); |
| | | PayInfo.key = AES.decrypt(seWechatpay.getMchKey()); |
| | | PayInfo.serial_no = AES.decrypt(seWechatpay.getSerialNo()); |
| | | PayInfo.notifyUrl = AES.decrypt(seWechatpay.getNotifyUrl()); |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | }else { |
| | | return BaseResponseUtils.buildErrorMsg("小程序唯一标识错误或其信息不存在"); |
| | | } |
| | | |
| | | } |
| | | } |