下单时返回ordersn

This commit is contained in:
wuchunlei
2024-12-04 17:54:32 +08:00
parent e591d8a31d
commit d9651adb6f
2 changed files with 6 additions and 2 deletions

View File

@@ -80,7 +80,7 @@ public class OrderController {
}
}
Map<String, Object> result = new HashMap<>();
result.put("orderId", buyOrder.getOrderId());
result.put("orderSn", buyOrder.getOrderSn());
return R.ok(result);
}

View File

@@ -38,10 +38,14 @@ public class PaypalController {
@RequestMapping("/createOrder")
public R createOrder(@RequestBody Map<String,Object> params){
BuyOrder buyOrder = buyOrderService.getById(params.get("orderId").toString());
BuyOrder buyOrder = buyOrderService.getOne(new LambdaQueryWrapper<BuyOrder>()
.eq(BuyOrder::getOrderSn,params.get("orderSn")));
if ("3".equals(buyOrder.getOrderStatus())){
return R.error("订单已完成");
}
if ("point".equals(buyOrder.getOrderType())){
buyOrder.setRemark("Recharge Virtual Coin");
}
JSONObject res = paypalConfig.createOrder(buyOrder);
if (res.containsKey("links")&&res.containsKey("status")){
if ("CREATED".equals(res.get("status").toString())){