显示 现 有 订阅 项目

同样通过「App Store」,点选右上角「大头人像」图示,选择「订阅项目」,从里面点选「已购项目」,虽然可以看见iPhone购买过的App 纪录,不过会发现连同免费App 也都会被视为购买纪录,所以要查询APP购买纪录并不是从这地方。

需要通过「支持App」才能够快速查询iPhone所有App订阅或内购记录。

显示 现 有 订阅 项目

开启「支持App」后,需要先登入Apple ID 帐号,直接点击「订阅与购买项目」>「要求退款」。

显示 现 有 订阅 项目

会进入要求退款页面,直接点选「开始使用」。

显示 现 有 订阅 项目

就能立即查询近几个月App订阅、购买或内购项目纪录,轻单也会清楚标示哪一天扣款,上面也会看得见Apple订单编号查询,要是有问题也可以向客服询问。

显示 现 有 订阅 项目

功能总结

通过本篇分享的两招查询「iPhone购买纪录」教学,能够让你轻松查询iPhone内购纪录和App消费金额,要是下次发现突然被扣款,或是突然收到购买消费纪录等通知,都可以利用这篇教学查询与确认,就能避免会误点钓鱼邮件,也能避免忘记取消内购。

特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。

Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.

适用于: Tableau Cloud, Tableau Server

订阅会通过电子邮件定期向您发送视图或工作簿的图像或 PDF 快照 - 而无需您登录 。

为自己或他人设置订阅

在 中打开视图时,如果您在工具栏中看到订阅图标 (

显示 现 有 订阅 项目
) 时,则可以订阅该视图或整个工作簿。如果您是具有相应站点角色的项目负责人,或者您是管理员,则可以为具有内容查看权限的其他用户订阅。

  1. 从站点的“浏览”部分,选择“所有工作簿”“所有视图”,或者打开包含要订阅的视图的项目。

    显示 现 有 订阅 项目

  2. 直接或在打开包含视图的工作簿后打开视图。

  3. 在视图工具栏上,选择“观看”>“订阅”

    显示 现 有 订阅 项目

  4. 如果您拥有工作簿,请选择“为我订阅”

    注意:在为组订阅时,将在创建订阅时单独添加每个用户。如果稍后向该组中添加了更多用户,您必须为该组重新订阅,这些新用户才能收到订阅。同样,稍后从组中移除的用户的订阅也不会自动移除,除非移除了其对已订阅视图的权限。

  5. 选择订阅电子邮件是包含当前视图还是整个工作簿。如果仅当存在高优先级信息时视图才包含数据,请选择“视图为空的情况下不发送”

  6. 选择快照的格式:PNG 图像格式、PDF 附件格式或两者。

    • 如果为 PDF 格式,请选择您要接收的纸张大小和方向。

      显示 现 有 订阅 项目

  7. 要澄清订阅电子邮件,请自定义主题行,并添加一条消息。

  8. 当工作簿在已发布的连接上使用一个数据提取时,您可以选择频率:

    • 数据刷新时:仅在通过运行刷新计划刷新视图或工作簿中的数据时发送。
    • 按选定计划:为订阅选择计划。
  9. 单击“订阅”

收到订阅电子邮件时,您可以选择图像(或者,对于 PDF 订阅,选择邮件正文中的链接)进入 中的视图或工作簿。

更新或取消订阅

您可以取消现有订阅,或者对订阅的格式、计划、主题或空视图模式进行更改。

  1. 通过执行以下操作之一访问您的 帐户设置:

    • 单击订阅电子邮件底部的“管理我的订阅”

      显示 现 有 订阅 项目

    • 登录到 。在页面的顶部,选择您的用户图标,然后选择“我的内容”

      显示 现 有 订阅 项目

  2. 单击“订阅”

  3. 选中要取消订阅的视图旁边的复选框,单击“操作”,然后单击“取消订阅”,或者选择要更改的订阅选项。

恢复或删除挂起的订阅

有时,由于工作簿问题或加载视图时出现问题,订阅会失败。如果订阅失败超过五次,您将会收到一封通知电子邮件,指明您的订阅已挂起。如果您是订阅所有者或管理员,则可通过以下几种方式来恢复挂起的订阅:

  • 从 Tableau 网页的“我的内容”区域中,一个图标出现在“上次更新”列中,指明订阅已挂起。选择“...”>“恢复订阅”以进行恢复。

  • 从受影响的工作簿的“订阅”选项卡中,一个图标出现在“上次更新”列中,指明订阅已挂起。选择“...”>“恢复订阅”以进行恢复。

订阅恢复正常时,您将收到一封电子邮件通知。

另请参见

Tableau Desktop 和 Web 制作帮助中的更改订阅设置(链接在新窗口中打开)

Tableau Cloud 帮助中的项目级管理(链接在新窗口中打开),了解哪些站点角色允许完全项目主管能力。

回到顶部

感谢您的反馈!

购买的订阅在其整个生命周期内可能经历多种状态变化,您的应用需要响应各种变化。如需检查订阅的状态,您的应用可以使用 Google Play 结算库中的

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8 或 Google Play Developer API 中的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
9 进行查询。

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
9状态是否返回?isAutoRenewing是否返回?expiryTimesubscriptionStateautoRenewing有效是True是未来
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
2True已取消是False是未来
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
3False在宽限期内是True是未来(宽限期结束)
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
4True暂时保留否不适用是过去(预期有效期结束,或宽限期(如有)结束)
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
5True已暂停否不适用是过去
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
6True已到期否不适用是过去
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
7False注意:购买令牌的有效期是从订阅成功到订阅到期后 60 天。此日期过后,购买令牌不再有效,不能再调用 Google Play Developer API。

如果您的应用将订阅状态存储在安全的后端服务器上,您应使用实时开发者通知监听状态变化,以确保状态保持同步。系统会针对影响订阅状态的事件(如续订和取消)发送

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。

注意:您必须在收到实时开发者通知后调用 Google Play Developer API,以获取完整状态并更新您自己的后端状态。此类通知只会告知您购买状态发生了变化,而不会为您提供有关购买交易的完整信息。

您的应用需要处理下面几部分中介绍的状态变化。

注意:由于存在配额限制,不建议通过定期轮询 Google Play Developer API 来检查状态,而应利用实时开发者通知。

