Commit 73fd12bf authored by alex yao's avatar alex yao

feat: 支付调用参数修正

parent 301eebae
......@@ -15,13 +15,10 @@ public interface PayRest extends BaseRest {
/**
* 发起支付
*
* @param payChannel 支付渠道
* @param validityUnit 有效期 year-年 month-月
* @param domain equity 权益包 point-积分包
* @param type normal-普通版 professional-专业版 ultimate-旗舰版
* @param payChannel 支付渠道
* @param payOrderSn 订单号
*/
Object pay(@RequestParam String payChannel, @RequestParam String validityUnit,
@RequestParam String domain, @RequestParam String type) throws Exception;
Object pay(@RequestParam String payChannel, @RequestParam String payOrderSn) throws Exception;
/**
* 查询支付状态
......
......@@ -28,30 +28,20 @@ public class PayRestImpl implements PayRest {
@Resource
private PayService payService;
@Resource
private EquityService equityService;
@Resource
private DgtoolsPayOrderService dgtoolsPayOrderService;
@Override
public Object pay(String payChannel, String validityUnit, String domain, String type) throws Exception {
public Object pay(String payChannel, String payOrderSn) throws Exception {
Assert.notNull(payChannel, "支付渠道不能为空");
Assert.notNull(payOrderSn, "支付订单号不能为空");
// 获取当前登录用户
UserBaseEntity currentUser = BlContext.getCurrentUserNotException();
if (ObjectUtil.isEmpty(currentUser)) {
throw new I18nMessageException("exception/user.not.login");
}
// 创建订单
String payOrderSn = equityService.createEquityOrder(
EquityEnum.TYPE.valueOf(type),
EquityEnum.DOMAIN.valueOf(domain),
EquityEnum.VALIDITY_UNIT.valueOf(validityUnit),
currentUser.getUserId());
PayResult payResult = new PayResult();
if (PayChannel.WX_NATIVE.name().equals(payChannel)) {
WxNativePayDto wxNativePayDto = new WxNativePayDto();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment