检查Google In App订阅续订状态

问题描述 投票:0回答:1

我必须在我的应用中实现Google In App订阅。在服务器端,我想验证用户的订阅状态。订阅的响应如下

{
  "kind": "androidpublisher#subscriptionPurchase",
  "startTimeMillis": long,
  "expiryTimeMillis": long,
  "autoRenewing": boolean,
  "priceCurrencyCode": string,
  "priceAmountMicros": long,
  "countryCode": string,
  "developerPayload": string,
  "paymentState": integer,
  "cancelReason": integer,
  "userCancellationTimeMillis": long,
  "orderId": string
}

谷歌有api来验证订阅状态。其回应如下。

{
  "kind": "androidpublisher#subscriptionPurchase",
  "startTimeMillis": long,
  "expiryTimeMillis": long,
  "autoRenewing": boolean,
  "priceCurrencyCode": string,
  "priceAmountMicros": long,
  "countryCode": string,
  "developerPayload": string,
  "paymentState": integer,
  "cancelReason": integer,
  "userCancellationTimeMillis": long,
  "orderId": string
}

我想使用此API检查用户订阅状态。我想问的问题是如何通过此响应更新用户订阅。如果用户获得一个月和一个月后的订阅,订阅将自动续订。我在我的数据库中收到旧订阅的收据,我将使用相同的OrderId来检查订阅状态。我将如何为该特定orderId更新该订阅。

python django in-app-purchase android-inapp-purchase
1个回答
0
投票

旧的问题,但仍然可以通过orderId没有续订,两点之后没有。

看看randoms answer

所有重复的订单ID在INAPP_PURCHASE_DATA JSON字段的orderId字段中返回(在V3中),每个重复的事务都附加一个整数。

订阅订单号

为了帮助您跟踪与给定订阅相关的交易,Google付款会为订阅的所有重复提供基本商家订单号,并通过附加整数来表示每个定期交易,如下所示:

GPA.1234-5678-9012-34567(基本订单号)

GPA.1234-5678-9012-34567..0(第一次重复订单ID)

GPA.1234-5678-9012-34567..1(第二次重复订单ID)

GPA.1234-5678-9012-34567..2(第三次重复订单ID)...

© www.soinside.com 2019 - 2024. All rights reserved.