新订阅

请务必遵循我们在处理新购买交易方面给出的建议。用户购买订阅后,

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8 会返回订阅,并且系统会发送类型为
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
0 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。当您收到此通知时,您应查询 Google Play Developer API,以获取最新的订阅状态。订阅资源与以下示例类似:请注意,在您确认购买交易之前,资源的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
2 为
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
3:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_PENDING", // need to acknowledge new purchases
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ],
}

续订

注意:续订不需要确认。

如果续订成功,

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8 会继续返回订阅。

当订阅续订时,系统也会发送

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
5 通知。您的应用应确保用户仍有权使用相应的订阅内容,然后使用从 Google Play Developer API 返回的订阅资源中提供的新
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 来更新订阅状态。订阅资源与以下内容类似:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
注意:如果订阅设置为在每月的 29 日、30 日或 31 日续订,则在下一个非闰年的二月,订阅续订日将转为 28 日,然后在订阅有效期内每月的 28 号续订。同样,如果用户在 3 月 31 日开始订阅,则订阅会在 4 月 30 日续订,然后在每个月的 30 号续订。

到期

订阅到期后,

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8 不会再返回订阅,并且用户应失去对订阅的访问权限。

当订阅到期时,系统也会发送类型为

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
8 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。当您收到此通知时,应查询 Google Play Developer API,以获取最新的订阅状态。订阅资源与以下内容类似:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}

取消

用户可以主动从 Play 商店取消订阅,也可以让订阅自动取消(如果在处于帐号保留状态后没有恢复)。用户取消订阅后,会保有对相关内容的访问权限,直到当前结算周期结束为止。结算周期结束后,访问权限会被撤消。

如果订阅被取消但尚未到期,

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8 仍会返回订阅。取消订阅会触发
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
1 通知。当您收到此通知时,从 Google Play Developer API 返回的订阅资源会把
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
2 设置为“SUBSCRIPTION_STATE_CANCELED”,并且
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 包含用户失去订阅访问权限的日期。如果
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 是过去的日期,则用户会立即失去访问权限。否则,用户应保有访问权限,直到订阅到期。订阅资源与以下内容类似:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}

您的应用可以查看从 Google Play Developer API 返回的订阅资源中的

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
5,以了解取消订阅的原因(例如,客户取消了订阅或遇到了结算问题)。如果订阅被用户取消,您可以查看
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 字段,以了解用户取消订阅的原因。

您的应用可能需要显示一条消息,告知用户其订阅已被取消,如“您的订阅将于 some_date 到期”。此外,您的应用还可以深层链接到 Google Play 商店,让用户能够恢复其订阅。

如果显示此消息,还应让用户能够永久关闭此消息。

另请注意,取消消息可能会令用户反感,尤其是手动取消了订阅而不是因付款过期而导致订阅被取消的用户。您可以选择不通知手动取消了订阅的用户。

警告:如有任何用户仍有权访问订阅内容,请勿从 Google Play 上移除订阅。移除用户有权访问的内容会导致受到处罚。

撤消

系统可能会出于各种原因撤消用户的订阅,包括您的应用使用

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
7 撤消订阅或购买交易被退款。在这种情况下,您的应用应立即撤消用户的访问权限。撤消的订阅不再从
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8 返回。当发生这种情况时,系统也会发送类型为
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
9 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。当您收到此通知时,从 Google Play Developer API 返回的订阅资源会把
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
2 设置为
"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
2,并且
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 包含用户失去订阅访问权限的日期。订阅资源与以下内容类似:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}

帐号保留功能

注意:对所有开发者来说,支持帐号保留功能是必选项。

帐号保留是一种订阅状态,当通过用户的付款方式扣款失败且任何关联的宽限期都已结束而没有付款解决方案时,订阅开始进入这种状态。当订阅进入帐号保留状态后,您应阻止用户访问您的内容或服务。帐号保留期最多持续 30 天。

在帐号保留期间,订阅不会由

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8 返回。

在帐号保留期间,您应根据需要处理订阅的任何取消、恢复或重新购买。

注意:如果用户修正了付款方式并恢复订阅,则购买令牌将与用户帐号保留状态开始之前完全相同。不过,用户可能会在帐号保留期内重新购买订阅,从而重新获得对订阅内容的访问权限。在这种情况下,系统会返回一个新的购买令牌值来表示这一新的订阅实例。

用户进入帐号保留状态时,您应利用实时开发者通知来告知用户为何其对订阅的访问权限被暂停。在您的应用内,应显示一条消息,说明如何修正付款方式并重新获得对订阅的访问权限。您的消息应包含指向 Google Play 订阅设置的链接,以便用户可以修正其付款方式。例如,您可以使用类似下面的消息:

"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."

如果用户可以在您的应用外访问订阅内容,则您可能需要向用户发送推送通知或电子邮件,告知用户其订阅已失效。

如果用户得以解决其付款问题,您可以在应用中显示一条消息,告知用户其订阅已恢复。例如,您可以使用类似下面的消息:

"Your form of payment was updated, and your subscription has
been recovered."
注意:如果从帐号保留状态恢复了订阅,结算日期将转为恢复日期。

利用实时开发者通知,当订阅进入帐号保留状态时,您会收到类型为

"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
5 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。从安全的后端服务器调用 Google Play Developer API 可检索新的订阅信息。在帐号保留期间,订阅资源的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 会设为过去的时间戳:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ON_HOLD",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}

用户修正其付款方式后,订阅会恢复为活动状态,您随后必须恢复用户对订阅内容的访问权限。

如果您的应用仅依赖于

"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
8 来确定用户是否有权访问订阅,则应自动处理订阅从帐号保留状态的恢复。

如果您的应用与服务器同步订阅状态,您就应监听类型为

"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
9 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8,以便在订阅已恢复且用户应重新获得访问权限时收到通知。如果您在收到此通知后查询订阅,
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 现在会设为将来的时间戳:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      ...
    }
  ],
}

如果用户在帐号保留期结束之前未修正付款方式,您会收到

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
1 实时开发者通知。有关处理取消的说明,请参阅订阅取消。当您查询以这种方式取消的订阅时,返回的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 会设为过去的时间戳:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}

帐号保留权限和恢复订阅

以下示例展示了订阅进入帐号保留状态、然后在用户解决付款方式问题后恢复订阅的时间线。

显示 现 有 订阅 项目

与上一个示例类似,该示例展示了订阅在进入帐号保留状态之前先进入宽限期的时间线。

显示 现 有 订阅 项目

请注意以下几点:

  • 在宽限期内,用户应能继续享受订阅权益。
  • 在订阅进入帐号保留状态前,Google 会额外尝试通过付款方式扣款,最多尝试 24 小时。在此期间,用户能继续享受订阅权益。该重试期结束后,订阅会进入帐号保留状态,用户应失去订阅权益。
  • 如果用户在宽限期内恢复订阅,续订日期不会重置。
  • 如果用户在帐号保留期间恢复订阅,则续订日期会重置。

宽限期

注意:默认情况下,所有订阅都启用了宽限期。您可以从 Google Play 管理中心停用宽限期。

启用宽限期后,如果在结算周期结束时存在付款问题,订阅就会进入宽限期。在此期间,用户应仍有权访问订阅,同时 Google Play 会尝试续订订阅。您可以从 Google Play 管理中心的应用内商品设置中指定宽限期的长度。

如果您的应用仅依赖于

"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
8 来检查用户是否有权访问订阅,则应自动处理宽限期,因为
"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
8 会在购买交易的到期日期之前继续返回已取消的购买交易。

如果您的应用与后端同步订阅状态,您就应监听类型为

"Your form of payment was updated, and your subscription has
been recovered."
6 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8,以便在用户进入宽限期时收到通知。当用户处于宽限期时,订阅资源包含
"Your form of payment was updated, and your subscription has
been recovered."
8。

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
0注意:Google Play 会动态扩大
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 值,直到宽限期届满为止。

当用户进入宽限期时,应在您的应用中显示一条消息,告诉用户如何修正付款方式。否则,当宽限期结束时,用户会失去对订阅的访问权限。此消息可以深层链接到 Google Play 商店,以帮助用户管理订阅。

一旦用户修正了付款方式,订阅就会续订,而您的应用可以按照续订中的说明处理续订。

如果用户在宽限期内未修正其付款方式,那么订阅会进入帐号保留状态。

无帐号保留功能时的宽限期权限和恢复订阅

以下示例展示了订阅进入宽限期、然后在用户解决付款方式问题后恢复订阅的时间线。在此示例中,订阅不支持帐号保留功能,因此宽限期结束后,用户应失去订阅权益。

显示 现 有 订阅 项目

请注意以下几点:

  • 在宽限期内,用户应能继续享受订阅权益。
  • 如果用户在宽限期内恢复订阅,续订日期不会重置。

已暂停的订阅

注意:默认情况下,所有订阅均已启用暂停功能。您可以从 Google Play 管理中心停用暂停功能。

您可以通过让用户能够暂停订阅来防止主动取消订阅的用户流失。在您启用暂停功能后,用户可以选择暂停订阅一段时间(介于一周到三个月之间),具体取决于订阅的续订周期。启用暂停选项后,该选项将显示在订阅中心和取消流程中。请注意,按年订阅无法暂停,并且一周和三个月的暂停限制随时可能更改。

为了让用户能够暂停订阅,请执行以下操作:

  1. 登录 Google Play 管理中心。
  2. 选择您的应用,然后依次转到商店发布 > 应用内商品 > 订阅。
  3. 展开订阅设置部分。
  4. 选中启用暂停功能。

只有在当前结算周期结束后,订阅暂停才会生效。订阅暂停后,用户将无法访问订阅。在暂停期结束时,订阅将恢复,并且 Google 会尝试续订订阅。如果恢复成功,订阅将再次变为活动状态。如果由于付款问题导致恢复失败,用户将进入帐号保留状态,如图 1 所示:

显示 现 有 订阅 项目
图 1. 用户暂停订阅,然后进入帐号保留状态。

用户也可以选择在暂停期内随时手动恢复订阅,如图 2 所示。当用户手动恢复订阅时,结算日期将更改为手动恢复日期。

显示 现 有 订阅 项目
图 2. 用户先暂停再恢复订阅。

用户的订阅暂停后,订阅不会由

"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
8 返回。如果恢复了订阅,订阅随后会由
"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
8 返回。

如果您的应用与安全的后端服务器同步订阅状态,则应监听实时开发者通知来维护状态。利用这些通知,还可以在您的应用中通知用户他们已暂停订阅,因而无法访问订阅。您还应使用 Google Play 深层链接来为用户提供一种手动恢复订阅的方法。

当用户发起订阅暂停时,系统会发送类型为

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ON_HOLD",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
2 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。此时,用户应保持对订阅的访问权限,并且订阅资源包含
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ON_HOLD",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
4、
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ON_HOLD",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
5(付款已接收),以及
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 和
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ON_HOLD",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
7 的将来日期值。

当暂停生效时,系统会发送类型为

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ON_HOLD",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
8 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。此时,用户应失去对订阅的访问权限,并且订阅资源包含
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ON_HOLD",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
4 和
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      ...
    }
  ],
}
1(待处理),以及
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_ON_HOLD",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
7 的将来日期值和
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 的过去日期值。

如果在暂停期结束时自动恢复了订阅或用户选择了手动恢复订阅,系统会发送类型为

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
5 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。应按照续订中的说明来处理此事件。

如果尝试恢复订阅时付款失败,系统会发送类型为

"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
5 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。应按照帐号保留部分中的说明来处理此事件。

恢复

注意:所有开发者都必须支持订阅恢复功能。

已取消的订阅会在到期日期之前继续显示在 Play 商店应用中。用户可以通过在 Google Play 商店应用的订阅部分中点击重新订阅(以前称为恢复),在已取消的订阅到期之前恢复订阅。

显示 现 有 订阅 项目
图 3. Google Play 商店应用中的“帐号”>“订阅”部分,其中显示了已取消的订阅,以及相应的重新订阅按钮。

如果您的应用仅依赖于

"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
8 来确定用户是否有权访问订阅,则应自动处理恢复,因为
"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
8 会在购买交易的到期日期之前继续返回已取消的购买交易。已恢复的订阅会继续续订,就像未取消过一样。

如果您的应用与后端同步订阅状态,您就应监听类型为

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
0 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。收到该通知后,您的应用可以对其做出响应,记录订阅现已设为续订,并停止在您的应用中显示恢复消息。订阅资源与下面的内容类似:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
1注意:已恢复的订阅使用的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
2 与取消订阅时使用的令牌相同。所有取消字段都会从资源中清除。

升级、降级和重新注册

当用户升级、降级或在订阅过期之前重新注册应用时,旧订阅会变为无效,并且系统会使用一个新的购买令牌创建新订阅。

此外,从 Google Play Developer API 返回的订阅资源将包含一个

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
3,用来指示用户升级、降级或重新订阅时所基于的旧购买交易。您可以使用
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
3 查询旧订阅并识别现有用户帐号,以便将新购买交易与同一帐号关联。

在应用中提供升级、降级或重新注册选项之前,您必须确认现有订阅。如果旧订阅正在等待确认,任何方案变更或重新注册都会被阻止。

在方案变更或重新注册后,我们还要求您确认新的订阅购买交易。建议您使用 Google Play Developer API 确认购买交易,以免购买交易被取消。订阅资源与下面的内容类似:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
2

预付费方案集成

预付费方案到期后不会自动续订。如需延长订阅内容使用权而不出现中断,用户必须给同一项订阅内容的预付费方案充值。

对于充值,请按照与原始购买交易相同的方式启动结算流程。您无需指明购买交易是充值。

预付费方案充值始终使用

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
5 按比例计费模式,您无需明确设置此模式。系统会立即向用户收取整个结算周期的费用,并按充值时指定的时长延长其使用权。

充值后,

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
6 结果对象中的以下字段会更新,以反映最新的充值交易:

  • 订单 ID
  • 购买时间
  • 签名
  • 购买令牌
  • 已确认

以下

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
6 字段中包含的数据始终与原始购买交易中的数据相同:

  • 软件包名称
  • 购买状态
  • 商品
  • 自动续订

预付费购买交易确认

与自动续订订阅内容类似,您必须在购买交易完成后确认预付费方案。初始购买交易和所有充值都需要进行确认。如需了解详情,请参阅处理购买交易。

由于预付费方案的时长有可能比较短,因此请务必尽快确认购买交易。

时长为一周或更长时间的预付费方案必须在三天内确认。

对于时长不到一周的预付费方案,其确认时间不得晚于方案时长过半之时。例如,开发者必须在 1.5 天内确认时长为三天的预付费方案。

警告:如果预付费方案用户进行了充值购买交易,而您未在相应时间段内确认购买交易,那么充值购买交易会被撤消,剩余订阅也会被撤消和取消,而用户则会收到退款。

使用深层链接让用户能够管理订阅

作为开发者,您必须让客户能够轻松地管理订阅。您的应用应在设置或偏好设置屏幕上添加一个链接,让用户能够管理订阅。此链接的示例如图 4 所示。

显示 现 有 订阅 项目
图 4. Google Play 订阅按钮是“管理订阅”链接的一个示例。

在此链接的点击处理程序中,添加逻辑以确定用户在您的应用中是否有任何未到期的订阅,其中

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
6 是将来的日期,或者
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
9 设为
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
00。

每个订阅的

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
01 都与您在 Play 管理中心创建它时为其分配的商品 ID 相匹配。如需以编程方式确定现有订阅的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
01,请在应用的后端查询与特定用户关联的订阅列表。

如果用户有未到期的订阅,您可以将其转到与下面类似的网址,应将“your-sub-product-id”和“your-app-package”替换为订阅 ID 和应用软件包信息:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
3

如果用户在您的应用中没有任何未到期的订阅,请使用以下网址将用户转到显示其所有其他订阅的页面,如图 5 和图 6 所示:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
4
显示 现 有 订阅 项目
图 5. Play 商店的订阅屏幕显示了用户所有订阅的状态。
显示 现 有 订阅 项目
图 6. 点按某个订阅可查看更多详情。

您可以在 Classy Taxi 示例应用中找到订阅链接逻辑的示例代码。

允许用户升级、降级或更改订阅

您可以为用户提供不同的订阅层级,例如基本层级和高级层级。图 7 显示了一个提供两个订阅层级的屏幕:

显示 现 有 订阅 项目
图 7. 此应用包含两个订阅层级。

用户应该能够访问与图 7 类似的屏幕来升级或降级订阅。升级或降级订阅时,您可以设置按比例计费模式,用于确定变更对订阅者有何影响。

下表列出了可用的按比例计费模式:

按比例计费模式说明
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
03订阅会立即升级或降级。任何剩余时间都会根据差价进行调整,并通过向前推下一个结算日期,将余额记入新订阅。这是默认行为。
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
04订阅会立即升级,结算周期保持不变。用户随后需要补足剩余订阅期的差价。
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
05订阅会立即升级或降级,在订阅续订时将按新价格收取费用。结算周期保持不变。
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
06只有在订阅续订时,订阅才会升级或降级。
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
5订阅会立即升级或降级,并且系统会即刻按全价向您收取新订阅权利的费用。上一订阅的剩余费用会按如下方式处理:如果您订阅的是同一权利,剩余费用会结转过来;如果您要切换到不同的订阅权利,则按比例折算成时间加到新订阅的期限中。

如果用户更改订阅权利,您必须在运行时指定按比例计费的费率。对于权利变更,您无法通过 Google Play 管理中心指定默认的按比例计费模式。

如果用户未更改订阅权利,您就可以使用通过 Play 管理中心配置的默认按比例计费模式。您也可以通过在

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
08 中指定按比例计费模式来替换此行为。请注意以下限制:

  • 从预付费方案或自动续订型方案升级、降级或在同一订阅中切换到预付费方案时,唯一允许使用的按比例计费模式为
    {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      ...
      "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
      ...
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": timestamp_in_past,
          ...
        }
      ],
    }
    
    5。如果您指定任何其他按比例计费模式,将导致购买失败,并向用户显示错误消息。
  • 在同一订阅中将方案从预付费方案切换到自动续订型方案时,有效的按比例计费模式为
    {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      ...
      "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
      ...
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": timestamp_in_past,
          ...
        }
      ],
    }
    
    5 和
    {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    05。如果您指定任何其他按比例计费模式,将导致购买失败,并向用户显示错误消息。

按比例计费示例

为了理解各种按比例计费模式的工作原理,我们来考虑下面的场景:

Samwise 订阅了 Country Gardener 应用的在线内容。他当前按月订阅第 1 层级的内容,该内容只包含文字。此订阅的费用为每月 2 美元,并且在每月的第一天续订。

在 4 月 15 日,Samwise 选择升级到第 2 层级按年订阅,该内容包含视频更新,费用为每年 36 美元。

升级订阅时,开发者会选择一种按比例计费模式。以下列表说明了各种按比例计费模式对 Samwise 的订阅有何影响:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
03Samwise 的第 1 层级订阅会立即终止。由于他支付了整个月(4 月 1 日至 30 日)的费用,但在订阅期刚过一半时升级了订阅,因此剩余半个月的订阅费用(1 美元)会应用到新订阅。不过,由于新订阅的费用为每年 36 美元,1 美元的余额只够 10 天(4 月 16 日至 25 日)的费用,因此在 4 月 26 日,他需要为新订阅支付 36 美元的费用,并且此后每年的 4 月 26 日需要再支付 36 美元。
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
04可以使用此模式,因为第 2 层级的每时间单位的订阅价格(36 美元/年 = 3 美元/月)大于第 1 层级的每时间单位的订阅价格(2 美元/月)。Samwise 的第 1 层级订阅会立即终止。由于他支付了整个月的费用,但只用了一半,因此剩余半个月的订阅费用(1 美元)会应用到新订阅。不过,由于新订阅的费用为每年 36 美元,剩余 15 天的费用为 1.50 美元,因此他需要为新订阅支付 0.50 美元的差价。在 5 月 1 日,Samwise 需要为新订阅层级支付 36 美元,并且此后每年的 5 月 1 日都需要再支付 36 美元。
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
05Samwise 的第 1 层级订阅会立即升级到第 2 层级,无需支付额外的费用,而在 5 月 1 日,他需要为新订阅层级支付 36 美元,并且此后每年的 5 月 1 日都需要再支付 36 美元。
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
06Samwise 的第 1 层级订阅会一直持续到 4 月 30 日到期。 在 5 月 1 日,第 2 层级订阅开始生效,Samwise 需要为新订阅层级支付 36 美元。
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
5Samwise 的第 1 层级订阅会立即终止。他的第 2 层级订阅当天开始生效,他需要支付 36 美元。由于他支付了一整个月的费用,但只用了一半,因此剩余半个月的订阅费用(1 美元)会应用到新订阅。由于新订阅的费用为每年 36 美元,因此他的订阅期限会延长一年的 1/36(约 10 天)。这样一来,Samwise 的下一次扣款时间距离现在还有 1 年零 10 天,下次扣款金额为 36 美元。此后,他每年需要支付 36 美元。

选择按比例计费模式时,请务必查看我们的按比例计费建议。

您的应用可以使用与启动购买流程相同的步骤来为用户提供升级或降级。不过,在升级或降级时,您需要提供当前订阅、将来(升级或降级的)订阅以及要使用的按比例计费模式的详细信息,如以下示例所示:

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
5

对于立即替换按比例计费模式,您的应用会在

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
17 中收到新的购买交易。此外,
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8 中也会提供相应的购买交易。当您收到购买令牌时,请遵循与验证新购买令牌相同的验证流程。请务必使用 Google Play 结算库中的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
19 或 Google Play Developer API 中的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
20 确认这些购买交易。

Google Play Developer API 会在订阅资源中返回一个

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
3。请务必使在
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
3 中提供的令牌无效,以确保旧令牌不会被用于获取对您的服务的访问权限。如需了解如何处理升级购买交易和降级购买交易,请参阅升级、降级和重新注册。

对于延迟替换模式,您的应用会收到对

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
17 的调用,其中包含对原始订阅方案的购买,以及表明升级或降级是否成功的状态。在替换生效之前,
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
8 会继续返回原始订阅方案的购买交易。新方案生效后,
"There is a problem with your subscription. Click here to go to the
Google Play subscription settings to fix your payment method."
8 会返回新订阅的购买交易数据,并且系统会向安全的后端服务器发送
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
5 通知。对于延迟替换,强烈建议监听此通知,并使用
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
20 确认购买交易。订阅资源中的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
3 可用于确定订阅后端的哪个用户(如果适用)应更新为拥有新的权利。您的应用不应依赖于用户打开应用并通过
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
19 确认,因为用户在方案变更生效后的三天内可能不会打开应用。

在享受免费试订或初次体验价优惠期间升级

当用户升级或降级时,会应用免费试订资格设置。您可以在 Google Play 管理中心内调整免费试订资格设置。

请注意以下几点:

  • 如果对于您的应用中提供的所有订阅,用户只能获得一次免费试订机会,则用户要改用的方案将没有免费试订或初次体验价。
  • 如果您针对每种订阅产品提供一次免费试订机会,则用户要改用的方案可以有免费试订或初次体验价。

下表说明了当新方案和旧方案都有免费试订且用户在免费试订期间升级时各种按比例计费模式的行为:

在每个应用中免费试订一次每种订阅产品免费试订一次IMMEDIATE_WITH_TIME_PRORATION用户会立即失去免费试订资格。剩余的免费试订期会根据差价转换为新层级的等效免费期。用户会失去之前的免费试订资格,但会立即开始新的免费试订。此外,旧层级的剩余免费试订期会转换为新层级的等效免费期,并添加到新的免费试订。IMMEDIATE_AND_CHARGE_PRORATED_PRICE

用户会立即失去免费试订资格。用户随后需要补足剩余订阅期的差价。下一个结算日期保持不变。

注意:此选项仅适用于每时间单位的价格提高的订阅升级。

IMMEDIATE_WITHOUT_PRORATION用户会立即升级到新层级。用户可以一直免费试订新层级的内容,直到上一个结算周期结束。DEFERRED用户可以一直免费试订旧订阅内容,直到下一个结算日期。IMMEDIATE_AND_CHARGE_FULL_PRICE用户会立即失去免费试订资格。然后系统会向用户收取新订阅的费用。下一个结算日期是在新订阅期加上免费试订的剩余时间结束后。

为了理解在每个应用中免费试订一次的默认情况下免费试订过渡的工作原理,我们来考虑下面的场景:

Maria 订阅了 Country Gardener 应用的在线内容。她当前按月订阅第 1 层级的内容,该内容只包含文字。此订阅的费用为每月 10 美元,并且她是在 4 月 1 日订阅的。作为首次订阅者,她可以享受 30 天的免费试订服务,这意味着,她应于 5 月 1 日支付第一笔订阅费用。

在 4 月 15 日,Maria 选择升级到第 2 层级订阅,该内容包含视频更新,费用为 20 美元/月。这第二次订阅也有 30 天的试订服务。

以下列表说明了在各种按比例计费模式下如何进行免费试订过渡:

  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    03 - Maria 会立即升级到第 2 层级。由于 Maria 在订阅期刚过一半时升级了订阅,因此剩余半个月的订阅费用(15 天的金额,按 10 美元/月计算)会应用到新订阅。不过,由于新订阅的费用为 20 美元/月,因此 15 天的余额只够 7.5 天的费用。Maria 没有资格再享受一次第 2 层级的免费试订服务,所以自 4 月 22 日起,她每月需要支付 20 美元。
  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    04 - 可以使用此模式,因为第 2 层级的每时间单位的订阅价格(20 美元/月)大于第 1 层级的每时间单位的订阅价格(10 美元/月)。Maria 的第 1 层级订阅会立即升级到第 2 层级,并且她会失去免费试订资格。由于 Maria 的下一个结算日期是在 5 月 1 日,因此她今天需要支付 10 美元,这是 4 月份下半月的费用,然后自 5 月 1 日起,她每月需要支付 20 美元。
  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    05 - Maria 的第 1 层级订阅会立即升级到第 2 层级。Maria 可以免费试订到 4 月 30 日,并且现在可以访问第 2 层级的内容。自 5 月 1 日起,她每月需要支付 20 美元。
  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    06 - Maria 的第 1 层级订阅一直持续到下次付款日,即 5 月 1 日。在 5 月 1 日,第 2 层级订阅开始生效,Maria 需要在每月的第一天支付 20 美元。
  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      ...
      "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
      ...
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": timestamp_in_past,
          ...
        }
      ],
    }
    
    5 - Maria 的第 1 层级订阅会立即升级到第 2 层级,并且她会失去免费试订资格。她需要当天支付 20 美元。由于 Maria 的免费试订期还剩 15 天,因此她的下一个结算日期是 1 个月 + 15 天后,也就是 7 月 1 日。自 7 月 1 日起,她每月需要支付 20 美元。

以下列表说明了开发者允许每种订阅产品免费试订一次时的过渡行为:

  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    03 - Maria 会立即升级到第 2 层级。由于 Maria 在订阅期刚过一半时升级了订阅,因此剩余半个月的订阅费用(15 天的金额,按 10 美元/月计算)会应用到新订阅。不过,由于新订阅的费用为 20 美元/月,因此 15 天的余额只够 7.5 天的费用。Maria 有资格再享受一次第 2 层级的免费试订服务,所以她又有 37.5 天免费。自 5 月 22 日起,她每月需要支付 20 美元。
  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    04 - 可以使用此模式,因为第 2 层级的每时间单位的订阅价格(20 美元/月)大于第 1 层级的每时间单位的订阅价格(10 美元/月)。Maria 的第 1 层级订阅会立即升级到第 2 层级,并且她会失去免费试订资格。由于 Maria 的下一个结算日期是在 5 月 1 日,因此她今天需要支付 10 美元,这是 4 月份下半月的费用,然后自 5 月 1 日起,她每月需要支付 20 美元。
  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    05 - Maria 的第 1 层级订阅会立即升级到第 2 层级。Maria 可以免费试订到 4 月 30 日,并且现在有权访问第 2 层级。
  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    06 - Maria 的第 1 层级订阅一直持续到下次付款日,即 5 月 1 日。在 5 月 1 日,第 2 层级订阅开始生效,Maria 需要在每月的第一天支付 20 美元。
  • {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      ...
      "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
      ...
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": timestamp_in_past,
          ...
        }
      ],
    }
    
    5 - Maria 的第 1 层级订阅会立即升级到第 2 层级,并且她会失去免费试订资格。她需要当天支付 20 美元。由于 Maria 的免费试订期还剩 15 天,因此她的下一个结算日期是 1 个月 + 15 天后,也就是 7 月 1 日。自 7 月 1 日起,她每月需要支付 20 美元。

按比例计费建议

下表显示了不同的按比例计费场景以及我们针对各种场景给出的建议:

场景建议的按比例计费模式结果升级到费用更高的层级
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
04用户会立即获得访问权限,而结算周期保持不变。降级到费用更低的层级
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
06用户已经为费用更高的层级付款,因此他们将保有访问权限,直到下一个结算日期。更改同一层级的循环周期(例如,从按月订阅更改为按年订阅)
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
06用户将在下一个结算日期按新的周期性价格支付。在免费试订期间升级 - 保留对免费试订的访问权限
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
05用户会保有对免费试订的访问权限,但试订期的剩余时间会升级到更高的层级。在免费试订期间升级 - 终止对免费试订的访问权限
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
04用户会立即获得对新层级的访问权限,但不能再免费试订。

客户管理

使用实时开发者通知,当用户决定取消订阅时,您可以实时检测到。当用户取消了订阅但在订阅到期之前,您可以向他们发送推送通知或应用内消息,让他们重新订阅。

在用户取消订阅后,您可以尝试在应用内或通过 Play 商店赢回他们。下表介绍了各种订阅场景以及相关的赢回操作和应用要求。

订阅到期之前订阅到期之后应用内Play 商店内应用内Play 商店内赢回功能应用内订阅恢复应用内订阅重新订阅用户完成结账流程是否是是用户订阅仍与同一 SKU 关联用户可以注册相同或不同的 SKU是用户可以注册相同或不同的 SKU是创建新的购买令牌是否是是默认处于启用状态否是,所有开发者都需要支持否

未采用结算库 2.0 及以上版本的应用:否

采用结算库 2.0 及以上版本的应用:是。开发者可以在管理中心中选择停用该功能。

何时向用户收取费用

如果使用相同的 SKU:当前结算周期结束时。

如果使用不同的 SKU:取决于按比例计费模式。

当前结算周期结束时立即立即所需实现在应用中提供重新注册界面

检测订阅状态的变化

指向 Play 商店的深层链接

在应用中提供重新注册界面处理应用外购买

订阅到期之前 - 应用内

对于已被取消但尚未过期的订阅,您可以通过应用与新订阅者相同的应用内商品购买流程,允许订阅者在您的应用中恢复他们的订阅。请确保界面中会显示用户的现有订阅。例如,您不妨显示用户当前的到期日期、定期支付的费用以及重新激活按钮。

大多数情况下,建议您向用户提供与已订阅内容相同的价格和 SKU,如下所示:

  • 使用同一个 SKU 发起新的订阅购买。
  • 新订阅将替换旧订阅,并在同一到期日期续订。旧订阅会立即标记为“已过期”。
  • 例如,小张订阅了一款示例音乐应用的内容且订阅的到期日期为 8 月 1 日。在 7 月 10 日,他以相同的每月价格重新订阅了一个月的订阅内容。系统会根据余额按比例计算新订阅的费用,新订阅会立即生效,并且仍在 8 月 1 日续订。

如果您想提供不同的价格(例如,新的免费试订或赢回折扣),则可以改为为用户提供不同的 SKU:

  • 使用采用了按比例计费模式
    {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    05 的不同 SKU 发起升级或降级。
  • 新订阅将替换旧订阅,并在同一到期日期续订。在原始到期日期那天,用户会按新 SKU 的价格付费(包括所有初次体验价)。如果旧订阅是使用经过混淆处理的帐号 ID 创建的,则应将同一 ID 传递给
    {
      "kind": "androidpublisher#subscriptionPurchaseV2",
      "startTime": "2022-04-22T18:39:58.270Z",
      "regionCode": "US",
      "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
      "latestOrderId": "GPA.3333-4137-0319-36762",
      "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
      "lineItems": [
        {
          "productId": "sub_variant_plan01",
          "expiryTime": next_renewal_date,
          "autoRenewingPlan": {
            "autoRenewEnabled": true
          }
        }
      ]
    }
    
    46,以进行升级和降级。
  • 例如,小张订阅了一款示例音乐应用的内容且订阅的到期日期为 8 月 1 日。在 7 月 10 日,他以初次体验价重新订阅了按年订阅的内容。新订阅会立即生效,并且用户将在 8 月 1 日按初次体验价付费。
  • 如果您决定在赢回 SKU 中添加免费试订或初次体验价,请确保用户有资格享受这些优惠,方法是在 Google Play 管理中心取消选中允许在每个应用中免费试订一次复选框,选中该复选框会限制用户在每个应用中只能免费试订一次。

当您收到购买令牌时,应该就像处理新订阅一样来处理购买交易。此外,Google Play Developer API 还会在订阅资源中返回一个

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
3。请务必让
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
3 中提供的令牌失效,以确保旧令牌不会被用于获取对您服务的访问权限。

订阅到期之前 - Play 商店内

注意:所有开发者都必须支持恢复功能。

在订阅被取消但仍然处于有效状态时,用户可以通过点击重新订阅(以前称为恢复)在 Google Play 订阅中心恢复订阅。这样会让订阅和购买令牌保持不变。

显示 现 有 订阅 项目
图 8. Google Play 商店应用中的“帐号”>“订阅”部分,其中显示了已取消的订阅,以及相应的重新订阅按钮。

如需详细了解如何恢复订阅,请参阅恢复。

订阅到期之后 - 应用内

您可以允许订阅已过期的订阅者在您的应用中重新订阅,方法是应用与新订阅者相同的应用内商品购买流程。不过,请注意以下几点:

  • 为了给用户提供折扣,您可能需要为您的订阅提供一个具有特殊定价的商品 ID,也称为“赢回 SKU”。您可以在应用中提供优惠,也可以在应用外(如通过电子邮件)通知用户优惠活动。
  • 为了开始赢回订阅,请使用 Google Play 结算库在您的 Android 应用中启动购买流程。这与新订阅的流程相同,但您可以确定提供给用户的 SKU。
  • 如果您决定在赢回 SKU 中添加免费试订或初次体验价,请确保用户有资格享受这些优惠,方法是在 Google Play 管理中心取消选中允许在每个应用中免费试订一次复选框,选中该复选框会限制用户在每个应用中只能免费试订一次。
  • 如果用户重新订阅同一 SKU,便没有资格再享受免费试订或初次体验价。请务必在界面中说明这一点。

当您收到购买令牌时,应该就像处理新订阅一样来处理购买交易。您将不会在订阅资源中收到

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_CANCELED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": timestamp_in_past,
      ...
    }
  ],
}
3。

订阅到期之后 - Play 商店内

注意:在 Play 商店中重新订阅仅适用于采用 Google Play 结算库 2.0 及更高版本的应用。注意:符合条件的应用的所有订阅 SKU 默认情况下都会启用重新订阅功能。您随时可以通过 Google Play 管理中心调整 SKU 设置以停用此功能。

如果您启用了重新订阅功能,用户便可在订阅到期后最长一年时间内,通过在 Google Play 订阅中心点击重新订阅来重新订阅同一 SKU。这样会生成新的订阅和购买令牌。

显示 现 有 订阅 项目
图 9. Google Play 商店应用中的“帐号”>“订阅”部分,其中显示了已取消且已过期的订阅,以及相应的重新订阅和移除按钮。

重新订阅属于应用外购买,因此请务必遵循处理在您的应用外进行的购买交易中介绍的最佳实践。

宣传您的订阅

您可以创建促销代码,让部分用户能够免费试订现有订阅更长时间。如需了解详情,请参阅促销代码。

对于免费试订,Google Play 会在免费试订开始之前验证用户是否具有有效的付款方式。某些用户可能会看到此验证的结果显示为付款方式被暂停或产生扣款。这种暂停或扣款是暂时的,稍后会撤消或退还。

试订期结束后,系统会通过用户的付款方式,按照全价收取订阅费用。

如果用户在免费试订期间的任一时刻取消了订阅,订阅将保持活动状态,直到试订期结束,当免费试订期结束时,用户不会被扣款。

取消、退款或撤消

