fix(apple): 增加无效收据原因日志并补充订阅过期时间调试输出

This commit is contained in:
2025-12-15 21:21:47 +08:00
parent 0ad9de1011
commit c305dfaae4
5 changed files with 24 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ public class AppleReceiptController {
private final ApplePurchaseService applePurchaseService;
private final SignedDataVerifier signedDataVerifier;
public AppleReceiptController(AppleReceiptService appleReceiptService,
ApplePurchaseService applePurchaseService,
SignedDataVerifier signedDataVerifier) {
@@ -83,12 +84,13 @@ public class AppleReceiptController {
*/
@PostMapping("/notification")
public BaseResponse<Boolean> receiveNotification(@RequestBody Map<String, String> body, HttpServletRequest request) {
if (body == null) {
throw new BusinessException(ErrorCode.PARAMS_ERROR, "body 不能为空");
}
// 从请求体中获取 Apple 签名的载荷
String signedPayload = body.get("signedPayload");
// 校验 signedPayload 是否为空
if (signedPayload == null || signedPayload.isBlank()) {
throw new BusinessException(ErrorCode.PARAMS_ERROR, "signedPayload 不能为空");