开发者控制台

RVS示例


RVS示例

RVS沙盒环境和Amazon RVS生产服务器的RVS示例,以及每个示例的响应。请注意,这些示例使用正常工作的URL,因此如果您将请求粘贴到浏览器中,会收到与示例相同的响应。

示例: RVS Cloud Sandbox示例

以下请求会在RVS Cloud Sandbox中验证收据:

https://appstore-sdk.amazon.com/sandbox/version/1.0/verifyReceiptId/developer/developerSecret/user/l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=/receiptId/q1YqVbJSyjH28DGPKChw9c0o8nd3ySststQtzSkrzM8tCk43K6z0d_HOTcwwN8vxCrVV0lEqBmpJzs_VS8xNrMrP0ysuTSo2BAqXKFkZ6SilACUNzQxMzAyNjYyNDQ3MgDKJSlZpiTnFqTpK6UpWJUWlQEYahFELAA

此调用会收到一个来自RVS Cloud Sandbox 服务器的JSON响应:

{
  "autoRenewing": false,
  "betaProduct": false,
  "cancelDate": null,
  "cancelReason": null,
  "deferredDate": null,
  "deferredSku": null,
  "freeTrialEndDate": 1606985788979,
  "gracePeriodEndDate": 1606985788979,
  "parentProductId": null,
  "productId": "com.amazon.subs1",
  "productType": "SUBSCRIPTION",
  "purchaseDate": 1604613233106,
  "quantity": 1,
  "receiptId": "q1YqVbJSyjH28DGPKChw9c0o8nd3ySststQtzSkrzM8tCk43K6z0d_HOTcwwN8vxCrVV0lEqBmpJzs_VS8xNrMrP0ysuTSo2BAqXKFkZ6SilACUNzQxMzAyNjYyNDQ3MgDKJSlZpiTnFqTpK6UpWJUWlQEYahFELAA",
  "renewalDate": 1606985788979,
  "term": "1个月",
  "termSku": "com.amazon.subs1_term",
  "testTransaction": true
}

示例: 通过RVS生产服务器购买消费品

以下请求将在生产服务器上验证消费品购买收据:

https://appstore-sdk.amazon.com/version/1.0/verifyReceiptId/developer/2:smXBjZkWCxDMSBvQ8HBGsUS1PK3jvVc8tuTjLNfPHfYAga6WaDzXJPoWpfemXaHg:iEzHzPjJ-XwRdZ4b4e7Hxw==/user/LRyD0FfW_3zeOlfJyxpVll-Z1rKn6dSf9xD3mUMSFg0=/receiptId/wE1EG1gsEZI9q9UnI5YoZ2OxeoVKPdR5bvPMqyKQq5Y=:1:11

此调用将收到以下示例JSON响应:

{
 "autoRenewing":false,
 "betaProduct":false,
 "cancelDate":null,
 "cancelReason":null,
 "freeTrialEndDate":null,
 "gracePeriodEndDate":null,
 "parentProductId":null,
 "productId":"com.amazon.iapsamplev2.gold_medal",
 "productType":"CONSUMABLE",
 "purchaseDate":1399070221749,
 "quantity":1,
 "receiptId":"wE1EG1gsEZI9q9UnI5YoZ2OxeoVKPdR5bvPMqyKQq5Y=:1:11",
 "renewalDate":null,
 "term":null,
 "termSku":null,
 "testTransaction":true
}

purchaseDatecancelDate表示为以毫秒为单位的时间。可以调用java.util.Date(timeInMillis)将值转换为日期对象。cancelDatenull表示购买尚未取消。如果收据针对已取消的购买,则cancelDate将反映亚马逊客户支持取消购买的日期。

示例: 通过RVS生产服务器购买订阅

以下请求将在生产服务器上验证订阅购买收据:

https://appstore-sdk.amazon.com/version/1.0/verifyReceiptId/developer/2:SPOkNr03vVx0_u04edvPTf5t6VC-HHS4535VkVviYJp7fCvSepKM5Ys-_ODYdtw8:Y-tOqaWFAXCHluaxssj9VQ==/user/7m7UQpSnce0DcAOgcCZFVW5-sNc2rVYE6aQCGc6URNU=/receiptId/JyGJ5iEtYgFu1ngnQovTqSIHQxR53GsMLqkR1tKLp5c=:3:11
{
 "autoRenewing":false,
 "betaProduct":true,
 "cancelDate":1400784371000,
 "cancelReason":1,
 "freeTrialEndDate":null,
 "gracePeriodEndDate":null,
 "parentProductId":null,
 "productId":"sub1",
 "productType":"SUBSCRIPTION",
 "purchaseDate":1400784241000,
 "quantity":null,
 "receiptId":"JyGJ5iEtYgFu1ngnQovTqSIHQxR53GsMLqkR1tKLp5c=:3:11",
 "renewalDate":null,
 "term":“1周”,
 "termSku":"sub1-weekly",
 "testTransaction":true
}

purchaseDatecancelDate表示为以毫秒为单位的时间。可以调用java.util.Date(timeInMillis)将值转换为日期对象。cancelDatenull表示此收据的订阅仍有效。如果收据针对已过期的订阅,则cancelDate将反映订阅过期的日期,或亚马逊客户支持取消该订阅的日期。cancelReason指示了订阅被取消的原因(可能的值为null、0、1或2,其中每个整数分别代表一项取消原因)。gracePeriodEndDate为“null”表示此收据的订阅不在宽限期内。如果收据针对宽限期内的订阅,则gracePeriodEndDate将反映订阅宽限期的结束日期。

示例: 通过RVS生产服务器购买权利

以下请求将在生产服务器上验证订阅购买收据:

https://appstore-sdk.amazon.com/version/1.0/verifyReceiptId/developer/2:smXBjZkWCxDMSBvQ8HBGsUS1PK3jvVc8tuTjLNfPHfYAga6WaDzXJPoWpfemXaHg:iEzHzPjJ-XwRdZ4b4e7Hxw==/user/LRyD0FfW_3zeOlfJyxpVll-Z1rKn6dSf9xD3mUMSFg0=/receiptId/mINy5VRd1FqjVOz-WBtTqw9FBGWhnuVx07kzTBMR600=:2:11

此调用将收到以下示例JSON响应:

{
 "autoRenewing":false,
 "betaProduct":false,
 "cancelDate":null,
 "cancelReason":null,
 "freeTrialEndDate":null,
 "gracePeriodEndDate":null,
 "parentProductId":null,
 "productId":"com.amazon.iapsamplev2.gold_medal",
 "productType":"ENTITLED",
 "purchaseDate":1399070221749,
 "quantity":1,
 "receiptId":"mINy5VRd1FqjVOz-WBtTqw9FBGWhnuVx07kzTBMR600=:2:11",
 "renewalDate":null,
 "term":null,
 "termSku":null,
 "testTransaction":true
}

purchaseDatecancelDate表示为以毫秒为单位的时间。可以调用java.util.Date(timeInMillis)将值转换为日期对象。cancelDatenull表示购买尚未取消。如果收据针对已取消的购买,则cancelDate将反映亚马逊客户支持取消购买的日期。