微信支付
parent
3a0fd70313
commit
18909d4c2c
|
@ -30,4 +30,22 @@ public class InitOrderResponse implements Serializable {
|
||||||
|
|
||||||
@Schema(description ="支付宝返回参数")
|
@Schema(description ="支付宝返回参数")
|
||||||
private String body;
|
private String body;
|
||||||
|
@Schema(description ="jsapi返回参数")
|
||||||
|
private JsapiResult jsapiResult;
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public static class JsapiResult implements Serializable {
|
||||||
|
private static final long serialVersionUID = 4465376277943307271L;
|
||||||
|
|
||||||
|
private String appId;
|
||||||
|
private String timeStamp;
|
||||||
|
private String nonceStr;
|
||||||
|
private String packageValue;
|
||||||
|
private String signType;
|
||||||
|
private String paySign;
|
||||||
|
|
||||||
|
private String getSignStr() {
|
||||||
|
return String.format("%s\n%s\n%s\n%s\n", appId, timeStamp, nonceStr, packageValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,8 @@ public class WxPayStrategy implements IPayStrategy{
|
||||||
WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService();
|
WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService();
|
||||||
Assert.notNull(wxPayService, "获取微信支付配置失败!");
|
Assert.notNull(wxPayService, "获取微信支付配置失败!");
|
||||||
WxPayUnifiedOrderV3Request wxPayRequest = new WxPayUnifiedOrderV3Request();
|
WxPayUnifiedOrderV3Request wxPayRequest = new WxPayUnifiedOrderV3Request();
|
||||||
int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue();
|
// int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue();
|
||||||
|
int sum = 1;
|
||||||
wxPayRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(sum));
|
wxPayRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(sum));
|
||||||
wxPayRequest.setDescription("会员充值");
|
wxPayRequest.setDescription("会员充值");
|
||||||
wxPayRequest.setOutTradeNo(orderDO.getOrderId());
|
wxPayRequest.setOutTradeNo(orderDO.getOrderId());
|
||||||
|
@ -54,6 +55,10 @@ public class WxPayStrategy implements IPayStrategy{
|
||||||
wxPayRequest.setMchid(payProperties.getMchId());
|
wxPayRequest.setMchid(payProperties.getMchId());
|
||||||
try {
|
try {
|
||||||
WxPayUnifiedOrderV3Result wxPayUnifiedOrderV3Result = wxPayService.unifiedOrderV3(TradeTypeEnum.JSAPI, wxPayRequest);
|
WxPayUnifiedOrderV3Result wxPayUnifiedOrderV3Result = wxPayService.unifiedOrderV3(TradeTypeEnum.JSAPI, wxPayRequest);
|
||||||
|
WxPayUnifiedOrderV3Result.JsapiResult jsapiResult = wxPayUnifiedOrderV3Result.getPayInfo(TradeTypeEnum.JSAPI, payProperties.getAppId(), payProperties.getMchId(), wxPayService.getConfig().getPrivateKey());
|
||||||
|
InitOrderResponse.JsapiResult jsapiResultNew = new InitOrderResponse.JsapiResult();
|
||||||
|
BeanUtils.copyProperties(jsapiResult, jsapiResultNew);
|
||||||
|
response.setJsapiResult(jsapiResultNew);
|
||||||
BeanUtils.copyProperties(wxPayUnifiedOrderV3Result, response);
|
BeanUtils.copyProperties(wxPayUnifiedOrderV3Result, response);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.api.user;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||||
import cn.iocoder.yudao.module.member.convert.user.UserConvert;
|
import cn.iocoder.yudao.module.member.convert.user.UserConvert;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||||
|
@ -27,22 +28,26 @@ public class MemberUserApiImpl implements MemberUserApi {
|
||||||
private MemberUserService userService;
|
private MemberUserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@TenantIgnore
|
||||||
public MemberUserRespDTO getUser(Long id) {
|
public MemberUserRespDTO getUser(Long id) {
|
||||||
MemberUserDO user = userService.getUser(id);
|
MemberUserDO user = userService.getUser(id);
|
||||||
return UserConvert.INSTANCE.convert2(user);
|
return UserConvert.INSTANCE.convert2(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@TenantIgnore
|
||||||
public List<MemberUserRespDTO> getUsers(Collection<Long> ids) {
|
public List<MemberUserRespDTO> getUsers(Collection<Long> ids) {
|
||||||
return UserConvert.INSTANCE.convertList2(userService.getUserList(ids));
|
return UserConvert.INSTANCE.convertList2(userService.getUserList(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@TenantIgnore
|
||||||
public List<MemberUserRespDTO> getUserListByNickname(String nickname) {
|
public List<MemberUserRespDTO> getUserListByNickname(String nickname) {
|
||||||
return UserConvert.INSTANCE.convertList2(userService.getUserListByNickname(nickname));
|
return UserConvert.INSTANCE.convertList2(userService.getUserListByNickname(nickname));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@TenantIgnore
|
||||||
public MemberUserRespDTO getUserByMobile(String mobile) {
|
public MemberUserRespDTO getUserByMobile(String mobile) {
|
||||||
return UserConvert.INSTANCE.convert2(userService.getUserByMobile(mobile));
|
return UserConvert.INSTANCE.convert2(userService.getUserByMobile(mobile));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import cn.hutool.core.io.IoUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
|
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
|
||||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
|
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
|
||||||
|
@ -114,6 +115,7 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@TenantIgnore
|
||||||
public MemberUserDO getUser(Long id) {
|
public MemberUserDO getUser(Long id) {
|
||||||
return memberUserMapper.selectById(id);
|
return memberUserMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,7 @@ wx:
|
||||||
private-cert-path: classpath:/1/apiclient_cert.pem
|
private-cert-path: classpath:/1/apiclient_cert.pem
|
||||||
private-key-path: classpath:/1/apiclient_key.pem
|
private-key-path: classpath:/1/apiclient_key.pem
|
||||||
key-path: classpath:/1/apiclient_cert.p12
|
key-path: classpath:/1/apiclient_cert.p12
|
||||||
cert-serial-no: 58FDB503F92B6C0E258C9940BB726C2BF6022E56
|
cert-serial-no: 7F76A4ADC52CA0B440C4E5698F8A5CD1633A0FCD
|
||||||
notify-url: http://yuxy.perrymake.com/admin-api/notify/wxpay/pay_notify
|
notify-url: http://yuxy.perrymake.com/admin-api/notify/wxpay/pay_notify
|
||||||
refund-notify-url: http://yuxy.perrymake.com/admin-api/notify/wxpay/refund_notify
|
refund-notify-url: http://yuxy.perrymake.com/admin-api/notify/wxpay/refund_notify
|
||||||
two:
|
two:
|
||||||
|
|
|
@ -107,7 +107,7 @@ yudao:
|
||||||
security:
|
security:
|
||||||
permit-all_urls:
|
permit-all_urls:
|
||||||
- /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,不需要登录
|
- /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,不需要登录
|
||||||
- /admin-api/notice/wxpay/**
|
- /admin-api/notify/wxpay/**
|
||||||
websocket:
|
websocket:
|
||||||
enable: true # websocket的开关
|
enable: true # websocket的开关
|
||||||
path: /websocket/message # 路径
|
path: /websocket/message # 路径
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue