下单时返回ordersn
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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())){
|
||||
|
||||
Reference in New Issue
Block a user