您可以使用 Google Play Developer API 取消订阅、为订阅退款或撤消订阅。Google Play 管理中心也提供了此功能。

  • 取消:用户可以在 Google Play 上取消订阅。您也可以为用户提供一个在您的应用中或您的网站上取消订阅的选项。您的应用应按照撤消中的说明来处理这些取消事件。
  • 退款:当您退款时,用户可以继续使用订阅内容。例如,如果因技术错误而导致用户无法访问您的商品,但该错误已得到解决,则可以使用退款。请注意,如果要退还的不只是最近一次的付款,或者如果您要办理部分退款,必须使用 Google Play 管理中心。
  • 撤消:当您撤消时,用户会立即失去对订阅的访问权限。例如,如果因技术错误而导致用户无法访问您的商品,因而用户不想继续使用该商品,则可以使用此选项。您的应用应按照撤消中的说明来处理这些取消事件。

下表说明了取消、退款和撤消之间的区别。

停止续订退还款项撤消访问权限取消是否否退款否是否撤消是是是

为订阅者推迟结算

注意:您无法使用推迟结算 API 推迟预付费方案的失效日期。

您可以使用 Google Play Developer API 中的

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
50 将自动续订订阅者的下一个结算日期向前推。在推迟期内,用户会订阅您的内容并且拥有完全访问权限,但不会被扣款。订阅续订日期会更新以反映新的日期。

推迟结算可让您做到以下几点:

  • 将免费访问权限作为一种特别优惠提供给用户,如购买电影时免费一周。
  • 向客户提供免费访问权限以表达善意。

每次调用该 API,结算最短可推迟一天,最长为一年。如需进一步推迟结算,您可以在新的结算日期到来之前再次调用该 API。

例如,Darcy 按月订阅了 Fishing Quarterly 应用的在线内容。正常情况下,她在每个月第一天都需要支付 1.25 英镑的费用。在 3 月,她参与了应用发布商的在线调查活动。该发布商为她提供了免费六周的奖励,将下一笔付款推迟到 5 月 15 日,也就是在她先前预定结算日期(即 4 月 1 日)的六周后。Darcy 不需要支付 4 月或 5 月初的费用,并且仍能访问相关内容。在 5 月 15 日,她支付了当月 1.25 英镑的正常订阅费用。她的下一个续订日期现在为 6 月 15 日。

推迟结算时,您可能需要通过电子邮件或在应用中通知用户,告知用户他们的结算日期发生了变化。

更改订阅价格

如需了解如何使用 Play 管理中心更改订阅价格,请参阅 Play 管理中心帮助中心内的相关文档。

警告:您不应更改通过 Google 订阅的订阅价格。

Google Play 可让您将数字商品销售给世界各地的众多用户,这些用户位于不同的语言区域,而这些语言区域在货币和定价方面有着不同的考虑因素。有时,由于区域性费用、币值波动或其他原因,您可能决定需要更改订阅价格。

您可以更改任何基础方案或优惠的价格,针对所有新购买交易,新价格会在一小时内生效。

如果用户订阅的是预付费方案,那么在充值和更改方案时,一律按当前价格付费。

默认情况下,当前已订阅自动续订型方案的用户不会受到影响。系统会创建一个旧价格同类群组。如果需要,您可以通过停用该同类群组将基础方案的价格更改为当前价格。您无法更改现有订阅者在免费或初次体验优惠定价阶段的价格。

如需详细了解如何使用旧价格同类群组,请参阅 Play 管理中心帮助中心。

通知用户价格变动

每当您更改基础方案的价格时,都应通知现有订阅者,尤其是在价格上调时。

当您上调订阅价格时,Google Play 至少要过七天才会直接通知您的现有订阅者;也就是说,您可以在此期间提前通知他们价格变动的消息。

现有订阅者至少有 30 天时间来查看价格上调情况并决定是否接受价格上调。如果他们不接受价格上调,系统会在他们需要支付更高价格之前自动取消其订阅。

用户可以在 Play 商店订阅屏幕中查看价格上调情况,该屏幕上会显示类似于图 13 的对话框。

显示 现 有 订阅 项目
图 13. 通知用户订阅价格变动的对话框示例。

Google Play 会直接通知现有订阅者所有即将发生的价格变动。

在您的应用内,我们也建议您通知受影响的用户,并提供指向 Play 商店订阅屏幕的深层链接。

当您下调订阅价格时,用户不需要同意价格变动,系统也不会向其显示价格变动对话框。从他们的下一个结算日期起,系统将按下调后的价格扣款。

处理用户对价格变动的确认

如果用户接受订阅价格上调,或者如果您下调了价格,订阅会续订,并且可以像其他任何续订一样进行处理。此外,您还会收到类型为

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  "startTime": "2022-04-22T18:39:58.270Z",
  "regionCode": "US",
  "subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
  "latestOrderId": "GPA.3333-4137-0319-36762",
  "acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": next_renewal_date,
      "autoRenewingPlan": {
        "autoRenewEnabled": true
      }
    }
  ]
}
51 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。

处理不接受价格上调的情况

如果用户直到需要支付更高价格时仍未接受价格上调,就会自动退订,并且您会收到类型为

{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time,
      ...
    }
  ],
}
1 的
{
  "kind": "androidpublisher#subscriptionPurchaseV2",
  ...
  "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
  ...
  "lineItems": [
    {
      "productId": "sub_variant_plan01",
      "expiryTime": expiration_time_in_past,
      ...
    }
  ],
}
8。可以按照取消中的说明来处理此事件。

意外价格变动

如果您意外地更改了订阅价格,应立即撤消所做的更改。只要价格在七天内还原,现有订阅者就不会收到有关意外价格变动的通知。请注意,在第一次价格变动到还原期间,新订阅者可能会收到意外价格。

处理连续两次价格变动的情况

如果您已在某次价格上调时停用旧价格同类群组,然后您再次更改价格,那么任何符合条件的用户都无需再回应第一次价格变动,因为现在仅第二次价格变动适用。

您应确保在某一时间只做出一次价格变动。不建议将价格变动用于测试目的。

如果您在七天内先后两次更改订阅价格,受影响的用户只需同意最新的价格变动。

处理付款遭拒问题

如果结算周期结束时存在付款问题,Google 会在取消订阅前的一段时间内定期尝试续订。此重试期限最长可持续 30 天,外加任何指定的宽限期天数。在此期间,Google 还会向用户发送电子邮件和通知,要求他们更新付款方式。