update 白名单支付

This commit is contained in:
2023-03-29 15:09:51 +08:00
parent 8eafe47596
commit c65583b1a0
5 changed files with 110 additions and 3 deletions

View File

@@ -11,9 +11,11 @@ import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.id.IdUtils;
import com.jsowell.pile.dto.GetPayModeDTO;
import com.jsowell.pile.dto.PayOrderDTO;
import com.jsowell.pile.dto.PaymentScenarioDTO;
import com.jsowell.pile.dto.WeixinPayDTO;
import com.jsowell.pile.vo.uniapp.PayModeVO;
import com.jsowell.service.MemberService;
import com.jsowell.service.OrderService;
import com.jsowell.wxpay.dto.WeChatRefundDTO;
@@ -25,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
@@ -82,7 +85,7 @@ public class PayController extends BaseController {
}
/**
* 支付订单
* 7002 支付订单
* http://localhost:8080/uniapp/pay/payOrder
*
* @param request
@@ -131,6 +134,27 @@ public class PayController extends BaseController {
return response;
}
/**
* 7003 获取支付方式
* http://localhost:8080/uniapp/pay/getPayMode
*/
@PostMapping("/getPayMode")
public RestApiResponse<?> getPayMode(HttpServletRequest request, @RequestBody GetPayModeDTO dto) {
RestApiResponse<?> response;
try {
// dto.setMemberId(getMemberIdByAuthorization(request));
List<PayModeVO> list = orderService.getPayMode(dto);
response = new RestApiResponse<>(ImmutableMap.of("list", list));
} catch (BusinessException e) {
logger.warn("获取支付方式 warn param:{}", dto.toString(), e);
response = new RestApiResponse<>(e.getCode(), e.getMessage());
} catch (Exception e) {
logger.error("获取支付方式 error param:{}", dto.toString(), e);
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PAY_MODE);
}
return response;
}
/**
* 微信支付回调接口
* http://localhost:8080/uniapp/pay/callback