|
@@ -108,6 +108,7 @@ public class WxPayController {
|
|
|
@ApiOperation(value = "统一下单,并组装所需支付参数")
|
|
|
@PostMapping("/createOrder")
|
|
|
public AjaxResult createOrder(@RequestBody WxPayDto dto) throws WxPayException {
|
|
|
+ log.info("开始下单:{}", dto.toString());
|
|
|
WxPayUnifiedOrderV3Request request = new WxPayUnifiedOrderV3Request();
|
|
|
request.setDescription("购买会员");
|
|
|
// 商品订单号
|
|
@@ -122,7 +123,9 @@ public class WxPayController {
|
|
|
} else if (StringUtils.isNotEmpty(dto.getDiscount())) {
|
|
|
total = total.multiply(new BigDecimal(dto.getDiscount()).divide(new BigDecimal(10)));
|
|
|
}
|
|
|
+ log.info("用户:{},支付总金额为:{}, 订单Id为:{}", dto.getOpenId(), amount, orderNo);
|
|
|
amount.setTotal(total.intValue() * 100);
|
|
|
+ request.setAmount(amount);
|
|
|
WxPayUnifiedOrderV3Result.JsapiResult orderV3 = this.wxPayService.createOrderV3(TradeTypeEnum.JSAPI, request);
|
|
|
AjaxResult result = new AjaxResult();
|
|
|
result.put("appId", orderV3.getAppId());
|