开发者控制台

适用于亚马逊应用商店计费兼容性的RVS示例

适用于亚马逊应用商店计费兼容性的RVS示例

本页各部分包含适用于亚马逊RVS生产服务器的RVS示例。每个示例都含有JSON响应。这些示例使用的是正常工作的URL。如果在浏览器中粘贴请求,则会收到与示例相同的响应。

消费品示例

以下请求会使用purchases.products.get API在RVS生产服务器上验证消费品购买收据:

https://appstore-sdk.amazon.com/version/1.0/get/developer/2:smXBjZkWCxDMSBvQ8HBGsUS1PK3jvVc8tuTjLNfPHfYAga6WaDzXJPoWpfemXaHg:iEzHzPjJ-XwRdZ4b4e7Hxw==/applications/com.amazon.sample.iapv2/purchases/products/com.amazon.iapsamplev2.gold_medal/tokens/wE1EG1gsEZI9q9UnI5YoZ2OxeoVKPdR5bvPMqyKQq5Y=:1:11

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

{
    "cancelDate": null,
    "cancelReason": null,
    "kind": "androidpublisher#productPurchase",
    "parentProductId": null,
    "productId": "com.amazon.iapsamplev2.gold_medal",
    "productType": "CONSUMABLE",
    "purchaseState": 0,
    "purchaseTimeMillis": "1399070221749",
    "purchaseToken": "wE1EG1gsEZI9q9UnI5YoZ2OxeoVKPdR5bvPMqyKQq5Y=:1:11",
    "purchaseType": null,
    "quantity": 1,
    "testTransaction": false
}

权利示例

以下请求会使用purchases.products.get API在RVS生产服务器上验证权利购买收据:

https://appstore-sdk.amazon.com/version/1.0/get/developer/2:smXBjZkWCxDMSBvQ8HBGsUS1PK3jvVc8tuTjLNfPHfYAga6WaDzXJPoWpfemXaHg:iEzHzPjJ-XwRdZ4b4e7Hxw==/applications/com.amazon.sample.iapv2/purchases/products/com.amazon.iapsamplev2.expansion_set_1/tokens/mINy5VRd1FqjVOz-WBtTqw9FBGWhnuVx07kzTBMR600=:2:11

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

{
    "cancelDate": null,
    "cancelReason": null,
    "kind": "androidpublisher#productPurchase",
    "parentProductId": null,
    "productId": "com.amazon.iapsamplev2.expansion_set_1",
    "productType": "ENTITLED",
    "purchaseState": 0,
    "purchaseTimeMillis": "1399070753509",
    "purchaseToken": "mINy5VRd1FqjVOz-WBtTqw9FBGWhnuVx07kzTBMR600=:2:11",
    "purchaseType": null,
    "quantity": 1,
    "testTransaction": false
}

订阅示例

以下请求会使用purchases.subscriptionsv2.get API在RVS生产服务器上验证订阅购买收据:

https://appstore-sdk.amazon.com/version/1.0/developer/2:SPOkNr03vVx0_u04edvPTf5t6VC-HHS4535VkVviYJp7fCvSepKM5Ys-_ODYdtw8:Y-tOqaWFAXCHluaxssj9VQ==/applications/com.amazon.sample.iap/purchases/subscriptionsv2/tokens/JyGJ5iEtYgFu1ngnQovTqSIHQxR53GsMLqkR1tKLp5c=:3:11

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

{
    "cancelDate": 1400784371000,
    "canceledStateContext": {
        "developerInitiatedCancellation": null,
        "replacementCancellation": null,
        "systemInitiatedCancellation": {},
        "userInitiatedCancellation": null
    },
    "deferredDate": null,
    "freeTrialEndDate": null,
    "fulfillmentDate": null,
    "fulfillmentResult": null,
    "gracePeriodEndDate": null,
    "kind": "androidpublisher#subscriptionPurchaseV2",
    "lineItems": [
        {
            "autoRenewingPlan": {
                "autoRenewEnabled": true
            },
            "deferredItemReplacement": null,
            "expiryTime": "1400784371000",
            "offerDetails": {
                "basePlanId": "amzn1.appstore.iap.compatibility.baseplan.termsku.sub1-weekly",
                "offerId": "amzn1.appstore.iap.compatibility.offer.termsku.sub1-weekly"
            },
            "productId": "sub1"
        }
    ],
    "productType": "SUBSCRIPTION",
    "promotions": null,
    "purchaseTimeMillis": "1400784241000",
    "purchaseMetadataMap": null,
    "receiptId": "JyGJ5iEtYgFu1ngnQovTqSIHQxR53GsMLqkR1tKLp5c=:3:11",
    "renewalDate": null,
    "startTime": "Thu May 22 18:44:01 UTC 2014",
    "subscriptionState": "SUBSCRIPTION_STATE_EXPIRED",
    "term": "1 Week",
    "testPurchase": {},
    "testTransaction": true
}

Last updated: 2024年5月22日