记得上下班打卡 | git大法好,push需谨慎

Commit 6fec39e7 authored by 姜秀龙's avatar 姜秀龙

收钱吧 回调 增加日志

parent b731dbea
......@@ -93,6 +93,7 @@ public class GoblinSqbOrderController {
log.error("下单回调参数为空");
return ResponseDto.failure("下单回调参数为空");
}
logSqbCallbackRaw("order", callbackParams);
boolean verified = sqbBiz.verifySignature(callbackParams);
if (!verified) {
log.error("下单回调验签失败");
......@@ -100,7 +101,6 @@ public class GoblinSqbOrderController {
}
OrderCallbackContent orderCallbackContent = JsonUtils.fromJson(callbackParams.getContent(), OrderCallbackContent.class);
log.info("下单回调content: {}", callbackParams.getContent());
// 业务
return goblinSqbOrderService.handlePayCallback(orderCallbackContent);
}
......@@ -112,6 +112,7 @@ public class GoblinSqbOrderController {
log.error("退款回调参数为空");
return ResponseDto.failure("退款回调参数为空");
}
logSqbCallbackRaw("refund", callbackParams);
boolean verified = sqbBiz.verifySignature(callbackParams);
if (!verified) {
log.error("退款回调验签失败");
......@@ -119,7 +120,6 @@ public class GoblinSqbOrderController {
}
RefundCallbackContent refundCallbackContent = JsonUtils.fromJson(callbackParams.getContent(), RefundCallbackContent.class);
log.info("退款回调content: {}", callbackParams.getContent());
// 业务
return goblinSqbOrderService.handleRefundCallback(refundCallbackContent);
}
......@@ -131,6 +131,7 @@ public class GoblinSqbOrderController {
log.error("券状态回调参数为空");
return ResponseDto.failure("券状态回调参数为空");
}
logSqbCallbackRaw("coupon", callbackParams);
boolean verified = sqbBiz.verifySignature(callbackParams);
if (!verified) {
log.error("券状态回调验签失败");
......@@ -138,9 +139,15 @@ public class GoblinSqbOrderController {
}
CouponCallbackContent callbackContent = JsonUtils.fromJson(callbackParams.getContent(), CouponCallbackContent.class);
log.info("券状态回调content: {}", callbackParams.getContent());
// 业务
return goblinSqbOrderService.handleCouponCallback(callbackContent);
}
/**
* 记录收钱吧回调完整报文(eventId/timestamp/nonce/content/signature),便于复测;在验签前打印,验签失败时仍能拿到原始参数。
*/
private void logSqbCallbackRaw(String scene, CallbackParams p) {
log.info("[收钱吧回调-{}] 原始参数: {}", scene, JsonUtils.toJson(p));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment