跳过微信支付
This commit is contained in:
parent
9ab639f81b
commit
18aa86fc11
|
@ -46,6 +46,8 @@ public class OrderController {
|
||||||
public Result<OrderPaymentVO> payment(@RequestBody OrdersPaymentDTO ordersPaymentDTO) throws Exception {
|
public Result<OrderPaymentVO> payment(@RequestBody OrdersPaymentDTO ordersPaymentDTO) throws Exception {
|
||||||
log.info("订单支付:{}", ordersPaymentDTO);
|
log.info("订单支付:{}", ordersPaymentDTO);
|
||||||
OrderPaymentVO orderPaymentVO = orderService.payment(ordersPaymentDTO);
|
OrderPaymentVO orderPaymentVO = orderService.payment(ordersPaymentDTO);
|
||||||
|
// TODO 跳过微信支付
|
||||||
|
orderService.paySuccess(ordersPaymentDTO.getOrderNumber());
|
||||||
log.info("生成预支付交易单:{}", orderPaymentVO);
|
log.info("生成预支付交易单:{}", orderPaymentVO);
|
||||||
return Result.success(orderPaymentVO);
|
return Result.success(orderPaymentVO);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -107,12 +106,14 @@ public class OrderServiceImpl implements OrderService {
|
||||||
Long userId = BaseContext.getCurrentId();
|
Long userId = BaseContext.getCurrentId();
|
||||||
User user = userMapper.getById(userId);
|
User user = userMapper.getById(userId);
|
||||||
|
|
||||||
// 调用微信支付接口,生成预支付交易单
|
// TODO 跳过微信支付 调用微信支付接口,生成预支付交易单
|
||||||
JSONObject jsonObject = weChatPayUtil.pay(ordersPaymentDTO.getOrderNumber(), // 商户订单号
|
/* JSONObject jsonObject = weChatPayUtil.pay(ordersPaymentDTO.getOrderNumber(), // 商户订单号
|
||||||
new BigDecimal("0.01"), // 支付金额,单位 元
|
new BigDecimal("0.01"), // 支付金额,单位 元
|
||||||
"苍穹外卖订单", // 商品描述
|
"苍穹外卖订单", // 商品描述
|
||||||
user.getOpenid() // 微信用户的openid
|
user.getOpenid() // 微信用户的openid
|
||||||
);
|
); */
|
||||||
|
// TODO 跳过微信支付
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
if (jsonObject.getString("code") != null && jsonObject.getString("code").equals("ORDERPAID")) {
|
if (jsonObject.getString("code") != null && jsonObject.getString("code").equals("ORDERPAID")) {
|
||||||
throw new OrderBusinessException("该订单已支付");
|
throw new OrderBusinessException("该订单已支付");
|
||||||
|
|
Loading…
Reference in New Issue