驿站付款退款
This commit is contained in:
parent
31fc69c7d7
commit
79d970ad93
|
|
@ -140,11 +140,15 @@ public class OrderInfoMobileController extends BaseController {
|
|||
notes = "驿站退款"
|
||||
)
|
||||
public AjaxResult stageRefundMobile(@RequestHeader Map<String, String> headers,
|
||||
@RequestBody @Valid StageRefundParam request) {
|
||||
@RequestBody StageRefundParam request) {
|
||||
String sign = HeaderFetchUtil.getSign(headers);
|
||||
if(StringUtils.isBlank(sign) || !sign.equals(StageWhiteList.STAGE_SIGN_WHITE_LIST)) {
|
||||
return AjaxResult.error("签名失败");
|
||||
}
|
||||
if(request.getTradeId() == null) {
|
||||
return AjaxResult.error("交易ID不能为空");
|
||||
}
|
||||
|
||||
UnifyRefundVO resultVO = this.orderRefundBusiness.stageRefund(request);
|
||||
return AjaxResult.success(resultVO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
|
|
@ -141,11 +142,17 @@ public class OrderPlaceMobileController {
|
|||
notes = "驿站付款"
|
||||
)
|
||||
public AjaxResult stageOrderPay(@RequestHeader Map<String, String> headers,
|
||||
@RequestBody @Valid StagePayMobileDTO stagePayDTO) {
|
||||
@RequestBody StagePayMobileDTO stagePayDTO) {
|
||||
String sign = HeaderFetchUtil.getSign(headers);
|
||||
if(StringUtils.isBlank(sign) || !sign.equals(StageWhiteList.STAGE_SIGN_WHITE_LIST)) {
|
||||
return AjaxResult.error("签名失败");
|
||||
}
|
||||
if(stagePayDTO.getAmount() == null) {
|
||||
return AjaxResult.error("金额不能为空");
|
||||
}
|
||||
if(BigDecimal.ZERO.compareTo(stagePayDTO.getAmount()) >= 0) {
|
||||
return AjaxResult.error("金额必须大于0");
|
||||
}
|
||||
UnifyPayVO mobileVO = null;
|
||||
try{
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
|
@ -156,7 +163,7 @@ public class OrderPlaceMobileController {
|
|||
LogUtil.info("[驿站支付]支付耗时", System.currentTimeMillis() - startTime, mobileVO);
|
||||
}catch (Exception ex) {
|
||||
log.error("驿站支付异常", ex);
|
||||
return AjaxResult.error("支付失败", 500);
|
||||
return AjaxResult.error("支付失败");
|
||||
}
|
||||
return AjaxResult.success(mobileVO);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue