diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/MemberInDTO.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/MemberInDTO.java index 3ac953a..f83b9e7 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/MemberInDTO.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/MemberInDTO.java @@ -23,4 +23,6 @@ public class MemberInDTO { private Integer userCouponId; // 是否使用积分抵扣 private Integer pointsNum ; + private String payType; + } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java index 069540e..ca406c0 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -1087,6 +1087,11 @@ public class PayService { return Result.fail("支付通道不存在"); } + if ("aliPay".equals(memberInDTO.getPayType()) && StrUtil.isBlank(thirdApply.getAlipaySmallAppid())) { + return Result.fail("店铺未配置支付宝小程序appId"); + } + + // 霸王餐活动充值 BigDecimal payAmount; TbMemberIn memberIn = new TbMemberIn(); @@ -1142,12 +1147,17 @@ public class PayService { } } } else { + String smallAppid = thirdApply.getSmallAppid(); + if ("aliPay".equals(memberInDTO.getPayType())) { + smallAppid = thirdApply.getAlipaySmallAppid(); + } + String convertPayType = "aliPay".equals(memberInDTO.getPayType()) ? "ALIPAY" : "WECHAT"; String orderNo = DateUtils.getsdfTimesSS(); PublicResp publicResp = thirdPayService .scanpay(thirdUrl, thirdApply.getAppId(), "会员充值", "会员充值", payAmount - .multiply(new BigDecimal(100)).longValue(), "WECHAT", - thirdApply.getSmallAppid(), memberInDTO.getOpenId(), ip, orderNo, thirdApply.getStoreId(), + .multiply(new BigDecimal(100)).longValue(), convertPayType, + smallAppid, memberInDTO.getOpenId(), ip, orderNo, thirdApply.getStoreId(), callInBack, null, thirdApply.getAppToken()); if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) { if ("000000".equals(publicResp.getCode())) {