支付结果通知回调
This commit is contained in:
parent
8eb8ab6c1c
commit
130af70d45
@ -95,7 +95,7 @@ public enum BizCodeEnum {
|
||||
|
||||
PAY_ORDER_CALLBACK_SIGN_FAIL(300002, "支付订单回调验证签失败"),
|
||||
|
||||
PAY_ORDER_CALLBACK_NOT_SUCCESS(300003, "创建支付订单失败"),
|
||||
PAY_ORDER_CALLBACK_NOT_SUCCESS(300003, "支付宝回调更新订单失败"),
|
||||
|
||||
PAY_ORDER_NOT_EXIST(300005, "订单不存在"),
|
||||
|
||||
|
@ -411,12 +411,28 @@ public class ProductOrderServiceImpl extends ServiceImpl<ProductOrderMapper, Pro
|
||||
/**
|
||||
* 支付结果通知更新订单状态
|
||||
*
|
||||
* @param productOrderPayTypeEnum
|
||||
* @param payType
|
||||
* @param paramsMap
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonData handlerOrderCallbackMsg(ProductOrderPayTypeEnum productOrderPayTypeEnum, Map<String, String> paramsMap) {
|
||||
return null;
|
||||
public JsonData handlerOrderCallbackMsg(ProductOrderPayTypeEnum payType, Map<String, String> paramsMap) {
|
||||
|
||||
if (ProductOrderPayTypeEnum.ALIPAY.name().equalsIgnoreCase(payType.name())) {// 支付宝支付
|
||||
// 获取商户订单号
|
||||
String outTradeNo = paramsMap.get("out_trade_no");
|
||||
// 交易状态
|
||||
String tradeStatus = paramsMap.get("trade_status");
|
||||
|
||||
if ("TRADE_SUCCESS".equalsIgnoreCase(tradeStatus) || "TRADE_FINISHED".equalsIgnoreCase(tradeStatus)) {
|
||||
// 更新订单状态
|
||||
productOrderMapper.updateOrderPayState(outTradeNo, ProductOrderStateEnum.PAY.name(), ProductOrderStateEnum.NEW.name());
|
||||
return JsonData.buildSuccess();
|
||||
}
|
||||
} else if (ProductOrderPayTypeEnum.WECHAT.name().equalsIgnoreCase(payType.name())) {// 微信支付 todo
|
||||
|
||||
}
|
||||
|
||||
return JsonData.buildResult(BizCodeEnum.PAY_ORDER_CALLBACK_NOT_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user