|
@@ -81,7 +81,13 @@ public class OrderController {
|
|
|
public Result<H5JsPayParams> pay(@PathVariable Long orderId) throws Exception {
|
|
public Result<H5JsPayParams> pay(@PathVariable Long orderId) throws Exception {
|
|
|
final String methodName = "吊起微信支付";
|
|
final String methodName = "吊起微信支付";
|
|
|
log.info("{}[start] orderId:{}",methodName,orderId);
|
|
log.info("{}[start] orderId:{}",methodName,orderId);
|
|
|
-
|
|
|
|
|
|
|
+ OrderDon orderDon = orderDonService.getById(orderId);
|
|
|
|
|
+ if (orderDon == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("订单不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (orderDon.getStatus() == OrderDon.Status.close) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("订单已关闭");
|
|
|
|
|
+ }
|
|
|
H5JsPayParams payParams = orderDonService.pay(orderId, "JSAPI");
|
|
H5JsPayParams payParams = orderDonService.pay(orderId, "JSAPI");
|
|
|
|
|
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(payParams);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(payParams);
|
|
@@ -93,6 +99,13 @@ public class OrderController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/get/wx/orderQrCode/{orderId}")
|
|
@PostMapping("/get/wx/orderQrCode/{orderId}")
|
|
|
public Result<String> createUnifiedOrderQr(@PathVariable Long orderId) throws Exception {
|
|
public Result<String> createUnifiedOrderQr(@PathVariable Long orderId) throws Exception {
|
|
|
|
|
+ OrderDon orderDon = orderDonService.getById(orderId);
|
|
|
|
|
+ if (orderDon == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("订单不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (orderDon.getStatus() == OrderDon.Status.close) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("订单已关闭");
|
|
|
|
|
+ }
|
|
|
//预下单
|
|
//预下单
|
|
|
H5JsPayParams payParams = orderDonService.wxPcWebPay(orderId, "NATIVE");
|
|
H5JsPayParams payParams = orderDonService.wxPcWebPay(orderId, "NATIVE");
|
|
|
//获取二维码链接code_url
|
|
//获取二维码链接code_url
|
|
@@ -175,6 +188,13 @@ public class OrderController {
|
|
|
@PostMapping("/post/pay/zfb/{orderId}")
|
|
@PostMapping("/post/pay/zfb/{orderId}")
|
|
|
@Deprecated
|
|
@Deprecated
|
|
|
public Result<String> aliPay(@PathVariable Long orderId,HttpServletResponse response) throws Exception {
|
|
public Result<String> aliPay(@PathVariable Long orderId,HttpServletResponse response) throws Exception {
|
|
|
|
|
+ OrderDon orderDon = orderDonService.getById(orderId);
|
|
|
|
|
+ if (orderDon == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("订单不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (orderDon.getStatus() == OrderDon.Status.close) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("订单已关闭");
|
|
|
|
|
+ }
|
|
|
AliPayParams aliPayParams = orderDonService.aliPay(orderId, ZfbProductCode.MOBILE_WEB.getProductCode());
|
|
AliPayParams aliPayParams = orderDonService.aliPay(orderId, ZfbProductCode.MOBILE_WEB.getProductCode());
|
|
|
// response.setContentType("text/html;charset=" + BaseZfbConfig.charset);
|
|
// response.setContentType("text/html;charset=" + BaseZfbConfig.charset);
|
|
|
// //直接将完整的表单html输出到页面
|
|
// //直接将完整的表单html输出到页面
|