RVS 示例


RVS 示例

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

示例: RVS 沙盒请求

以下请求在 RVS 沙盒中验证收据:

http://localhost:8080/RVSSandbox/version/1.0/verifyReceiptId/developer/developerSecret/user/99FD_DL23EMhrOGDnur9-ulvqomrSg6qyLPSD3CFE=/receiptId/q1YqVrJSSs7P1UvMTazKz9PLTCwoTswtyEktM9JLrShIzCvOzM-LL04tiTdW0lFKASo2NDEwMjCwMDM2MTC0AIqVAsUsLd1c4l18jIxdfTOK_N1d8kqLLHVLc8oK83OLgtPNCit9AoJdjJ3dXG2BGkqUrAxrAQ

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

{
    "betaProduct":false,
    "cancelDate":null,
    "parentProductId":null,
    "productId":"com.amazon.iapsamplev2.expansion_set_3",
    "productType":"ENTITLED",
    "purchaseDate":1402008634018,
    "quantity":1,
    "receiptId":"q1YqVrJSSs7P1UvMTazKz9PLTCwoTswtyEktM9JLrShIzCvOzM-LL04tiTdW0lFKASo2NDEwMjCwMDM2MTC0AIqVAsUsLd1c4l18jIxdfTOK_N1d8kqLLHVLc8oK83OLgtPNCit9AoJdjJ3dXG2BGkqUrAxrAQ",
    "renewalDate":null,
    "term":null,
    "termSku":null,
    "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 响应:

{
 "betaProduct":false,
 "cancelDate":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
{
    "betaProduct":true,
    "cancelDate":1400784371000,
    "parentProductId":null,
    "productId":"sub1",
    "productType":"SUBSCRIPTION",
    "purchaseDate":1400784241000,
    "quantity":null,
    "receiptId":"JyGJ5iEtYgFu1ngnQovTqSIHQxR53GsMLqkR1tKLp5c=:3:11",
    "renewalDate":null,
    "term":"1 Week",
    "termSku":"sub1-weekly",
    "testTransaction":true
}

purchaseDatecancelDate 表示为以毫秒为单位的时间。您可以调用 java.util.Date(timeInMillis) 来将值转换为日期对象。cancelDatenull 指示此收据的订阅仍有效。如果收据针对已过期的订阅,则 cancelDate 将反映订阅过期的日期,或亚马逊客户支持取消它的日期。

示例: 通过 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 响应:

{
    "betaProduct":false,
    "cancelDate":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 将反映亚马逊客户支持取消购买的日期。