isConsumable?: specify whether the product is a consumable
developerPayloadAndroid: developerPayload
| `Promise` | This method works for both platforms and is recommended since version 4.1.0 or later. Equal to `finishTransactionIOS` + `consumePurchaseAndroid` and `acknowledgePurchaseAndroid`.
_*deprecated_ ~~`buySubscription(sku: string, prevSku?: string, mode?: number)`~~
sku: subscription ID/sku
prevSku: old subscription ID/sku (optional)
mode: proration mode (optional)
| `Promise` | **Android only** Create (buy) a subscription to a sku. For upgrading/downgrading subscription on Android pass the second parameter with current subscription ID, on iOS this is handled automatically by store. You can also optionally pass in a proration mode integer for upgrading/downgrading subscriptions on Android
`validateReceiptAndroid(bundleId: string, productId: string, productToken: string, accessToken: string)`
developerSecret: from the Amazon developer console
userId: who purchased the item
receiptId: long obfuscated string returned when purchasing the item
useSandbox: Defaults to true, use sandbox environment or production.
| `Object\|boolean` | **Amazon only** Validate receipt.
_*deprecated_ ~~`setInstallSourceAndroid()`~~ | `void` | **Android only** It was used to select the Android Module (Amazon or Google Play) This is now handled by the variant selected when running the app. This method will be removed as there's no use for it anymore
\ No newline at end of file
diff --git a/src/iap.ts b/src/iap.ts
index cc35efe73..9c74d5380 100644
--- a/src/iap.ts
+++ b/src/iap.ts
@@ -1,4 +1,5 @@
import * as Android from './types/android';
+import * as Amazon from './types/amazon';
import * as Apple from './types/apple';
import {
@@ -696,7 +697,9 @@ export const validateReceiptIos = async (
};
/**
- * Validate receipt for Android.
+ * Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including
+ * your access token in the binary you ship to users is potentially dangerous.
+ * Use server side validation instead for your production builds
* @param {string} packageName package name of your app.
* @param {string} productId product id for your in app product.
* @param {string} productToken token for your purchase.
@@ -733,6 +736,40 @@ export const validateReceiptAndroid = async (
return response.json();
};
+/**
+ * Validate receipt for Amazon. NOTE: This method is here for debugging purposes only. Including
+ * your developer secret in the binary you ship to users is potentially dangerous.
+ * Use server side validation instead for your production builds
+ * @param {string} developerSecret: from the Amazon developer console.
+ * @param {string} userId who purchased the item.
+ * @param {string} receiptId long obfuscated string returned when purchasing the item
+ * @param {boolean} useSandbox Defaults to true, use sandbox environment or production.
+ * @returns {Promise