ref 调整查询和回调通知接口

This commit is contained in:
DaxPay
2024-05-16 17:51:32 +08:00
parent fdbdd42aad
commit 9699661a1f
26 changed files with 360 additions and 121 deletions

View File

@@ -1,8 +1,11 @@
package cn.daxpay.single.demo.controller;
import cn.bootx.platform.common.core.annotation.IgnoreAuth;
import cn.daxpay.single.demo.configuration.DaxPayDemoProperties;
import cn.daxpay.single.sdk.model.notice.PayNoticeModel;
import cn.daxpay.single.sdk.model.notice.RefundNoticeModel;
import cn.daxpay.single.sdk.util.PaySignUtil;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
@@ -26,11 +29,15 @@ import java.util.Map;
@RequestMapping("/demo/callback")
@RequiredArgsConstructor
public class ClientNoticeReceiveController {
private final DaxPayDemoProperties daxPayDemoProperties;
@Operation(summary = "支付消息(map接收)")
@PostMapping("/pay")
public String pay(@RequestBody Map<String,Object> map){
log.info("接收到支付回调消息: {}",map);
// 转换为对象
PayNoticeModel bean = BeanUtil.toBean(map, PayNoticeModel.class);
log.info("验签结果: {}", PaySignUtil.hmacSha256Sign(bean, daxPayDemoProperties.getSignSecret()));
return "SUCCESS";
}
@@ -39,6 +46,7 @@ public class ClientNoticeReceiveController {
@PostMapping("/payObject")
public String pay(@RequestBody PayNoticeModel model){
log.info("接收到支付回调消息: {}",model);
log.info("验签结果: {}", PaySignUtil.hmacSha256Sign(model, daxPayDemoProperties.getSignSecret()));
return "SUCCESS";
}
@@ -46,13 +54,17 @@ public class ClientNoticeReceiveController {
@PostMapping("/refund")
public String refund(@RequestBody Map<String,Object> map) {
log.info("接收到退款回调消息: {}",map);
// 转换为对象
RefundNoticeModel model = BeanUtil.toBean(map, RefundNoticeModel.class);
log.info("验签结果: {}", PaySignUtil.hmacSha256Sign(model, daxPayDemoProperties.getSignSecret()));
return "SUCCESS";
}
@Operation(summary = "退款消息(对象)")
@PostMapping("/refundObject")
public String refund(@RequestBody RefundNoticeModel map) {
log.info("接收到退款回调消息: {}",map);
public String refund(@RequestBody RefundNoticeModel model) {
log.info("接收到退款回调消息: {}",model);
log.info("验签结果: {}", PaySignUtil.hmacSha256Sign(model, daxPayDemoProperties.getSignSecret()));
return "SUCCESS";
}