You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apple Wallet Pass注册Webhook无法被NestJS服务器接收的问题排查求助

Apple Wallet Pass注册Webhook无法被NestJS服务器接收的问题排查求助

大家好,我现在遇到了一个Apple Wallet Pass的Webhook注册问题,想请各位帮忙排查一下。我已经能正常生成并下载Pass,但Apple的注册Webhook始终无法被我的NestJS服务器接收到,具体情况如下:

  • 生成Pass时的核心配置参数如下(敏感信息已替换为示例值):
{
  ...
  authenticationToken: '1234567891234567812', // 示例验证令牌
  webServiceURL: 'https://api.TEST.com/passes', // 示例Web服务地址
  serialNumber: uuid(),
  ...
}
  • 我在NestJS中创建了passes控制器,并用Postman测试确认所有接口都能正常响应,但就是收不到Apple发起的Webhook请求。控制器代码如下:
@Controller('passes')
export class PassesController {
  private readonly logger = new Logger(PassesController.name);

  constructor() {}

  @Get()
  async logGet(
    @Headers() headers: any,
    @Body() body: any
  ): Promise<string> {
    this.logger.log("Received a GET call from Apple");
    this.logger.debug(`Headers: ${headers}`);
    this.logger.debug(`Body: ${body}`);
    return 'get';
  }

  @Post()
  async logPost(
    @Headers() headers: any,
    @Body() body: any,
    @Param('deviceLibraryIdentifier') id: any,
    @Param('passTypeIdentifier') pass: any
  ): Promise<string> {
    this.logger.log("Received a POST call from Apple");
    this.logger.debug(`Headers: ${headers}`);
    this.logger.debug(`Body: ${body}`);
    return 'post';
  }

  @Put()
  async logPut(
    @Headers() headers: any,
    @Body() body: any,
    @Param('deviceLibraryIdentifier') id: any,
    @Param('passTypeIdentifier') pass: any
  ): Promise<string> {
    this.logger.log("Received a PUT call from Apple");
    this.logger.debug(`Headers: ${headers}`);
    this.logger.debug(`Body: ${body}`);
    return 'put';
  }
}

我现在主要有两个疑问:

  1. Apple发起注册请求的路径是不是和我设置的webServiceURL基础路径不同?比如是不是需要额外的路由参数或者子路径?
  2. 我是不是在控制器的路由配置上有错误?比如参数绑定、请求方法匹配方面?

我找了很多资料都没找到Pass注册阶段Webhook请求的具体接口规范,不知道该怎么把NestJS的路由和Apple的请求对应起来,麻烦各位帮忙分析一下问题出在哪。

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.07 12:12:57