react-native-iap 10.0.7 → 10.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/android/src/amazon/java/com/dooboolab/RNIap/RNIapAmazonModule.kt +1 -2
- package/lib/commonjs/hooks/index.js +19 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useIAP.js +8 -4
- package/lib/commonjs/hooks/useIAP.js.map +1 -1
- package/lib/commonjs/iap.js +390 -51
- package/lib/commonjs/iap.js.map +1 -1
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/amazon.js +12 -0
- package/lib/commonjs/modules/amazon.js.map +1 -0
- package/lib/commonjs/modules/android.js +12 -0
- package/lib/commonjs/modules/android.js.map +1 -0
- package/lib/commonjs/modules/common.js +2 -0
- package/lib/commonjs/modules/common.js.map +1 -0
- package/lib/commonjs/modules/index.js +58 -0
- package/lib/commonjs/modules/index.js.map +1 -0
- package/lib/commonjs/modules/ios.js +6 -0
- package/lib/commonjs/modules/ios.js.map +1 -0
- package/lib/commonjs/types/amazon.js.map +1 -1
- package/lib/commonjs/types/apple.js +0 -163
- package/lib/commonjs/types/apple.js.map +1 -1
- package/lib/commonjs/types/index.js +11 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/hooks/index.js +2 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useIAP.js +6 -4
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/iap.js +391 -50
- package/lib/module/iap.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/amazon.js +3 -0
- package/lib/module/modules/amazon.js.map +1 -0
- package/lib/module/modules/android.js +3 -0
- package/lib/module/modules/android.js.map +1 -0
- package/lib/module/modules/common.js +2 -0
- package/lib/module/modules/common.js.map +1 -0
- package/lib/module/modules/index.js +5 -0
- package/lib/module/modules/index.js.map +1 -0
- package/lib/module/modules/ios.js +2 -0
- package/lib/module/modules/ios.js.map +1 -0
- package/lib/module/types/amazon.js.map +1 -1
- package/lib/module/types/apple.js +0 -151
- package/lib/module/types/apple.js.map +1 -1
- package/lib/module/types/index.js +9 -0
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/hooks/index.d.ts +1 -0
- package/lib/typescript/hooks/useIAP.d.ts +6 -3
- package/lib/typescript/iap.d.ts +356 -65
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/modules/amazon.d.ts +23 -0
- package/lib/typescript/modules/android.d.ts +24 -0
- package/lib/typescript/modules/common.d.ts +13 -0
- package/lib/typescript/modules/index.d.ts +4 -0
- package/lib/typescript/modules/ios.d.ts +32 -0
- package/lib/typescript/types/amazon.d.ts +8 -0
- package/lib/typescript/types/apple.d.ts +0 -399
- package/lib/typescript/types/index.d.ts +51 -1
- package/package.json +7 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useIAP.ts +11 -5
- package/src/iap.ts +420 -91
- package/src/index.ts +1 -0
- package/src/modules/amazon.ts +40 -0
- package/src/modules/android.ts +65 -0
- package/src/modules/common.ts +16 -0
- package/src/modules/index.ts +4 -0
- package/src/modules/ios.ts +57 -0
- package/src/types/amazon.ts +9 -0
- package/src/types/apple.ts +0 -438
- package/src/types/index.ts +71 -4
package/lib/commonjs/iap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RNIapIos","RNIapModule","RNIapAmazonModule","NativeModules","ANDROID_ITEM_TYPE_SUBSCRIPTION","ANDROID_ITEM_TYPE_IAP","getInstallSourceAndroid","InstallSourceAndroid","GOOGLE_PLAY","AMAZON","androidNativeModule","setAndroidNativeModule","nativeModule","checkNativeAndroidAvailable","Error","getAndroidModule","checkNativeIOSAvailable","getIosModule","getNativeModule","isAndroid","initConnection","endConnection","flushFailedPurchasesCachedAsPendingAndroid","flushFailedPurchasesCachedAsPending","getProducts","skus","Platform","select","ios","items","getItems","filter","item","includes","productId","type","android","products","getItemsByType","fillProductsWithAdditionalData","Promise","resolve","getSubscriptions","subscriptions","getPurchaseHistory","getAvailableItems","getPurchaseHistoryByType","concat","getAvailablePurchases","getAvailableItemsByType","requestPurchase","sku","andDangerouslyFinishTransactionAutomaticallyIOS","applicationUsername","obfuscatedAccountIdAndroid","obfuscatedProfileIdAndroid","isOfferPersonalized","console","warn","buyProduct","isAmazon","buyItemByType","length","requestSubscription","purchaseTokenAndroid","prorationModeAndroid","subscriptionOffers","undefined","reject","map","so","offerToken","requestPurchaseWithQuantityIOS","quantity","buyProductWithQuantityIOS","finishTransaction","purchase","isConsumable","developerPayloadAndroid","transactionId","consumeProduct","purchaseToken","userIdAmazon","isAcknowledgedAndroid","purchaseStateAndroid","PurchaseStateAndroid","PURCHASED","acknowledgePurchase","clearTransactionIOS","clearTransaction","clearProductsIOS","clearProducts","acknowledgePurchaseAndroid","token","developerPayload","deepLinkToSubscriptionsAndroid","Linking","openURL","getPackageName","getPromotedProductIOS","promotedProduct","buyPromotedProductIOS","buyPromotedProduct","requestAgnosticReceiptValidationIos","receiptBody","response","enhancedFetch","method","body","status","ReceiptValidationStatus","TEST_RECEIPT","testResponse","requestPurchaseWithOfferIOS","forUser","withOffer","buyProductWithOffer","validateReceiptIos","isTest","url","validateReceiptAndroid","packageName","productToken","accessToken","isSub","validateReceiptAmazon","developerSecret","userId","receiptId","useSandbox","sandBoxUrl","getPendingPurchasesIOS","getPendingTransactions","getReceiptIOS","forceRefresh","requestReceipt","presentCodeRedemptionSheetIOS","presentCodeRedemptionSheet"],"sources":["iap.ts"],"sourcesContent":["import {Linking, NativeModules, Platform} from 'react-native';\n\nimport type * as Amazon from './types/amazon';\nimport type * as Android from './types/android';\nimport type * as Apple from './types/apple';\nimport {ReceiptValidationStatus} from './types/apple';\nimport {\n enhancedFetch,\n fillProductsWithAdditionalData,\n isAmazon,\n isAndroid,\n} from './internal';\nimport type {\n Product,\n ProductPurchase,\n ProrationModesAndroid,\n PurchaseResult,\n Sku,\n Subscription,\n SubscriptionOffer,\n SubscriptionPurchase,\n} from './types';\nimport {InstallSourceAndroid, PurchaseStateAndroid} from './types';\n\nconst {RNIapIos, RNIapModule, RNIapAmazonModule} = NativeModules;\nconst ANDROID_ITEM_TYPE_SUBSCRIPTION = 'subs';\nconst ANDROID_ITEM_TYPE_IAP = 'inapp';\n\nexport const getInstallSourceAndroid = (): InstallSourceAndroid => {\n return RNIapModule\n ? InstallSourceAndroid.GOOGLE_PLAY\n : InstallSourceAndroid.AMAZON;\n};\n\nlet androidNativeModule = RNIapModule;\n\nexport const setAndroidNativeModule = (\n nativeModule: typeof RNIapModule,\n): void => {\n androidNativeModule = nativeModule;\n};\n\nconst checkNativeAndroidAvailable = (): void => {\n if (!RNIapModule && !RNIapAmazonModule) {\n throw new Error('IAP_NOT_AVAILABLE');\n }\n};\n\nexport const getAndroidModule = ():\n | typeof RNIapModule\n | typeof RNIapAmazonModule => {\n checkNativeAndroidAvailable();\n\n return androidNativeModule\n ? androidNativeModule\n : RNIapModule\n ? RNIapModule\n : RNIapAmazonModule;\n};\n\nconst checkNativeIOSAvailable = (): void => {\n if (!RNIapIos) {\n throw new Error('IAP_NOT_AVAILABLE');\n }\n};\n\nexport const getIosModule = (): typeof RNIapIos => {\n checkNativeIOSAvailable();\n\n return RNIapIos;\n};\n\nexport const getNativeModule = ():\n | typeof RNIapModule\n | typeof RNIapAmazonModule\n | typeof RNIapIos => {\n return isAndroid ? getAndroidModule() : getIosModule();\n};\n\n/**\n * Init module for purchase flow. Required on Android. In ios it will check whether user canMakePayment.\n * @returns {Promise<boolean>}\n */\nexport const initConnection = (): Promise<boolean> =>\n getNativeModule().initConnection();\n\n/**\n * End module for purchase flow.\n * @returns {Promise<void>}\n */\nexport const endConnection = (): Promise<void> =>\n getNativeModule().endConnection();\n\n/**\n * Consume all 'ghost' purchases (that is, pending payment that already failed but is still marked as pending in Play Store cache). Android only.\n * @returns {Promise<boolean>}\n */\nexport const flushFailedPurchasesCachedAsPendingAndroid = (): Promise<\n string[]\n> => getAndroidModule().flushFailedPurchasesCachedAsPending();\n\n/**\n * Get a list of products (consumable and non-consumable items, but not subscriptions)\n * @param {string[]} skus The item skus\n * @returns {Promise<Product[]>}\n */\nexport const getProducts = ({\n skus,\n}: {\n skus: string[];\n}): Promise<Array<Product>> =>\n (\n Platform.select({\n ios: async () => {\n const items = await getIosModule().getItems(skus);\n\n return items.filter(\n (item: Product) =>\n skus.includes(item.productId) && item.type === 'iap',\n );\n },\n android: async () => {\n const products = await getAndroidModule().getItemsByType(\n ANDROID_ITEM_TYPE_IAP,\n skus,\n );\n\n return fillProductsWithAdditionalData(products);\n },\n }) || Promise.resolve\n )();\n\n/**\n * Get a list of subscriptions\n * @param {string[]} skus The item skus\n * @returns {Promise<Subscription[]>}\n */\nexport const getSubscriptions = ({\n skus,\n}: {\n skus: string[];\n}): Promise<Subscription[]> =>\n (\n Platform.select({\n ios: async () => {\n const items = await getIosModule().getItems(skus);\n\n return items.filter(\n (item: Subscription) =>\n skus.includes(item.productId) && item.type === 'subs',\n );\n },\n android: async () => {\n const subscriptions = await getAndroidModule().getItemsByType(\n ANDROID_ITEM_TYPE_SUBSCRIPTION,\n skus,\n );\n\n return fillProductsWithAdditionalData(subscriptions);\n },\n }) || Promise.resolve\n )();\n\n/**\n * Gets an inventory of purchases made by the user regardless of consumption status\n * @returns {Promise<(ProductPurchase | SubscriptionPurchase)[]>}\n */\nexport const getPurchaseHistory = (): Promise<\n (ProductPurchase | SubscriptionPurchase)[]\n> =>\n (\n Platform.select({\n ios: async () => {\n return getIosModule().getAvailableItems();\n },\n android: async () => {\n if (RNIapAmazonModule) {\n return await RNIapAmazonModule.getAvailableItems();\n }\n\n const products = await getAndroidModule().getPurchaseHistoryByType(\n ANDROID_ITEM_TYPE_IAP,\n );\n\n const subscriptions = await getAndroidModule().getPurchaseHistoryByType(\n ANDROID_ITEM_TYPE_SUBSCRIPTION,\n );\n\n return products.concat(subscriptions);\n },\n }) || Promise.resolve\n )();\n\n/**\n * Get all purchases made by the user (either non-consumable, or haven't been consumed yet)\n * @returns {Promise<(ProductPurchase | SubscriptionPurchase)[]>}\n */\nexport const getAvailablePurchases = (): Promise<\n (ProductPurchase | SubscriptionPurchase)[]\n> =>\n (\n Platform.select({\n ios: async () => {\n return getIosModule().getAvailableItems();\n },\n android: async () => {\n if (RNIapAmazonModule) {\n return await RNIapAmazonModule.getAvailableItems();\n }\n\n const products = await getAndroidModule().getAvailableItemsByType(\n ANDROID_ITEM_TYPE_IAP,\n );\n\n const subscriptions = await getAndroidModule().getAvailableItemsByType(\n ANDROID_ITEM_TYPE_SUBSCRIPTION,\n );\n\n return products.concat(subscriptions);\n },\n }) || Promise.resolve\n )();\n\n/**\n * Request a purchase for product. This will be received in `PurchaseUpdatedListener`.\n * @param {string} sku The product's sku/ID\n * @param {string} [applicationUsername] The purchaser's user ID\n * @param {boolean} [andDangerouslyFinishTransactionAutomaticallyIOS] You should set this to false and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.\n * @param {string} [obfuscatedAccountIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's account in your app.\n * @param {string} [obfuscatedProfileIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app.\n * @param {string[]} [skus] Product Ids to purchase. Note that this is only for Android. iOS only uses a single SKU. If not provided, it'll default to using [sku] for backward-compatibility\n * @param {boolean} [isOfferPersonalized] Defaults to false, Only for Android V5\n * @returns {Promise<ProductPurchase>}\n */\n\nexport const requestPurchase = ({\n sku,\n andDangerouslyFinishTransactionAutomaticallyIOS = false,\n applicationUsername,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n skus,\n isOfferPersonalized,\n}: {\n sku?: Sku;\n andDangerouslyFinishTransactionAutomaticallyIOS?: boolean;\n applicationUsername?: string;\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n /** For Google Play Billing Library 5 https://developer.android.com/google/play/billing/integrate#personalized-price */\n skus?: Sku[];\n isOfferPersonalized?: boolean;\n}): Promise<ProductPurchase> =>\n (\n Platform.select({\n ios: async () => {\n if (andDangerouslyFinishTransactionAutomaticallyIOS) {\n console.warn(\n 'You are dangerously allowing react-native-iap to finish your transaction automatically. You should set andDangerouslyFinishTransactionAutomatically to false when calling requestPurchase and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.',\n );\n }\n\n return getIosModule().buyProduct(\n sku,\n andDangerouslyFinishTransactionAutomaticallyIOS,\n applicationUsername,\n );\n },\n android: async () => {\n if (isAmazon) {\n return RNIapAmazonModule.buyItemByType(sku);\n } else {\n return getAndroidModule().buyItemByType(\n ANDROID_ITEM_TYPE_IAP,\n skus?.length ? skus : [sku],\n null,\n -1,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n [],\n isOfferPersonalized ?? false,\n );\n }\n },\n }) || Promise.resolve\n )();\n\n/**\n * Request a purchase for product. This will be received in `PurchaseUpdatedListener`.\n * @param {string} [sku] The product's sku/ID\n * @param {string} [applicationUsername] The purchaser's user ID\n * @param {boolean} [andDangerouslyFinishTransactionAutomaticallyIOS] You should set this to false and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.\n * @param {string} [purchaseTokenAndroid] purchaseToken that the user is upgrading or downgrading from (Android).\n * @param {ProrationModesAndroid} [prorationModeAndroid] UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY, IMMEDIATE_WITH_TIME_PRORATION, IMMEDIATE_AND_CHARGE_PRORATED_PRICE, IMMEDIATE_WITHOUT_PRORATION, DEFERRED\n * @param {string} [obfuscatedAccountIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's account in your app.\n * @param {string} [obfuscatedProfileIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app.\n * @param {SubscriptionOffers[]} [subscriptionOffers] Array of SubscriptionOffers. Every sku must be paired with a corresponding offerToken\n * @returns {Promise<SubscriptionPurchase | null>} Promise resolves to null when using proratioModesAndroid=DEFERRED, and to a SubscriptionPurchase otherwise\n */\nexport const requestSubscription = ({\n sku,\n andDangerouslyFinishTransactionAutomaticallyIOS = false,\n applicationUsername,\n purchaseTokenAndroid,\n prorationModeAndroid = -1,\n subscriptionOffers,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n isOfferPersonalized = undefined,\n}: {\n sku?: Sku;\n andDangerouslyFinishTransactionAutomaticallyIOS?: boolean;\n applicationUsername?: string;\n purchaseTokenAndroid?: string;\n prorationModeAndroid?: ProrationModesAndroid;\n /** For Google Play Billing Library 5 */\n subscriptionOffers?: SubscriptionOffer[];\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n /** For Google Play Billing Library 5 https://developer.android.com/google/play/billing/integrate#personalized-price */\n isOfferPersonalized?: boolean;\n}): Promise<SubscriptionPurchase | null> =>\n (\n Platform.select({\n ios: async () => {\n if (andDangerouslyFinishTransactionAutomaticallyIOS) {\n console.warn(\n 'You are dangerously allowing react-native-iap to finish your transaction automatically. You should set andDangerouslyFinishTransactionAutomatically to false when calling requestPurchase and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.',\n );\n }\n\n return getIosModule().buyProduct(\n sku,\n andDangerouslyFinishTransactionAutomaticallyIOS,\n applicationUsername,\n );\n },\n android: async () => {\n if (isAmazon) {\n return RNIapAmazonModule.buyItemByType(sku);\n } else {\n if (!subscriptionOffers?.length) {\n return Promise.reject(\n 'subscriptionOffers are required for Google Play Subscriptions',\n );\n }\n return RNIapModule.buyItemByType(\n ANDROID_ITEM_TYPE_SUBSCRIPTION,\n subscriptionOffers?.map((so) => so.sku),\n purchaseTokenAndroid,\n prorationModeAndroid,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n subscriptionOffers?.map((so) => so.offerToken),\n isOfferPersonalized ?? false,\n );\n }\n },\n }) || Promise.resolve\n )();\n\n/**\n * Request a purchase for product. This will be received in `PurchaseUpdatedListener`.\n * @param {string} sku The product's sku/ID\n * @returns {Promise<void>}\n */\nexport const requestPurchaseWithQuantityIOS = ({\n sku,\n quantity,\n}: {\n sku: Sku;\n quantity: number;\n}): Promise<ProductPurchase> =>\n getIosModule().buyProductWithQuantityIOS(sku, quantity);\n\n/**\n * Finish Transaction (both platforms)\n * Abstracts Finish Transaction\n * iOS: Tells StoreKit that you have delivered the purchase to the user and StoreKit can now let go of the transaction.\n * Call this after you have persisted the purchased state to your server or local data in your app.\n * `react-native-iap` will continue to deliver the purchase updated events with the successful purchase until you finish the transaction. **Even after the app has relaunched.**\n * Android: it will consume purchase for consumables and acknowledge purchase for non-consumables.\n * @param {object} purchase The purchase that you would like to finish.\n * @param {boolean} isConsumable Checks if purchase is consumable. Has effect on `android`.\n * @param {string} developerPayloadAndroid Android developerPayload.\n * @returns {Promise<string | void> }\n */\nexport const finishTransaction = ({\n purchase,\n isConsumable,\n developerPayloadAndroid,\n}: {\n purchase: ProductPurchase | ProductPurchase;\n isConsumable?: boolean;\n developerPayloadAndroid?: string;\n}): Promise<string | void> => {\n return (\n Platform.select({\n ios: async () => {\n return getIosModule().finishTransaction(purchase.transactionId);\n },\n android: async () => {\n if (purchase) {\n if (isConsumable) {\n return getAndroidModule().consumeProduct(\n purchase.purchaseToken,\n developerPayloadAndroid,\n );\n } else if (\n purchase.userIdAmazon ||\n (!purchase.isAcknowledgedAndroid &&\n purchase.purchaseStateAndroid === PurchaseStateAndroid.PURCHASED)\n ) {\n return getAndroidModule().acknowledgePurchase(\n purchase.purchaseToken,\n developerPayloadAndroid,\n );\n } else {\n throw new Error('purchase is not suitable to be purchased');\n }\n } else {\n throw new Error('purchase is not assigned');\n }\n },\n }) || Promise.resolve\n )();\n};\n\n/**\n * Clear Transaction (iOS only)\n * Finish remaining transactions. Related to issue #257 and #801\n * link : https://github.com/dooboolab/react-native-iap/issues/257\n * https://github.com/dooboolab/react-native-iap/issues/801\n * @returns {Promise<void>}\n */\nexport const clearTransactionIOS = (): Promise<void> =>\n getIosModule().clearTransaction();\n\n/**\n * Clear valid Products (iOS only)\n * Remove all products which are validated by Apple server.\n * @returns {void}\n */\nexport const clearProductsIOS = (): Promise<void> =>\n getIosModule().clearProducts();\n\n/**\n * Acknowledge a product (on Android.) No-op on iOS.\n * @param {string} token The product's token (on Android)\n * @returns {Promise<PurchaseResult | void>}\n */\nexport const acknowledgePurchaseAndroid = ({\n token,\n developerPayload,\n}: {\n token: string;\n developerPayload?: string;\n}): Promise<PurchaseResult | void> => {\n return getAndroidModule().acknowledgePurchase(token, developerPayload);\n};\n\n/**\n * Deep link to subscriptions screen on Android. No-op on iOS.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAndroid = async ({\n sku,\n}: {\n sku: Sku;\n}): Promise<void> => {\n checkNativeAndroidAvailable();\n\n return Linking.openURL(\n `https://play.google.com/store/account/subscriptions?package=${await RNIapModule.getPackageName()}&sku=${sku}`,\n );\n};\n\n/**\n * Should Add Store Payment (iOS only)\n * Indicates the the App Store purchase should continue from the app instead of the App Store.\n * @returns {Promise<Product | null>} promoted product\n */\nexport const getPromotedProductIOS = (): Promise<Product | null> =>\n getIosModule().promotedProduct();\n\n/**\n * Buy the currently selected promoted product (iOS only)\n * Initiates the payment process for a promoted product. Should only be called in response to the `iap-promoted-product` event.\n * @returns {Promise<void>}\n */\nexport const buyPromotedProductIOS = (): Promise<void> =>\n getIosModule().buyPromotedProduct();\n\nconst requestAgnosticReceiptValidationIos = async (\n receiptBody: Record<string, unknown>,\n): Promise<Apple.ReceiptValidationResponse | false> => {\n const response = await enhancedFetch<Apple.ReceiptValidationResponse>(\n 'https://buy.itunes.apple.com/verifyReceipt',\n {\n method: 'POST',\n body: receiptBody,\n },\n );\n\n // Best practice is to check for test receipt and check sandbox instead\n // https://developer.apple.com/documentation/appstorereceipts/verifyreceipt\n if (response && response.status === ReceiptValidationStatus.TEST_RECEIPT) {\n const testResponse = await enhancedFetch<Apple.ReceiptValidationResponse>(\n 'https://sandbox.itunes.apple.com/verifyReceipt',\n {\n method: 'POST',\n body: receiptBody,\n },\n );\n\n return testResponse;\n }\n\n return response;\n};\n\n/**\n * Buy products or subscriptions with offers (iOS only)\n *\n * Runs the payment process with some info you must fetch\n * from your server.\n * @param {string} sku The product identifier\n * @param {string} forUser An user identifier on you system\n * @param {Apple.PaymentDiscount} withOffer The offer information\n * @param {string} withOffer.identifier The offer identifier\n * @param {string} withOffer.keyIdentifier Key identifier that it uses to generate the signature\n * @param {string} withOffer.nonce An UUID returned from the server\n * @param {string} withOffer.signature The actual signature returned from the server\n * @param {number} withOffer.timestamp The timestamp of the signature\n * @returns {Promise<void>}\n */\nexport const requestPurchaseWithOfferIOS = ({\n sku,\n forUser,\n withOffer,\n}: {\n sku: Sku;\n forUser: string;\n withOffer: Apple.PaymentDiscount;\n}): Promise<void> =>\n getIosModule().buyProductWithOffer(sku, forUser, withOffer);\n\n/**\n * Validate receipt for iOS.\n * @param {object} receiptBody the receipt body to send to apple server.\n * @param {boolean} isTest whether this is in test environment which is sandbox.\n * @returns {Promise<Apple.ReceiptValidationResponse | false>}\n */\nexport const validateReceiptIos = async ({\n receiptBody,\n isTest,\n}: {\n receiptBody: Record<string, unknown>;\n isTest?: boolean;\n}): Promise<Apple.ReceiptValidationResponse | false> => {\n if (isTest == null) {\n return await requestAgnosticReceiptValidationIos(receiptBody);\n }\n\n const url = isTest\n ? 'https://sandbox.itunes.apple.com/verifyReceipt'\n : 'https://buy.itunes.apple.com/verifyReceipt';\n\n return await enhancedFetch<Apple.ReceiptValidationResponse>(url);\n};\n\n/**\n * Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including\n * your access token in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} packageName package name of your app.\n * @param {string} productId product id for your in app product.\n * @param {string} productToken token for your purchase.\n * @param {string} accessToken accessToken from googleApis.\n * @param {boolean} isSub whether this is subscription or inapp. `true` for subscription.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAndroid = async ({\n packageName,\n productId,\n productToken,\n accessToken,\n isSub,\n}: {\n packageName: string;\n productId: string;\n productToken: string;\n accessToken: string;\n isSub?: boolean;\n}): Promise<Android.ReceiptType> => {\n const type = isSub ? 'subscriptions' : 'products';\n\n const url =\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications' +\n `/${packageName}/purchases/${type}/${productId}` +\n `/tokens/${productToken}?access_token=${accessToken}`;\n\n return await enhancedFetch<Android.ReceiptType>(url);\n};\n\n/**\n * Validate receipt for Amazon. NOTE: This method is here for debugging purposes only. Including\n * your developer secret in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} developerSecret: from the Amazon developer console.\n * @param {string} userId who purchased the item.\n * @param {string} receiptId long obfuscated string returned when purchasing the item\n * @param {boolean} useSandbox Defaults to true, use sandbox environment or production.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAmazon = async ({\n developerSecret,\n userId,\n receiptId,\n useSandbox = true,\n}: {\n developerSecret: string;\n userId: string;\n receiptId: string;\n useSandbox: boolean;\n}): Promise<Amazon.ReceiptType> => {\n const sandBoxUrl = useSandbox ? 'sandbox/' : '';\n const url = `https://appstore-sdk.amazon.com/${sandBoxUrl}version/1.0/verifyReceiptId/developer/${developerSecret}/user/${userId}/receiptId/${receiptId}`;\n\n return await enhancedFetch<Amazon.ReceiptType>(url);\n};\n\n/**\n * Get the current receipt base64 encoded in IOS.\n * @param {forceRefresh?:boolean}\n * @returns {Promise<ProductPurchase[]>}\n */\nexport const getPendingPurchasesIOS = async (): Promise<ProductPurchase[]> =>\n getIosModule().getPendingTransactions();\n\n/**\n * Get the current receipt base64 encoded in IOS.\n * @param {forceRefresh?:boolean}\n * @returns {Promise<string>}\n */\nexport const getReceiptIOS = async ({\n forceRefresh,\n}: {\n forceRefresh?: boolean;\n}): Promise<string> => getIosModule().requestReceipt(forceRefresh ?? false);\n\n/**\n * Launches a modal to register the redeem offer code in IOS.\n * @returns {Promise<null>}\n */\nexport const presentCodeRedemptionSheetIOS = async (): Promise<null> =>\n getIosModule().presentCodeRedemptionSheet();\n"],"mappings":";;;;;;;AAAA;;AAKA;;AACA;;AAgBA;;AAEA,MAAM;EAACA,QAAD;EAAWC,WAAX;EAAwBC;AAAxB,IAA6CC,0BAAnD;AACA,MAAMC,8BAA8B,GAAG,MAAvC;AACA,MAAMC,qBAAqB,GAAG,OAA9B;;AAEO,MAAMC,uBAAuB,GAAG,MAA4B;EACjE,OAAOL,WAAW,GACdM,2BAAA,CAAqBC,WADP,GAEdD,2BAAA,CAAqBE,MAFzB;AAGD,CAJM;;;AAMP,IAAIC,mBAAmB,GAAGT,WAA1B;;AAEO,MAAMU,sBAAsB,GACjCC,YADoC,IAE3B;EACTF,mBAAmB,GAAGE,YAAtB;AACD,CAJM;;;;AAMP,MAAMC,2BAA2B,GAAG,MAAY;EAC9C,IAAI,CAACZ,WAAD,IAAgB,CAACC,iBAArB,EAAwC;IACtC,MAAM,IAAIY,KAAJ,CAAU,mBAAV,CAAN;EACD;AACF,CAJD;;AAMO,MAAMC,gBAAgB,GAAG,MAEA;EAC9BF,2BAA2B;EAE3B,OAAOH,mBAAmB,GACtBA,mBADsB,GAEtBT,WAAW,GACXA,WADW,GAEXC,iBAJJ;AAKD,CAVM;;;;AAYP,MAAMc,uBAAuB,GAAG,MAAY;EAC1C,IAAI,CAAChB,QAAL,EAAe;IACb,MAAM,IAAIc,KAAJ,CAAU,mBAAV,CAAN;EACD;AACF,CAJD;;AAMO,MAAMG,YAAY,GAAG,MAAuB;EACjDD,uBAAuB;EAEvB,OAAOhB,QAAP;AACD,CAJM;;;;AAMA,MAAMkB,eAAe,GAAG,MAGR;EACrB,OAAOC,mBAAA,GAAYJ,gBAAgB,EAA5B,GAAiCE,YAAY,EAAp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M;AAiBP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMY,sBAAsB,GAAG,YACpClH,YAAY,GAAGmH,sBAAf,EADK;AAGP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,aAAa,GAAG;EAAA,IAAO;IAClCC;EADkC,CAAP;EAAA,OAINrH,YAAY,GAAGsH,cAAf,CAA8BD,YAAY,IAAI,KAA9C,CAJM;AAAA,CAAtB;AAMP;AACA;AACA;AACA;;;;;AACO,MAAME,6BAA6B,GAAG,YAC3CvH,YAAY,GAAGwH,0BAAf,EADK"}
|
|
1
|
+
{"version":3,"names":["RNIapIos","RNIapModule","RNIapAmazonModule","NativeModules","ANDROID_ITEM_TYPE_SUBSCRIPTION","ProductType","subs","ANDROID_ITEM_TYPE_IAP","inapp","getInstallSourceAndroid","InstallSourceAndroid","GOOGLE_PLAY","AMAZON","androidNativeModule","setAndroidNativeModule","nativeModule","checkNativeAndroidAvailable","Error","getAndroidModule","checkNativeIOSAvailable","getIosModule","getNativeModule","isAndroid","initConnection","endConnection","flushFailedPurchasesCachedAsPendingAndroid","flushFailedPurchasesCachedAsPending","getProducts","skus","Platform","select","ios","items","getItems","filter","item","includes","productId","type","android","products","getItemsByType","fillProductsWithAdditionalData","Promise","reject","getSubscriptions","subscriptions","getPurchaseHistory","getAvailableItems","getPurchaseHistoryByType","concat","resolve","getAvailablePurchases","getAvailableItemsByType","requestPurchase","sku","andDangerouslyFinishTransactionAutomaticallyIOS","applicationUsername","obfuscatedAccountIdAndroid","obfuscatedProfileIdAndroid","isOfferPersonalized","console","warn","buyProduct","isAmazon","buyItemByType","length","undefined","requestSubscription","purchaseTokenAndroid","prorationModeAndroid","subscriptionOffers","map","so","offerToken","requestPurchaseWithQuantityIOS","quantity","buyProductWithQuantityIOS","finishTransaction","purchase","isConsumable","developerPayloadAndroid","transactionId","purchaseToken","consumeProduct","userIdAmazon","isAcknowledgedAndroid","purchaseStateAndroid","PurchaseStateAndroid","PURCHASED","acknowledgePurchase","clearTransactionIOS","clearTransaction","clearProductsIOS","clearProducts","acknowledgePurchaseAndroid","token","developerPayload","deepLinkToSubscriptionsAndroid","Linking","openURL","getPackageName","getPromotedProductIOS","promotedProduct","buyPromotedProductIOS","buyPromotedProduct","TEST_RECEIPT","requestAgnosticReceiptValidationIos","receiptBody","response","enhancedFetch","method","body","status","testResponse","requestPurchaseWithOfferIOS","forUser","withOffer","buyProductWithOffer","validateReceiptIos","isTest","url","validateReceiptAndroid","packageName","productToken","accessToken","isSub","validateReceiptAmazon","developerSecret","userId","receiptId","useSandbox","sandBoxUrl","getPendingPurchasesIOS","getPendingTransactions","getReceiptIOS","forceRefresh","requestReceipt","presentCodeRedemptionSheetIOS","presentCodeRedemptionSheet"],"sources":["iap.ts"],"sourcesContent":["import {Linking, NativeModules, Platform} from 'react-native';\nimport type {ResponseBody as ReceiptValidationResponse} from '@jeremybarbet/apple-api-types';\n\nimport type * as Amazon from './types/amazon';\nimport type * as Android from './types/android';\nimport type * as Apple from './types/apple';\nimport {\n enhancedFetch,\n fillProductsWithAdditionalData,\n isAmazon,\n isAndroid,\n} from './internal';\nimport {\n Product,\n ProductPurchase,\n ProductType,\n Purchase,\n PurchaseResult,\n RequestPurchase,\n RequestSubscription,\n Sku,\n Subscription,\n SubscriptionPurchase,\n} from './types';\nimport {InstallSourceAndroid, PurchaseStateAndroid} from './types';\n\nconst {RNIapIos, RNIapModule, RNIapAmazonModule} = NativeModules;\nconst ANDROID_ITEM_TYPE_SUBSCRIPTION = ProductType.subs;\nconst ANDROID_ITEM_TYPE_IAP = ProductType.inapp;\n\nexport const getInstallSourceAndroid = (): InstallSourceAndroid => {\n return RNIapModule\n ? InstallSourceAndroid.GOOGLE_PLAY\n : InstallSourceAndroid.AMAZON;\n};\n\nlet androidNativeModule = RNIapModule;\n\nexport const setAndroidNativeModule = (\n nativeModule: typeof RNIapModule,\n): void => {\n androidNativeModule = nativeModule;\n};\n\nconst checkNativeAndroidAvailable = (): void => {\n if (!RNIapModule && !RNIapAmazonModule) {\n throw new Error('IAP_NOT_AVAILABLE');\n }\n};\n\nexport const getAndroidModule = ():\n | typeof RNIapModule\n | typeof RNIapAmazonModule => {\n checkNativeAndroidAvailable();\n\n return androidNativeModule\n ? androidNativeModule\n : RNIapModule\n ? RNIapModule\n : RNIapAmazonModule;\n};\n\nconst checkNativeIOSAvailable = (): void => {\n if (!RNIapIos) {\n throw new Error('IAP_NOT_AVAILABLE');\n }\n};\n\nexport const getIosModule = (): typeof RNIapIos => {\n checkNativeIOSAvailable();\n\n return RNIapIos;\n};\n\nexport const getNativeModule = ():\n | typeof RNIapModule\n | typeof RNIapAmazonModule\n | typeof RNIapIos => {\n return isAndroid ? getAndroidModule() : getIosModule();\n};\n\n/**\n * Init module for purchase flow. Required on Android. In ios it will check whether user canMakePayment.\n * ## Usage\n\n```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {initConnection} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n void initConnection();\n }, []);\n\n return <View />;\n};\n```\n */\nexport const initConnection = (): Promise<boolean> =>\n getNativeModule().initConnection();\n\n/**\n * Disconnects from native SDK\n * Usage\n * ```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {endConnection} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n return () => {\n void endConnection();\n };\n }, []);\n\n return <View />;\n};\n```\n * @returns {Promise<void>}\n */\nexport const endConnection = (): Promise<boolean> =>\n getNativeModule().endConnection();\n\n/**\n * Consume all 'ghost' purchases (that is, pending payment that already failed but is still marked as pending in Play Store cache). Android only.\n * @returns {Promise<boolean>}\n */\nexport const flushFailedPurchasesCachedAsPendingAndroid =\n (): Promise<boolean> =>\n getAndroidModule().flushFailedPurchasesCachedAsPending();\n\n/**\n * Get a list of products (consumable and non-consumable items, but not subscriptions)\n ## Usage\n\n```ts\nimport React, {useState} from 'react';\nimport {Platform} from 'react-native';\nimport {getProducts, Product} from 'react-native-iap';\n\nconst skus = Platform.select({\n ios: ['com.example.consumableIos'],\n android: ['com.example.consumableAndroid'],\n});\n\nconst App = () => {\n const [products, setProducts] = useState<Product[]>([]);\n\n const handleProducts = async () => {\n const items = await getProducts({skus});\n\n setProducts(items);\n };\n\n useEffect(() => {\n void handleProducts();\n }, []);\n\n return (\n <>\n {products.map((product) => (\n <Text key={product.productId}>{product.productId}</Text>\n ))}\n </>\n );\n};\n```\n\nJust a few things to keep in mind:\n\n- You can get your products in `componentDidMount`, `useEffect` or another appropriate area of your app.\n- Since a user may start your app with a bad or no internet connection, preparing/getting the items more than once may be a good idea.\n- If the user has no IAPs available when the app starts first, you may want to check again when the user enters your IAP store.\n\n */\nexport const getProducts = ({\n skus,\n}: {\n skus: string[];\n}): Promise<Array<Product>> =>\n (\n Platform.select({\n ios: async () => {\n const items = (await getIosModule().getItems(skus)) as Product[];\n\n return items.filter(\n (item: Product) =>\n skus.includes(item.productId) && item.type === 'iap',\n );\n },\n android: async () => {\n const products = await getAndroidModule().getItemsByType(\n ANDROID_ITEM_TYPE_IAP,\n skus,\n );\n\n return fillProductsWithAdditionalData(products);\n },\n }) || (() => Promise.reject(new Error('Unsupported Platform')))\n )();\n\n/**\n * Get a list of subscriptions\n * ## Usage\n\n```tsx\nimport React, {useCallback} from 'react';\nimport {View} from 'react-native';\nimport {getSubscriptions} from 'react-native-iap';\n\nconst App = () => {\n const subscriptions = useCallback(\n async () =>\n await getSubscriptions(['com.example.product1', 'com.example.product2']),\n [],\n );\n\n return <View />;\n};\n```\n\n */\nexport const getSubscriptions = ({\n skus,\n}: {\n skus: string[];\n}): Promise<Subscription[]> =>\n (\n Platform.select({\n ios: async () => {\n const items = (await getIosModule().getItems(skus)) as Subscription[];\n\n return items.filter(\n (item: Subscription) =>\n skus.includes(item.productId) && item.type === 'subs',\n );\n },\n android: async () => {\n const subscriptions = (await getAndroidModule().getItemsByType(\n ANDROID_ITEM_TYPE_SUBSCRIPTION,\n skus,\n )) as Subscription[];\n\n return fillProductsWithAdditionalData(subscriptions);\n },\n }) || (() => Promise.reject(new Error('Unsupported Platform')))\n )();\n\n/**\n * Gets an inventory of purchases made by the user regardless of consumption status\n * ## Usage\n\n```tsx\nimport React, {useCallback} from 'react';\nimport {View} from 'react-native';\nimport {getPurchaseHistory} from 'react-native-iap';\n\nconst App = () => {\n const history = useCallback(\n async () =>\n await getPurchaseHistory([\n 'com.example.product1',\n 'com.example.product2',\n ]),\n [],\n );\n\n return <View />;\n};\n```\n */\nexport const getPurchaseHistory = (): Promise<\n (ProductPurchase | SubscriptionPurchase)[]\n> =>\n (\n Platform.select({\n ios: async () => {\n return getIosModule().getAvailableItems();\n },\n android: async () => {\n if (RNIapAmazonModule) {\n return await RNIapAmazonModule.getAvailableItems();\n }\n\n const products = await RNIapModule.getPurchaseHistoryByType(\n ANDROID_ITEM_TYPE_IAP,\n );\n\n const subscriptions = await RNIapModule.getPurchaseHistoryByType(\n ANDROID_ITEM_TYPE_SUBSCRIPTION,\n );\n\n return products.concat(subscriptions);\n },\n }) || (() => Promise.resolve([]))\n )();\n\n/**\n * Get all purchases made by the user (either non-consumable, or haven't been consumed yet)\n * ## Usage\n\n```tsx\nimport React, {useCallback} from 'react';\nimport {View} from 'react-native';\nimport {getAvailablePurchases} from 'react-native-iap';\n\nconst App = () => {\n const availablePurchases = useCallback(\n async () => await getAvailablePurchases(),\n [],\n );\n\n return <View />;\n};\n```\n\n## Restoring purchases\n\nYou can use `getAvailablePurchases()` to do what's commonly understood as \"restoring\" purchases.\n\n:::note\nFor debugging you may want to consume all items, you have then to iterate over the purchases returned by `getAvailablePurchases()`.\n:::\n\n:::warning\nBeware that if you consume an item without having recorded the purchase in your database the user may have paid for something without getting it delivered and you will have no way to recover the receipt to validate and restore their purchase.\n:::\n\n```tsx\nimport React from 'react';\nimport {Button} from 'react-native';\nimport {getAvailablePurchases,finishTransaction} from 'react-native-iap';\n\nconst App = () => {\n handleRestore = async () => {\n try {\n const purchases = await getAvailablePurchases();\n const newState = {premium: false, ads: true};\n let titles = [];\n\n await Promise.all(purchases.map(async purchase => {\n switch (purchase.productId) {\n case 'com.example.premium':\n newState.premium = true;\n titles.push('Premium Version');\n break;\n\n case 'com.example.no_ads':\n newState.ads = false;\n titles.push('No Ads');\n break;\n\n case 'com.example.coins100':\n await finishTransaction(purchase.purchaseToken);\n CoinStore.addCoins(100);\n }\n })\n\n Alert.alert(\n 'Restore Successful',\n `You successfully restored the following purchases: ${titles.join(', ')}`,\n );\n } catch (error) {\n console.warn(error);\n Alert.alert(error.message);\n }\n };\n\n return (\n <Button title=\"Restore purchases\" onPress={handleRestore} />\n )\n};\n```\n * \n */\nexport const getAvailablePurchases = (): Promise<\n (ProductPurchase | SubscriptionPurchase)[]\n> =>\n (\n Platform.select({\n ios: async () => {\n return getIosModule().getAvailableItems();\n },\n android: async () => {\n if (RNIapAmazonModule) {\n return await RNIapAmazonModule.getAvailableItems();\n }\n\n const products = await RNIapModule.getAvailableItemsByType(\n ANDROID_ITEM_TYPE_IAP,\n );\n\n const subscriptions = await RNIapModule.getAvailableItemsByType(\n ANDROID_ITEM_TYPE_SUBSCRIPTION,\n );\n\n return products.concat(subscriptions);\n },\n }) || (() => Promise.resolve([]))\n )();\n\n/**\n * Request a purchase for product. This will be received in `PurchaseUpdatedListener`.\n * Request a purchase for a product (consumables or non-consumables).\n\nThe response will be received through the `PurchaseUpdatedListener`.\n\n:::note\n`andDangerouslyFinishTransactionAutomatically` defaults to false. We recommend\nalways keeping at false, and verifying the transaction receipts on the server-side.\n:::\n\n## Signature\n\n```ts\nrequestPurchase(\n The product's sku/ID \n sku,\n\n \n * You should set this to false and call finishTransaction manually when you have delivered the purchased goods to the user.\n * @default false\n \n andDangerouslyFinishTransactionAutomaticallyIOS = false,\n\n /** Specifies an optional obfuscated string that is uniquely associated with the user's account in your app. \n obfuscatedAccountIdAndroid,\n\n Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app. \n obfuscatedProfileIdAndroid,\n\n The purchaser's user ID \n applicationUsername,\n): Promise<ProductPurchase>;\n```\n\n## Usage\n\n```tsx\nimport React, {useCallback} from 'react';\nimport {Button} from 'react-native';\nimport {requestPurchase, Product, Sku, getProducts} from 'react-native-iap';\n\nconst App = () => {\n const products = useCallback(\n async () => getProducts(['com.example.product']),\n [],\n );\n\n const handlePurchase = async (sku: Sku) => {\n await requestPurchase({sku});\n };\n\n return (\n <>\n {products.map((product) => (\n <Button\n key={product.productId}\n title=\"Buy product\"\n onPress={() => handlePurchase(product.productId)}\n />\n ))}\n </>\n );\n};\n```\n\n */\n\nexport const requestPurchase = ({\n sku,\n andDangerouslyFinishTransactionAutomaticallyIOS = false,\n applicationUsername,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n skus,\n isOfferPersonalized,\n}: RequestPurchase): Promise<ProductPurchase | void> =>\n (\n Platform.select({\n ios: async () => {\n if (!sku) {\n return Promise.reject(new Error('sku is required for iOS purchase'));\n }\n if (andDangerouslyFinishTransactionAutomaticallyIOS) {\n console.warn(\n 'You are dangerously allowing react-native-iap to finish your transaction automatically. You should set andDangerouslyFinishTransactionAutomatically to false when calling requestPurchase and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.',\n );\n }\n\n return getIosModule().buyProduct(\n sku,\n andDangerouslyFinishTransactionAutomaticallyIOS,\n applicationUsername,\n );\n },\n android: async () => {\n if (isAmazon) {\n if (!sku) {\n return Promise.reject(\n new Error('sku is required for Amazon purchase'),\n );\n }\n return RNIapAmazonModule.buyItemByType(sku);\n } else {\n if (!sku?.length && !sku) {\n return Promise.reject(\n new Error('skus is required for Android purchase'),\n );\n }\n return getAndroidModule().buyItemByType(\n ANDROID_ITEM_TYPE_IAP,\n skus?.length ? skus : [sku],\n undefined,\n -1,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n [],\n isOfferPersonalized ?? false,\n );\n }\n },\n }) || Promise.resolve\n )();\n\n/**\n * Request a purchase for product. This will be received in `PurchaseUpdatedListener`.\n * Request a purchase for a subscription.\n\nThe response will be received through the `PurchaseUpdatedListener`.\n\n:::note\n`andDangerouslyFinishTransactionAutomatically` defaults to false. We recommend\nalways keeping at false, and verifying the transaction receipts on the server-side.\n:::\n\n## Signature\n\n```ts\nrequestSubscription(\n The product's sku/ID \n sku,\n\n\n * You should set this to false and call finishTransaction manually when you have delivered the purchased goods to the user.\n * @default false\n\n andDangerouslyFinishTransactionAutomaticallyIOS = false,\n\n purchaseToken that the user is upgrading or downgrading from (Android). \n purchaseTokenAndroid,\n\n UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY, IMMEDIATE_WITH_TIME_PRORATION, IMMEDIATE_AND_CHARGE_PRORATED_PRICE, IMMEDIATE_WITHOUT_PRORATION, DEFERRED \n prorationModeAndroid = -1,\n\n /** Specifies an optional obfuscated string that is uniquely associated with the user's account in your app. \n obfuscatedAccountIdAndroid,\n\n Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app. \n obfuscatedProfileIdAndroid,\n\n The purchaser's user ID \n applicationUsername,\n): Promise<SubscriptionPurchase>\n```\n\n## Usage\n\n```tsx\nimport React, {useCallback} from 'react';\nimport {Button} from 'react-native';\nimport {\n requestSubscription,\n Product,\n Sku,\n getSubscriptions,\n} from 'react-native-iap';\n\nconst App = () => {\n const subscriptions = useCallback(\n async () => getSubscriptions(['com.example.subscription']),\n [],\n );\n\n const handlePurchase = async (sku: Sku) => {\n await requestSubscription({sku});\n };\n\n return (\n <>\n {subscriptions.map((subscription) => (\n <Button\n key={subscription.productId}\n title=\"Buy subscription\"\n onPress={() => handlePurchase(subscription.productId)}\n />\n ))}\n </>\n );\n};\n```\n */\nexport const requestSubscription = ({\n sku,\n andDangerouslyFinishTransactionAutomaticallyIOS = false,\n applicationUsername,\n purchaseTokenAndroid,\n prorationModeAndroid = -1,\n subscriptionOffers,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n isOfferPersonalized = undefined,\n}: RequestSubscription): Promise<SubscriptionPurchase | null | void> =>\n (\n Platform.select({\n ios: async () => {\n if (!sku) {\n return Promise.reject(\n new Error('sku is required for iOS subscription'),\n );\n }\n if (andDangerouslyFinishTransactionAutomaticallyIOS) {\n console.warn(\n 'You are dangerously allowing react-native-iap to finish your transaction automatically. You should set andDangerouslyFinishTransactionAutomatically to false when calling requestPurchase and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.',\n );\n }\n\n return getIosModule().buyProduct(\n sku,\n andDangerouslyFinishTransactionAutomaticallyIOS,\n applicationUsername,\n );\n },\n android: async () => {\n if (isAmazon) {\n if (!sku) {\n return Promise.reject(\n new Error('sku is required for Amazon purchase'),\n );\n }\n return RNIapAmazonModule.buyItemByType(sku);\n } else {\n if (!subscriptionOffers?.length) {\n return Promise.reject(\n 'subscriptionOffers are required for Google Play Subscriptions',\n );\n }\n return RNIapModule.buyItemByType(\n ANDROID_ITEM_TYPE_SUBSCRIPTION,\n subscriptionOffers?.map((so) => so.sku),\n purchaseTokenAndroid,\n prorationModeAndroid,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n subscriptionOffers?.map((so) => so.offerToken),\n isOfferPersonalized ?? false,\n );\n }\n },\n }) || (() => Promise.resolve(null))\n )();\n\n/**\n * Request a purchase for product. This will be received in `PurchaseUpdatedListener`.\n * @param {string} sku The product's sku/ID\n * @returns {Promise<void>}\n */\nexport const requestPurchaseWithQuantityIOS = ({\n sku,\n quantity,\n}: {\n sku: Sku;\n quantity: number;\n}): Promise<ProductPurchase> =>\n getIosModule().buyProductWithQuantityIOS(sku, quantity);\n\n/**\n * Finish Transaction (both platforms)\n * Abstracts Finish Transaction\n * iOS: Tells StoreKit that you have delivered the purchase to the user and StoreKit can now let go of the transaction.\n * Call this after you have persisted the purchased state to your server or local data in your app.\n * `react-native-iap` will continue to deliver the purchase updated events with the successful purchase until you finish the transaction. **Even after the app has relaunched.**\n * Android: it will consume purchase for consumables and acknowledge purchase for non-consumables.\n * \n```tsx\nimport React from 'react';\nimport {Button} from 'react-native';\nimport {finishTransaction} from 'react-native-iap';\n\nconst App = () => {\n const handlePurchase = async () => {\n // ... handle the purchase request\n\n const result = finishTransaction(purchase);\n };\n\n return <Button title=\"Buy product\" onPress={handlePurchase} />;\n};\n``` \n */\nexport const finishTransaction = ({\n purchase,\n isConsumable,\n developerPayloadAndroid,\n}: {\n purchase: ProductPurchase | ProductPurchase;\n isConsumable?: boolean;\n developerPayloadAndroid?: string;\n}): Promise<PurchaseResult | boolean> => {\n return (\n Platform.select({\n ios: async () => {\n const transactionId = purchase.transactionId;\n\n if (!transactionId) {\n return Promise.reject(\n new Error('transactionId required to finish iOS transaction'),\n );\n }\n return getIosModule().finishTransaction(transactionId);\n },\n android: async () => {\n if (purchase?.purchaseToken) {\n if (isConsumable) {\n return getAndroidModule().consumeProduct(\n purchase.purchaseToken,\n developerPayloadAndroid,\n );\n } else if (\n purchase.userIdAmazon ||\n (!purchase.isAcknowledgedAndroid &&\n purchase.purchaseStateAndroid === PurchaseStateAndroid.PURCHASED)\n ) {\n return getAndroidModule().acknowledgePurchase(\n purchase.purchaseToken,\n developerPayloadAndroid,\n );\n } else {\n return Promise.reject(\n new Error('purchase is not suitable to be purchased'),\n );\n }\n }\n return Promise.reject(\n new Error('purchase is not suitable to be purchased'),\n );\n },\n }) || (() => Promise.reject(new Error('Unsupported Platform')))\n )();\n};\n\n/**\n * Clear Transaction (iOS only)\n * Finish remaining transactions. Related to issue #257 and #801\n * link : https://github.com/dooboolab/react-native-iap/issues/257\n * https://github.com/dooboolab/react-native-iap/issues/801\n * @returns {Promise<void>}\n */\nexport const clearTransactionIOS = (): Promise<void> =>\n getIosModule().clearTransaction();\n\n/**\n * Clear valid Products (iOS only)\n * Remove all products which are validated by Apple server.\n * @returns {void}\n */\nexport const clearProductsIOS = (): Promise<void> =>\n getIosModule().clearProducts();\n\n/**\n * Acknowledge a product (on Android.) No-op on iOS.\n * @param {string} token The product's token (on Android)\n * @returns {Promise<PurchaseResult | void>}\n */\nexport const acknowledgePurchaseAndroid = ({\n token,\n developerPayload,\n}: {\n token: string;\n developerPayload?: string;\n}): Promise<PurchaseResult | boolean | void> => {\n return getAndroidModule().acknowledgePurchase(token, developerPayload);\n};\n\n/**\n * Deep link to subscriptions screen on Android. No-op on iOS.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAndroid = async ({\n sku,\n}: {\n sku: Sku;\n}): Promise<void> => {\n checkNativeAndroidAvailable();\n\n return Linking.openURL(\n `https://play.google.com/store/account/subscriptions?package=${await RNIapModule.getPackageName()}&sku=${sku}`,\n );\n};\n\n/**\n * Should Add Store Payment (iOS only)\n * Indicates the the App Store purchase should continue from the app instead of the App Store.\n * @returns {Promise<Product | null>} promoted product\n */\nexport const getPromotedProductIOS = (): Promise<Product | null> =>\n getIosModule().promotedProduct();\n\n/**\n * Buy the currently selected promoted product (iOS only)\n * Initiates the payment process for a promoted product. Should only be called in response to the `iap-promoted-product` event.\n * @returns {Promise<void>}\n */\nexport const buyPromotedProductIOS = (): Promise<void> =>\n getIosModule().buyPromotedProduct();\n\nconst TEST_RECEIPT = 21007;\nconst requestAgnosticReceiptValidationIos = async (\n receiptBody: Record<string, unknown>,\n): Promise<ReceiptValidationResponse | false> => {\n const response = await enhancedFetch<ReceiptValidationResponse>(\n 'https://buy.itunes.apple.com/verifyReceipt',\n {\n method: 'POST',\n body: receiptBody,\n },\n );\n\n // Best practice is to check for test receipt and check sandbox instead\n // https://developer.apple.com/documentation/appstorereceipts/verifyreceipt\n if (response && response.status === TEST_RECEIPT) {\n const testResponse = await enhancedFetch<ReceiptValidationResponse>(\n 'https://sandbox.itunes.apple.com/verifyReceipt',\n {\n method: 'POST',\n body: receiptBody,\n },\n );\n\n return testResponse;\n }\n\n return response;\n};\n\n/**\n * Buy products or subscriptions with offers (iOS only)\n *\n * Runs the payment process with some info you must fetch\n * from your server.\n * @param {string} sku The product identifier\n * @param {string} forUser An user identifier on you system\n * @param {Apple.PaymentDiscount} withOffer The offer information\n * @param {string} withOffer.identifier The offer identifier\n * @param {string} withOffer.keyIdentifier Key identifier that it uses to generate the signature\n * @param {string} withOffer.nonce An UUID returned from the server\n * @param {string} withOffer.signature The actual signature returned from the server\n * @param {number} withOffer.timestamp The timestamp of the signature\n * @returns {Promise<void>}\n */\nexport const requestPurchaseWithOfferIOS = ({\n sku,\n forUser,\n withOffer,\n}: {\n sku: Sku;\n forUser: string;\n withOffer: Apple.PaymentDiscount;\n}): Promise<Purchase> =>\n getIosModule().buyProductWithOffer(sku, forUser, withOffer);\n\n/**\n * Validate receipt for iOS.\n * @param {object} receiptBody the receipt body to send to apple server.\n * @param {boolean} isTest whether this is in test environment which is sandbox.\n * @returns {Promise<Apple.ReceiptValidationResponse | false>}\n */\nexport const validateReceiptIos = async ({\n receiptBody,\n isTest,\n}: {\n receiptBody: Record<string, unknown>;\n isTest?: boolean;\n}): Promise<ReceiptValidationResponse | false> => {\n if (isTest == null) {\n return await requestAgnosticReceiptValidationIos(receiptBody);\n }\n\n const url = isTest\n ? 'https://sandbox.itunes.apple.com/verifyReceipt'\n : 'https://buy.itunes.apple.com/verifyReceipt';\n\n return await enhancedFetch<ReceiptValidationResponse>(url, {\n method: 'POST',\n body: receiptBody,\n });\n};\n\n/**\n * Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including\n * your access token in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} packageName package name of your app.\n * @param {string} productId product id for your in app product.\n * @param {string} productToken token for your purchase.\n * @param {string} accessToken accessToken from googleApis.\n * @param {boolean} isSub whether this is subscription or inapp. `true` for subscription.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAndroid = async ({\n packageName,\n productId,\n productToken,\n accessToken,\n isSub,\n}: {\n packageName: string;\n productId: string;\n productToken: string;\n accessToken: string;\n isSub?: boolean;\n}): Promise<Android.ReceiptType> => {\n const type = isSub ? 'subscriptions' : 'products';\n\n const url =\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications' +\n `/${packageName}/purchases/${type}/${productId}` +\n `/tokens/${productToken}?access_token=${accessToken}`;\n\n return await enhancedFetch<Android.ReceiptType>(url);\n};\n\n/**\n * Validate receipt for Amazon. NOTE: This method is here for debugging purposes only. Including\n * your developer secret in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} developerSecret: from the Amazon developer console.\n * @param {string} userId who purchased the item.\n * @param {string} receiptId long obfuscated string returned when purchasing the item\n * @param {boolean} useSandbox Defaults to true, use sandbox environment or production.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAmazon = async ({\n developerSecret,\n userId,\n receiptId,\n useSandbox = true,\n}: {\n developerSecret: string;\n userId: string;\n receiptId: string;\n useSandbox: boolean;\n}): Promise<Amazon.ReceiptType> => {\n const sandBoxUrl = useSandbox ? 'sandbox/' : '';\n const url = `https://appstore-sdk.amazon.com/${sandBoxUrl}version/1.0/verifyReceiptId/developer/${developerSecret}/user/${userId}/receiptId/${receiptId}`;\n\n return await enhancedFetch<Amazon.ReceiptType>(url);\n};\n\n/**\n * Get the current receipt base64 encoded in IOS.\n * @param {forceRefresh?:boolean}\n * @returns {Promise<ProductPurchase[]>}\n */\nexport const getPendingPurchasesIOS = async (): Promise<ProductPurchase[]> =>\n getIosModule().getPendingTransactions();\n\n/**\n * Get the current receipt base64 encoded in IOS.\n * @param {forceRefresh?:boolean}\n * @returns {Promise<string>}\n */\nexport const getReceiptIOS = async ({\n forceRefresh,\n}: {\n forceRefresh?: boolean;\n}): Promise<string> => getIosModule().requestReceipt(forceRefresh ?? false);\n\n/**\n * Launches a modal to register the redeem offer code in IOS.\n * @returns {Promise<null>}\n */\nexport const presentCodeRedemptionSheetIOS = async (): Promise<null> =>\n getIosModule().presentCodeRedemptionSheet();\n"],"mappings":";;;;;;;AAAA;;AAMA;;AAMA;;AAcA,MAAM;EAACA,QAAD;EAAWC,WAAX;EAAwBC;AAAxB,IA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,qBAAqB,GAAG,MAGnC,CACEvB,qBAAA,CAASC,MAAT,CAAgB;EACdC,GAAG,EAAE,YAAY;IACf,OAAOX,YAAY,GAAG4B,iBAAf,EAAP;EACD,CAHa;EAIdT,OAAO,EAAE,YAAY;IACnB,IAAIrC,iBAAJ,EAAuB;MACrB,OAAO,MAAMA,iBAAiB,CAAC8C,iBAAlB,EAAb;IACD;;IAED,MAAMR,QAAQ,GAAG,MAAMvC,WAAW,CAACoD,uBAAZ,CACrB9C,qBADqB,CAAvB;IAIA,MAAMuC,aAAa,GAAG,MAAM7C,WAAW,CAACoD,uBAAZ,CAC1BjD,8BAD0B,CAA5B;IAIA,OAAOoC,QAAQ,CAACU,MAAT,CAAgBJ,aAAhB,CAAP;EACD;AAlBa,CAAhB,MAmBO,MAAMH,OAAO,CAACQ,OAAR,CAAgB,EAAhB,CAnBb,CADF,GAHK;AA0BP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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Ca,CAAhB,KA2CMjB,OAAO,CAACQ,OA5ChB,GAT6B;AAAA,CAAxB;AAwDP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMiB,mBAAmB,GAAG;EAAA,IAAC;IAClCb,GADkC;IAElCC,+CAA+C,GAAG,KAFhB;IAGlCC,mBAHkC;IAIlCY,oBAJkC;IAKlCC,oBAAoB,GAAG,CAAC,CALU;IAMlCC,kBANkC;IAOlCb,0BAPkC;IAQlCC,0BARkC;IASlCC,mBAAmB,GAAGO;EATY,CAAD;EAAA,OAWjC,CACEtC,qBAAA,CAASC,MAAT,CAAgB;IACdC,GAAG,EAAE,YAAY;MACf,IAAI,CAACwB,GAAL,EAAU;QACR,OAAOZ,OAAO,CAACC,MAAR,CACL,IAAI3B,KAAJ,CAAU,sCAAV,CADK,CAAP;MAGD;;MACD,IAAIuC,+CAAJ,EAAqD;QACnDK,OAAO,CAACC,IAAR,CACE,wXADF;MAGD;;MAED,OAAO1C,YAAY,GAAG2C,UAAf,CACLR,GADK,EAELC,+CAFK,EAGLC,mBAHK,CAAP;IAKD,CAlBa;IAmBdlB,OAAO,EAAE,YAAY;MACnB,IAAIyB,kBAAJ,EAAc;QACZ,IAAI,CAACT,GAAL,EAAU;UACR,OAAOZ,OAAO,CAACC,MAAR,CACL,IAAI3B,KAAJ,CAAU,qCAAV,CADK,CAAP;QAGD;;QACD,OAAOf,iBAAiB,CAAC+D,aAAlB,CAAgC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O,MAAMY,sBAAsB,GAAG,YACpCjH,YAAY,GAAGkH,sBAAf,EADK;AAGP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,aAAa,GAAG;EAAA,IAAO;IAClCC;EADkC,CAAP;EAAA,OAINpH,YAAY,GAAGqH,cAAf,CAA8BD,YAAY,IAAI,KAA9C,CAJM;AAAA,CAAtB;AAMP;AACA;AACA;AACA;;;;;AACO,MAAME,6BAA6B,GAAG,YAC3CtH,YAAY,GAAGuH,0BAAf,EADK"}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -81,4 +81,17 @@ Object.keys(_purchaseError).forEach(function (key) {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
+
|
|
85
|
+
var _modules = require("./modules");
|
|
86
|
+
|
|
87
|
+
Object.keys(_modules).forEach(function (key) {
|
|
88
|
+
if (key === "default" || key === "__esModule") return;
|
|
89
|
+
if (key in exports && exports[key] === _modules[key]) return;
|
|
90
|
+
Object.defineProperty(exports, key, {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _modules[key];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
84
97
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './iap';\nexport * from './types';\nexport * from './eventEmitter';\nexport * from './hooks/useIAP';\nexport * from './hooks/withIAPContext';\nexport * from './purchaseError';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './iap';\nexport * from './types';\nexport * from './eventEmitter';\nexport * from './hooks/useIAP';\nexport * from './hooks/withIAPContext';\nexport * from './purchaseError';\nexport * from './modules';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AmazonModule = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
const AmazonModule = _reactNative.NativeModules.RNIapAmazonModule;
|
|
11
|
+
exports.AmazonModule = AmazonModule;
|
|
12
|
+
//# sourceMappingURL=amazon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AmazonModule","NativeModules","RNIapAmazonModule"],"sources":["amazon.ts"],"sourcesContent":["import {NativeModules} from 'react-native';\n\nimport type {Product, Purchase, Sku} from '../types';\nimport type {UserDataAmazon} from '../types/amazon';\n\nimport type {NativeModuleProps} from './common';\n\n// ----------\n\ntype GetUser = () => Promise<UserDataAmazon>;\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\ntype GetItemsByType = (type: string, skus: Sku[]) => Promise<Product[]>;\ntype GetAvailableItems = () => Promise<Purchase[]>;\ntype BuyItemByType = (sku: Sku) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype StartListening = () => Promise<void>;\n\nexport interface AmazonModuleProps extends NativeModuleProps {\n getUser: GetUser;\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItems: GetAvailableItems;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n startListening: StartListening;\n}\n\nexport const AmazonModule =\n NativeModules.RNIapAmazonModule as AmazonModuleProps;\n"],"mappings":";;;;;;;AAAA;;AAsCO,MAAMA,YAAY,GACvBC,0BAAA,CAAcC,iBADT"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AndroidModule = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
const AndroidModule = _reactNative.NativeModules.RNIapModule;
|
|
11
|
+
exports.AndroidModule = AndroidModule;
|
|
12
|
+
//# sourceMappingURL=android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AndroidModule","NativeModules","RNIapModule"],"sources":["android.ts"],"sourcesContent":["import {NativeModules} from 'react-native';\n\nimport type {\n Product,\n ProductType,\n ProrationModesAndroid,\n Purchase,\n PurchaseResult,\n Sku,\n} from '../types';\n\nimport type {NativeModuleProps} from './common';\n\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\n\ntype GetItemsByType = <T = Product>(\n type: ProductType,\n skus: Sku[],\n) => Promise<T[]>;\n\ntype GetAvailableItemsByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\ntype GetPurchaseHistoryByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\nexport type BuyItemByType = (\n type: string,\n skus: Sku[],\n purchaseToken: string | undefined,\n prorationMode: ProrationModesAndroid,\n obfuscatedAccountId: string | undefined,\n obfuscatedProfileId: string | undefined,\n subscriptionOffers: string[],\n isOfferPersonalized: boolean,\n) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype StartListening = () => Promise<void>;\ntype GetPackageName = () => Promise<string>;\n\nexport interface AndroidModuleProps extends NativeModuleProps {\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItemsByType: GetAvailableItemsByType;\n getPurchaseHistoryByType: GetPurchaseHistoryByType;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n startListening: StartListening;\n getPackageName: GetPackageName;\n}\n\nexport const AndroidModule = NativeModules.RNIapModule as AndroidModuleProps;\n"],"mappings":";;;;;;;AAAA;;AAgEO,MAAMA,aAAa,GAAGC,0BAAA,CAAcC,WAApC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["common.ts"],"sourcesContent":["/**\n * Common interface for all native modules (iOS — AppStore, Android — PlayStore and Amazon).\n */\nexport interface NativeModuleProps {\n /** Required method to start a payment provider connection */\n initConnection(): Promise<boolean>;\n\n /** Required method to end the payment provider connection */\n endConnection(): Promise<boolean>;\n\n /** addListener for NativeEventEmitter */\n addListener(eventType: string): void;\n\n /** removeListeners for NativeEventEmitter */\n removeListeners(count: number): void;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _amazon = require("./amazon");
|
|
8
|
+
|
|
9
|
+
Object.keys(_amazon).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _amazon[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _amazon[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _android = require("./android");
|
|
21
|
+
|
|
22
|
+
Object.keys(_android).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _android[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _android[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _ios = require("./ios");
|
|
34
|
+
|
|
35
|
+
Object.keys(_ios).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _ios[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _ios[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var _common = require("./common");
|
|
47
|
+
|
|
48
|
+
Object.keys(_common).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (key in exports && exports[key] === _common[key]) return;
|
|
51
|
+
Object.defineProperty(exports, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return _common[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './amazon';\nexport * from './android';\nexport * from './ios';\nexport * from './common';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["ios.ts"],"sourcesContent":["import type {\n Product,\n ProductPurchase,\n Purchase,\n Sku,\n Subscription,\n} from '../types';\nimport type {PaymentDiscount} from '../types/apple';\n\nimport type {NativeModuleProps} from './common';\n\ntype getItems = (skus: Sku[]) => Promise<Product[] | Subscription[]>;\n\ntype getAvailableItems = () => Promise<Purchase[]>;\n\nexport type BuyProduct = (\n sku: Sku,\n andDangerouslyFinishTransactionAutomaticallyIOS: boolean,\n applicationUsername?: string,\n) => Promise<Purchase>;\n\ntype buyProductWithOffer = (\n sku: Sku,\n forUser: string,\n withOffer: PaymentDiscount,\n) => Promise<Purchase>;\n\ntype buyProductWithQuantity = (\n sku: Sku,\n quantity: number,\n) => Promise<ProductPurchase>;\ntype clearTransaction = () => Promise<void>;\ntype clearProducts = () => Promise<void>;\ntype promotedProduct = () => Promise<Product | null>;\ntype buyPromotedProduct = () => Promise<void>;\ntype requestReceipt = (refresh: boolean) => Promise<string>;\n\ntype finishTransaction = (transactionIdentifier: string) => Promise<boolean>;\n\ntype getPendingTransactions = () => Promise<ProductPurchase[]>;\ntype presentCodeRedemptionSheet = () => Promise<null>;\n\nexport interface IosModuleProps extends NativeModuleProps {\n getItems: getItems;\n getAvailableItems: getAvailableItems;\n buyProduct: BuyProduct;\n buyProductWithOffer: buyProductWithOffer;\n buyProductWithQuantityIOS: buyProductWithQuantity;\n clearTransaction: clearTransaction;\n clearProducts: clearProducts;\n promotedProduct: promotedProduct;\n buyPromotedProduct: buyPromotedProduct;\n requestReceipt: requestReceipt;\n finishTransaction: finishTransaction;\n getPendingTransactions: getPendingTransactions;\n presentCodeRedemptionSheet: presentCodeRedemptionSheet;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["amazon.ts"],"sourcesContent":["/**\n * From: https://developer.amazon.com/es/docs/in-app-purchasing/iap-rvs-examples.html\n */\nexport type ReceiptType = {\n autoRenewing: boolean;\n betaProduct: boolean;\n cancelDate: number | null;\n cancelReason: string;\n deferredDate: number | null;\n deferredSku: number | null;\n freeTrialEndDate: number;\n gracePeriodEndDate: number;\n parentProductId: string;\n productId: string;\n productType: string;\n purchaseDate: number;\n quantity: number;\n receiptId: string;\n renewalDate: number;\n term: string;\n termSku: string;\n testTransaction: boolean;\n} & Record<string, unknown>;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["amazon.ts"],"sourcesContent":["export interface UserDataAmazon {\n userIdAmazon?: string;\n userMarketplaceAmazon?: string;\n userJsonAmazon?: string;\n}\n\nexport interface ProductPurchaseAmazon extends UserDataAmazon {\n isCanceledAmazon?: boolean;\n}\n/**\n * From: https://developer.amazon.com/es/docs/in-app-purchasing/iap-rvs-examples.html\n */\nexport type ReceiptType = {\n autoRenewing: boolean;\n betaProduct: boolean;\n cancelDate: number | null;\n cancelReason: string;\n deferredDate: number | null;\n deferredSku: number | null;\n freeTrialEndDate: number;\n gracePeriodEndDate: number;\n parentProductId: string;\n productId: string;\n productType: string;\n purchaseDate: number;\n quantity: number;\n receiptId: string;\n renewalDate: number;\n term: string;\n termSku: string;\n testTransaction: boolean;\n} & Record<string, unknown>;\n"],"mappings":""}
|
|
@@ -1,165 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SubscriptionRetryFlag = exports.SubscriptionPriceConsentStatus = exports.SubscriptionExpirationIntent = exports.SubscriptionAutoRenewStatus = exports.ReceiptValidationStatus = exports.CancellationReason = void 0;
|
|
7
|
-
let ReceiptValidationStatus;
|
|
8
|
-
exports.ReceiptValidationStatus = ReceiptValidationStatus;
|
|
9
|
-
|
|
10
|
-
(function (ReceiptValidationStatus) {
|
|
11
|
-
ReceiptValidationStatus[ReceiptValidationStatus["SUCCESS"] = 0] = "SUCCESS";
|
|
12
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INVALID_JSON"] = 21000] = "INVALID_JSON";
|
|
13
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INVALID_RECEIPT_DATA"] = 21002] = "INVALID_RECEIPT_DATA";
|
|
14
|
-
ReceiptValidationStatus[ReceiptValidationStatus["COULT_NOT_AUTHENTICATE"] = 21003] = "COULT_NOT_AUTHENTICATE";
|
|
15
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INVALID_SECRET"] = 21004] = "INVALID_SECRET";
|
|
16
|
-
ReceiptValidationStatus[ReceiptValidationStatus["UNAVAILABLE"] = 21005] = "UNAVAILABLE";
|
|
17
|
-
ReceiptValidationStatus[ReceiptValidationStatus["EXPIRED_SUBSCRIPTION"] = 21006] = "EXPIRED_SUBSCRIPTION";
|
|
18
|
-
ReceiptValidationStatus[ReceiptValidationStatus["TEST_RECEIPT"] = 21007] = "TEST_RECEIPT";
|
|
19
|
-
ReceiptValidationStatus[ReceiptValidationStatus["PROD_RECEIPT"] = 21008] = "PROD_RECEIPT";
|
|
20
|
-
ReceiptValidationStatus[ReceiptValidationStatus["COULD_NOT_AUTHORIZE"] = 21010] = "COULD_NOT_AUTHORIZE";
|
|
21
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_00"] = 21100] = "INTERNAL_ERROR_00";
|
|
22
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_01"] = 21101] = "INTERNAL_ERROR_01";
|
|
23
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_02"] = 21102] = "INTERNAL_ERROR_02";
|
|
24
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_03"] = 21103] = "INTERNAL_ERROR_03";
|
|
25
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_04"] = 21104] = "INTERNAL_ERROR_04";
|
|
26
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_05"] = 21105] = "INTERNAL_ERROR_05";
|
|
27
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_06"] = 21106] = "INTERNAL_ERROR_06";
|
|
28
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_07"] = 21107] = "INTERNAL_ERROR_07";
|
|
29
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_08"] = 21108] = "INTERNAL_ERROR_08";
|
|
30
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_09"] = 21109] = "INTERNAL_ERROR_09";
|
|
31
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_10"] = 21110] = "INTERNAL_ERROR_10";
|
|
32
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_11"] = 21111] = "INTERNAL_ERROR_11";
|
|
33
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_12"] = 21112] = "INTERNAL_ERROR_12";
|
|
34
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_13"] = 21113] = "INTERNAL_ERROR_13";
|
|
35
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_14"] = 21114] = "INTERNAL_ERROR_14";
|
|
36
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_15"] = 21115] = "INTERNAL_ERROR_15";
|
|
37
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_16"] = 21116] = "INTERNAL_ERROR_16";
|
|
38
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_17"] = 21117] = "INTERNAL_ERROR_17";
|
|
39
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_18"] = 21118] = "INTERNAL_ERROR_18";
|
|
40
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_19"] = 21119] = "INTERNAL_ERROR_19";
|
|
41
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_20"] = 21120] = "INTERNAL_ERROR_20";
|
|
42
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_21"] = 21121] = "INTERNAL_ERROR_21";
|
|
43
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_22"] = 21122] = "INTERNAL_ERROR_22";
|
|
44
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_23"] = 21123] = "INTERNAL_ERROR_23";
|
|
45
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_24"] = 21124] = "INTERNAL_ERROR_24";
|
|
46
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_25"] = 21125] = "INTERNAL_ERROR_25";
|
|
47
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_26"] = 21126] = "INTERNAL_ERROR_26";
|
|
48
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_27"] = 21127] = "INTERNAL_ERROR_27";
|
|
49
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_28"] = 21128] = "INTERNAL_ERROR_28";
|
|
50
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_29"] = 21129] = "INTERNAL_ERROR_29";
|
|
51
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_30"] = 21130] = "INTERNAL_ERROR_30";
|
|
52
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_31"] = 21131] = "INTERNAL_ERROR_31";
|
|
53
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_32"] = 21132] = "INTERNAL_ERROR_32";
|
|
54
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_33"] = 21133] = "INTERNAL_ERROR_33";
|
|
55
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_34"] = 21134] = "INTERNAL_ERROR_34";
|
|
56
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_35"] = 21135] = "INTERNAL_ERROR_35";
|
|
57
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_36"] = 21136] = "INTERNAL_ERROR_36";
|
|
58
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_37"] = 21137] = "INTERNAL_ERROR_37";
|
|
59
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_38"] = 21138] = "INTERNAL_ERROR_38";
|
|
60
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_39"] = 21139] = "INTERNAL_ERROR_39";
|
|
61
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_40"] = 21140] = "INTERNAL_ERROR_40";
|
|
62
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_41"] = 21141] = "INTERNAL_ERROR_41";
|
|
63
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_42"] = 21142] = "INTERNAL_ERROR_42";
|
|
64
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_43"] = 21143] = "INTERNAL_ERROR_43";
|
|
65
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_44"] = 21144] = "INTERNAL_ERROR_44";
|
|
66
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_45"] = 21145] = "INTERNAL_ERROR_45";
|
|
67
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_46"] = 21146] = "INTERNAL_ERROR_46";
|
|
68
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_47"] = 21147] = "INTERNAL_ERROR_47";
|
|
69
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_48"] = 21148] = "INTERNAL_ERROR_48";
|
|
70
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_49"] = 21149] = "INTERNAL_ERROR_49";
|
|
71
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_50"] = 21150] = "INTERNAL_ERROR_50";
|
|
72
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_51"] = 21151] = "INTERNAL_ERROR_51";
|
|
73
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_52"] = 21152] = "INTERNAL_ERROR_52";
|
|
74
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_53"] = 21153] = "INTERNAL_ERROR_53";
|
|
75
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_54"] = 21154] = "INTERNAL_ERROR_54";
|
|
76
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_55"] = 21155] = "INTERNAL_ERROR_55";
|
|
77
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_56"] = 21156] = "INTERNAL_ERROR_56";
|
|
78
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_57"] = 21157] = "INTERNAL_ERROR_57";
|
|
79
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_58"] = 21158] = "INTERNAL_ERROR_58";
|
|
80
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_59"] = 21159] = "INTERNAL_ERROR_59";
|
|
81
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_60"] = 21160] = "INTERNAL_ERROR_60";
|
|
82
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_61"] = 21161] = "INTERNAL_ERROR_61";
|
|
83
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_62"] = 21162] = "INTERNAL_ERROR_62";
|
|
84
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_63"] = 21163] = "INTERNAL_ERROR_63";
|
|
85
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_64"] = 21164] = "INTERNAL_ERROR_64";
|
|
86
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_65"] = 21165] = "INTERNAL_ERROR_65";
|
|
87
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_66"] = 21166] = "INTERNAL_ERROR_66";
|
|
88
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_67"] = 21167] = "INTERNAL_ERROR_67";
|
|
89
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_68"] = 21168] = "INTERNAL_ERROR_68";
|
|
90
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_69"] = 21169] = "INTERNAL_ERROR_69";
|
|
91
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_70"] = 21170] = "INTERNAL_ERROR_70";
|
|
92
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_71"] = 21171] = "INTERNAL_ERROR_71";
|
|
93
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_72"] = 21172] = "INTERNAL_ERROR_72";
|
|
94
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_73"] = 21173] = "INTERNAL_ERROR_73";
|
|
95
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_74"] = 21174] = "INTERNAL_ERROR_74";
|
|
96
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_75"] = 21175] = "INTERNAL_ERROR_75";
|
|
97
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_76"] = 21176] = "INTERNAL_ERROR_76";
|
|
98
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_77"] = 21177] = "INTERNAL_ERROR_77";
|
|
99
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_78"] = 21178] = "INTERNAL_ERROR_78";
|
|
100
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_79"] = 21179] = "INTERNAL_ERROR_79";
|
|
101
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_80"] = 21180] = "INTERNAL_ERROR_80";
|
|
102
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_81"] = 21181] = "INTERNAL_ERROR_81";
|
|
103
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_82"] = 21182] = "INTERNAL_ERROR_82";
|
|
104
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_83"] = 21183] = "INTERNAL_ERROR_83";
|
|
105
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_84"] = 21184] = "INTERNAL_ERROR_84";
|
|
106
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_85"] = 21185] = "INTERNAL_ERROR_85";
|
|
107
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_86"] = 21186] = "INTERNAL_ERROR_86";
|
|
108
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_87"] = 21187] = "INTERNAL_ERROR_87";
|
|
109
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_88"] = 21188] = "INTERNAL_ERROR_88";
|
|
110
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_89"] = 21189] = "INTERNAL_ERROR_89";
|
|
111
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_90"] = 21190] = "INTERNAL_ERROR_90";
|
|
112
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_91"] = 21191] = "INTERNAL_ERROR_91";
|
|
113
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_92"] = 21192] = "INTERNAL_ERROR_92";
|
|
114
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_93"] = 21193] = "INTERNAL_ERROR_93";
|
|
115
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_94"] = 21194] = "INTERNAL_ERROR_94";
|
|
116
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_95"] = 21195] = "INTERNAL_ERROR_95";
|
|
117
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_96"] = 21196] = "INTERNAL_ERROR_96";
|
|
118
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_97"] = 21197] = "INTERNAL_ERROR_97";
|
|
119
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_98"] = 21198] = "INTERNAL_ERROR_98";
|
|
120
|
-
ReceiptValidationStatus[ReceiptValidationStatus["INTERNAL_ERROR_99"] = 21199] = "INTERNAL_ERROR_99";
|
|
121
|
-
})(ReceiptValidationStatus || (exports.ReceiptValidationStatus = ReceiptValidationStatus = {}));
|
|
122
|
-
|
|
123
|
-
let SubscriptionExpirationIntent;
|
|
124
|
-
exports.SubscriptionExpirationIntent = SubscriptionExpirationIntent;
|
|
125
|
-
|
|
126
|
-
(function (SubscriptionExpirationIntent) {
|
|
127
|
-
SubscriptionExpirationIntent["CUSTOMER_CANCELED"] = "1";
|
|
128
|
-
SubscriptionExpirationIntent["BILLING_ERROR"] = "2";
|
|
129
|
-
SubscriptionExpirationIntent["DENIED_PRICE_INCREASE"] = "3";
|
|
130
|
-
SubscriptionExpirationIntent["PRODUCT_NOT_AVAILABLE"] = "4";
|
|
131
|
-
SubscriptionExpirationIntent["UNKNOWN_ERROR"] = "5";
|
|
132
|
-
})(SubscriptionExpirationIntent || (exports.SubscriptionExpirationIntent = SubscriptionExpirationIntent = {}));
|
|
133
|
-
|
|
134
|
-
let SubscriptionRetryFlag;
|
|
135
|
-
exports.SubscriptionRetryFlag = SubscriptionRetryFlag;
|
|
136
|
-
|
|
137
|
-
(function (SubscriptionRetryFlag) {
|
|
138
|
-
SubscriptionRetryFlag["ACTIVE"] = "1";
|
|
139
|
-
SubscriptionRetryFlag["STOPPED"] = "0";
|
|
140
|
-
})(SubscriptionRetryFlag || (exports.SubscriptionRetryFlag = SubscriptionRetryFlag = {}));
|
|
141
|
-
|
|
142
|
-
let CancellationReason;
|
|
143
|
-
exports.CancellationReason = CancellationReason;
|
|
144
|
-
|
|
145
|
-
(function (CancellationReason) {
|
|
146
|
-
CancellationReason["ACTUAL_ISSUE"] = "1";
|
|
147
|
-
CancellationReason["OTHER_REASON"] = "0";
|
|
148
|
-
})(CancellationReason || (exports.CancellationReason = CancellationReason = {}));
|
|
149
|
-
|
|
150
|
-
let SubscriptionAutoRenewStatus;
|
|
151
|
-
exports.SubscriptionAutoRenewStatus = SubscriptionAutoRenewStatus;
|
|
152
|
-
|
|
153
|
-
(function (SubscriptionAutoRenewStatus) {
|
|
154
|
-
SubscriptionAutoRenewStatus["ACTIVE"] = "1";
|
|
155
|
-
SubscriptionAutoRenewStatus["STOPPED"] = "0";
|
|
156
|
-
})(SubscriptionAutoRenewStatus || (exports.SubscriptionAutoRenewStatus = SubscriptionAutoRenewStatus = {}));
|
|
157
|
-
|
|
158
|
-
let SubscriptionPriceConsentStatus;
|
|
159
|
-
exports.SubscriptionPriceConsentStatus = SubscriptionPriceConsentStatus;
|
|
160
|
-
|
|
161
|
-
(function (SubscriptionPriceConsentStatus) {
|
|
162
|
-
SubscriptionPriceConsentStatus["AGREED"] = "1";
|
|
163
|
-
SubscriptionPriceConsentStatus["NO_ACTION"] = "0";
|
|
164
|
-
})(SubscriptionPriceConsentStatus || (exports.SubscriptionPriceConsentStatus = SubscriptionPriceConsentStatus = {}));
|
|
165
2
|
//# sourceMappingURL=apple.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ReceiptValidationStatus","SubscriptionExpirationIntent","SubscriptionRetryFlag","CancellationReason","SubscriptionAutoRenewStatus","SubscriptionPriceConsentStatus"],"sources":["apple.ts"],"sourcesContent":["export enum ReceiptValidationStatus {\n /** The receipt validated successfully. */\n SUCCESS = 0,\n /** The App Store could not read the JSON object you provided. */\n INVALID_JSON = 21000,\n /** The data in the receipt-data property was malformed or missing. */\n INVALID_RECEIPT_DATA = 21002,\n /** The receipt could not be authenticated. */\n COULT_NOT_AUTHENTICATE = 21003,\n /** The shared secret you provided does not match the shared secret on file for your account. */\n INVALID_SECRET = 21004,\n /** The receipt server is not currently available. */\n UNAVAILABLE = 21005,\n /** This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response.\n Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions. */\n EXPIRED_SUBSCRIPTION = 21006,\n /** This receipt is from the test environment, but it was sent to the production environment for verification. Send it to the test environment instead. */\n TEST_RECEIPT = 21007,\n /** This receipt is from the production environment, but it was sent to the test environment for verification. Send it to the production environment instead. */\n PROD_RECEIPT = 21008,\n /** This receipt could not be authorized. Treat this the same as if a purchase was never made. */\n COULD_NOT_AUTHORIZE = 21010,\n\n /** Internal data access error. */ INTERNAL_ERROR_00 = 21100,\n /** Internal data access error. */ INTERNAL_ERROR_01 = 21101,\n /** Internal data access error. */ INTERNAL_ERROR_02 = 21102,\n /** Internal data access error. */ INTERNAL_ERROR_03 = 21103,\n /** Internal data access error. */ INTERNAL_ERROR_04 = 21104,\n /** Internal data access error. */ INTERNAL_ERROR_05 = 21105,\n /** Internal data access error. */ INTERNAL_ERROR_06 = 21106,\n /** Internal data access error. */ INTERNAL_ERROR_07 = 21107,\n /** Internal data access error. */ INTERNAL_ERROR_08 = 21108,\n /** Internal data access error. */ INTERNAL_ERROR_09 = 21109,\n /** Internal data access error. */ INTERNAL_ERROR_10 = 21110,\n /** Internal data access error. */ INTERNAL_ERROR_11 = 21111,\n /** Internal data access error. */ INTERNAL_ERROR_12 = 21112,\n /** Internal data access error. */ INTERNAL_ERROR_13 = 21113,\n /** Internal data access error. */ INTERNAL_ERROR_14 = 21114,\n /** Internal data access error. */ INTERNAL_ERROR_15 = 21115,\n /** Internal data access error. */ INTERNAL_ERROR_16 = 21116,\n /** Internal data access error. */ INTERNAL_ERROR_17 = 21117,\n /** Internal data access error. */ INTERNAL_ERROR_18 = 21118,\n /** Internal data access error. */ INTERNAL_ERROR_19 = 21119,\n /** Internal data access error. */ INTERNAL_ERROR_20 = 21120,\n /** Internal data access error. */ INTERNAL_ERROR_21 = 21121,\n /** Internal data access error. */ INTERNAL_ERROR_22 = 21122,\n /** Internal data access error. */ INTERNAL_ERROR_23 = 21123,\n /** Internal data access error. */ INTERNAL_ERROR_24 = 21124,\n /** Internal data access error. */ INTERNAL_ERROR_25 = 21125,\n /** Internal data access error. */ INTERNAL_ERROR_26 = 21126,\n /** Internal data access error. */ INTERNAL_ERROR_27 = 21127,\n /** Internal data access error. */ INTERNAL_ERROR_28 = 21128,\n /** Internal data access error. */ INTERNAL_ERROR_29 = 21129,\n /** Internal data access error. */ INTERNAL_ERROR_30 = 21130,\n /** Internal data access error. */ INTERNAL_ERROR_31 = 21131,\n /** Internal data access error. */ INTERNAL_ERROR_32 = 21132,\n /** Internal data access error. */ INTERNAL_ERROR_33 = 21133,\n /** Internal data access error. */ INTERNAL_ERROR_34 = 21134,\n /** Internal data access error. */ INTERNAL_ERROR_35 = 21135,\n /** Internal data access error. */ INTERNAL_ERROR_36 = 21136,\n /** Internal data access error. */ INTERNAL_ERROR_37 = 21137,\n /** Internal data access error. */ INTERNAL_ERROR_38 = 21138,\n /** Internal data access error. */ INTERNAL_ERROR_39 = 21139,\n /** Internal data access error. */ INTERNAL_ERROR_40 = 21140,\n /** Internal data access error. */ INTERNAL_ERROR_41 = 21141,\n /** Internal data access error. */ INTERNAL_ERROR_42 = 21142,\n /** Internal data access error. */ INTERNAL_ERROR_43 = 21143,\n /** Internal data access error. */ INTERNAL_ERROR_44 = 21144,\n /** Internal data access error. */ INTERNAL_ERROR_45 = 21145,\n /** Internal data access error. */ INTERNAL_ERROR_46 = 21146,\n /** Internal data access error. */ INTERNAL_ERROR_47 = 21147,\n /** Internal data access error. */ INTERNAL_ERROR_48 = 21148,\n /** Internal data access error. */ INTERNAL_ERROR_49 = 21149,\n /** Internal data access error. */ INTERNAL_ERROR_50 = 21150,\n /** Internal data access error. */ INTERNAL_ERROR_51 = 21151,\n /** Internal data access error. */ INTERNAL_ERROR_52 = 21152,\n /** Internal data access error. */ INTERNAL_ERROR_53 = 21153,\n /** Internal data access error. */ INTERNAL_ERROR_54 = 21154,\n /** Internal data access error. */ INTERNAL_ERROR_55 = 21155,\n /** Internal data access error. */ INTERNAL_ERROR_56 = 21156,\n /** Internal data access error. */ INTERNAL_ERROR_57 = 21157,\n /** Internal data access error. */ INTERNAL_ERROR_58 = 21158,\n /** Internal data access error. */ INTERNAL_ERROR_59 = 21159,\n /** Internal data access error. */ INTERNAL_ERROR_60 = 21160,\n /** Internal data access error. */ INTERNAL_ERROR_61 = 21161,\n /** Internal data access error. */ INTERNAL_ERROR_62 = 21162,\n /** Internal data access error. */ INTERNAL_ERROR_63 = 21163,\n /** Internal data access error. */ INTERNAL_ERROR_64 = 21164,\n /** Internal data access error. */ INTERNAL_ERROR_65 = 21165,\n /** Internal data access error. */ INTERNAL_ERROR_66 = 21166,\n /** Internal data access error. */ INTERNAL_ERROR_67 = 21167,\n /** Internal data access error. */ INTERNAL_ERROR_68 = 21168,\n /** Internal data access error. */ INTERNAL_ERROR_69 = 21169,\n /** Internal data access error. */ INTERNAL_ERROR_70 = 21170,\n /** Internal data access error. */ INTERNAL_ERROR_71 = 21171,\n /** Internal data access error. */ INTERNAL_ERROR_72 = 21172,\n /** Internal data access error. */ INTERNAL_ERROR_73 = 21173,\n /** Internal data access error. */ INTERNAL_ERROR_74 = 21174,\n /** Internal data access error. */ INTERNAL_ERROR_75 = 21175,\n /** Internal data access error. */ INTERNAL_ERROR_76 = 21176,\n /** Internal data access error. */ INTERNAL_ERROR_77 = 21177,\n /** Internal data access error. */ INTERNAL_ERROR_78 = 21178,\n /** Internal data access error. */ INTERNAL_ERROR_79 = 21179,\n /** Internal data access error. */ INTERNAL_ERROR_80 = 21180,\n /** Internal data access error. */ INTERNAL_ERROR_81 = 21181,\n /** Internal data access error. */ INTERNAL_ERROR_82 = 21182,\n /** Internal data access error. */ INTERNAL_ERROR_83 = 21183,\n /** Internal data access error. */ INTERNAL_ERROR_84 = 21184,\n /** Internal data access error. */ INTERNAL_ERROR_85 = 21185,\n /** Internal data access error. */ INTERNAL_ERROR_86 = 21186,\n /** Internal data access error. */ INTERNAL_ERROR_87 = 21187,\n /** Internal data access error. */ INTERNAL_ERROR_88 = 21188,\n /** Internal data access error. */ INTERNAL_ERROR_89 = 21189,\n /** Internal data access error. */ INTERNAL_ERROR_90 = 21190,\n /** Internal data access error. */ INTERNAL_ERROR_91 = 21191,\n /** Internal data access error. */ INTERNAL_ERROR_92 = 21192,\n /** Internal data access error. */ INTERNAL_ERROR_93 = 21193,\n /** Internal data access error. */ INTERNAL_ERROR_94 = 21194,\n /** Internal data access error. */ INTERNAL_ERROR_95 = 21195,\n /** Internal data access error. */ INTERNAL_ERROR_96 = 21196,\n /** Internal data access error. */ INTERNAL_ERROR_97 = 21197,\n /** Internal data access error. */ INTERNAL_ERROR_98 = 21198,\n /** Internal data access error. */ INTERNAL_ERROR_99 = 21199,\n}\n\nexport enum SubscriptionExpirationIntent {\n /** Customer canceled their subscription. **/\n CUSTOMER_CANCELED = '1',\n /** Billing error; for example customer’s payment information was no longer valid. **/\n BILLING_ERROR = '2',\n /** Customer did not agree to a recent price increase. **/\n DENIED_PRICE_INCREASE = '3',\n /** Product was not available for purchase at the time of renewal. **/\n PRODUCT_NOT_AVAILABLE = '4',\n /** Unknown error. **/\n UNKNOWN_ERROR = '5',\n}\n\nexport enum SubscriptionRetryFlag {\n /** App Store is still attempting to renew the subscription. */\n ACTIVE = '1',\n /** App Store has stopped attempting to renew the subscription. */\n STOPPED = '0',\n}\n\nexport enum CancellationReason {\n /** Customer canceled their transaction due to an actual or perceived issue within your app. */\n ACTUAL_ISSUE = '1',\n /** Transaction was canceled for another reason, for example, if the customer made the purchase accidentally. */\n OTHER_REASON = '0',\n}\n\nexport enum SubscriptionAutoRenewStatus {\n /** Subscription will renew at the end of the current subscription period. */\n ACTIVE = '1',\n /** Customer has turned off automatic renewal for their subscription. */\n STOPPED = '0',\n}\n\nexport enum SubscriptionPriceConsentStatus {\n /** Customer has agreed to the price increase. Subscription will renew at the higher price. */\n AGREED = '1',\n /** Customer has not taken action regarding the increased price. Subscription expires if the customer takes no action before the renewal date. */\n NO_ACTION = '0',\n}\n\nexport interface ReceiptValidationRequest {\n /** The base64 encoded receipt data. */\n 'receipt-data': string;\n /** *Only used for receipts that contain auto-renewable subscriptions.* Your app’s shared secret (a hexadecimal string). */\n password?: string;\n /** *Only used for iOS7 style app receipts that contain auto-renewable or non-renewing subscriptions.* If value is true, response includes only the latest renewal transaction for any subscriptions. */\n 'exclude-old-transactions'?: boolean;\n}\n\nexport interface ReceiptValidationResponse {\n /**\n * Either `0` if the receipt is valid, or one of the error codes listed in [Table 2-1](https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW5).\n *\n * For iOS 6 style transaction receipts, the status code reflects the status of the specific transaction’s receipt.\n *\n * For iOS 7 style app receipts, the status code is reflects the status of the app receipt as a whole. For example, if you send a valid app receipt that contains an expired subscription, the response is 0 because the receipt as a whole is valid.\n */\n status: ReceiptValidationStatus;\n\n /**\n * A JSON representation of the receipt that was sent for verification. For information about keys found in a receipt, see [Receipt Fields](https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1).\n */\n receipt: AppReceipt;\n\n /**\n * *Only returned for receipts containing auto-renewable subscriptions.*\n *\n * For iOS 6 style transaction receipts, this is the base-64 encoded receipt for the most recent renewal.\n *\n * For iOS 7 style app receipts, this is the latest base-64 encoded app receipt.\n */\n latest_receipt?: string;\n\n /**\n * *Only returned for receipts containing auto-renewable subscriptions.*\n *\n * iOS 6 style transaction receipts are not longer supported.\n *\n * For iOS 7 style app receipts, the value of this key is an array containing all in-app purchase transactions. This excludes transactions for a consumable product that have been marked as finished by your app.\n */\n latest_receipt_info?: Record<string, unknown>[];\n\n /**\n * *Only returned for iOS 6 style transaction receipts, for an auto-renewable subscription.*\n *\n * The JSON representation of the receipt for the expired subscription.\n */\n latest_expired_receipt_info?: Record<string, unknown>;\n\n /**\n * *Only returned for iOS 7 style app receipts containing auto-renewable subscriptions.*\n *\n * In the JSON file, the value of this key is an array where each element contains the pending renewal information for each auto-renewable subscription identified by the [Product Identifier](https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW11). A pending renewal may refer to a renewal that is scheduled in the future or a renewal that failed in the past for some reason.\n */\n pending_renewal_info?: Record<string, unknown>[];\n}\n\nexport interface AppReceipt {\n /**\n * The app’s bundle identifier.\n *\n * This corresponds to the value of `CFBundleIdentifier` in the `Info.plist` file. Use this value to validate if the receipt was indeed generated for your app.\n */\n bundle_id: string;\n\n /**\n * The app’s version number.\n *\n * This corresponds to the value of `CFBundleVersion` (in iOS) or `CFBundleShortVersionString` (in macOS) in the `Info.plist`.\n */\n application_version: string;\n\n /**\n * The receipt for an in-app purchase.\n *\n * In the JSON file, the value of this key is an array containing all in-app purchase receipts based on the in-app purchase transactions present in the input base-64 receipt-data. For receipts containing auto-renewable subscriptions, check the value of the `latest_receipt_info` key to get the status of the most recent renewal.\n *\n * **Note:** An empty array is a valid receipt.\n *\n * The in-app purchase receipt for a consumable product is added to the receipt when the purchase is made. It is kept in the receipt until your app finishes that transaction. After that point, it is removed from the receipt the next time the receipt is updated - for example, when the user makes another purchase or if your app explicitly refreshes the receipt.\n *\n * The in-app purchase receipt for a non-consumable product, auto-renewable subscription, non-renewing subscription, or free subscription remains in the receipt indefinitely.\n */\n in_app: IAPReceipt[];\n\n /**\n * The version of the app that was originally purchased.\n *\n * This corresponds to the value of `CFBundleVersion` (in iOS) or `CFBundleShortVersionString` (in macOS) in the `Info.plist` file when the purchase was originally made.\n *\n * In the sandbox environment, the value of this field is always `\"1.0\"`.\n */\n original_application_version: string;\n\n /**\n * The date when the app receipt was created, interpreted as an RFC 3339 date.\n *\n * When validating a receipt, use this date to validate the receipt’s signature.\n *\n * **Note:** Many cryptographic libraries default to using the device’s current time and date when validating a PKCS7 package, but this may not produce the correct results when validating a receipt’s signature. For example, if the receipt was signed with a valid certificate, but the certificate has since expired, using the device’s current date incorrectly returns an invalid result.\n *\n * Therefore, make sure your app always uses the date from the Receipt Creation Date field to validate the receipt’s signature.\n */\n receipt_creation_date: string;\n\n /**\n * The date that the app receipt expires, interpreted as an RFC 3339 date.\n *\n * This key is present only for apps purchased through the Volume Purchase Program. If this key is not present, the receipt does not expire.\n *\n * When validating a receipt, compare this date to the current date to determine whether the receipt is expired. Do not try to use this date to calculate any other information, such as the time remaining before expiration.\n */\n expiration_date?: string;\n}\n\nexport interface IAPReceipt {\n /**\n * The number of items purchased. (string, interpreted as an integer)\n *\n * This value corresponds to the `quantity` property of the `SKPayment` object stored in the transaction’s `payment` property.\n */\n quantity: string;\n\n /**\n * The product identifier of the item that was purchased.\n *\n * This value corresponds to the `productIdentifier` property of the `SKPayment` object stored in the transaction’s `payment` property.\n */\n product_id: string;\n\n /**\n * The transaction identifier of the item that was purchased.\n *\n * This value corresponds to the transaction’s `transactionIdentifier` property.\n *\n * For a transaction that restores a previous transaction, this value is different from the transaction identifier of the original purchase transaction. In an auto-renewable subscription receipt, a new value for the transaction identifier is generated every time the subscription automatically renews or is restored on a new device.\n */\n transaction_id: string;\n\n /**\n * For a transaction that restores a previous transaction, the transaction identifier of the original transaction. Otherwise, identical to the transaction identifier.\n *\n * This value corresponds to the original transaction’s `transactionIdentifier` property.\n *\n * This value is the same for all receipts that have been generated for a specific subscription. This value is useful for relating together multiple iOS 6 style transaction receipts for the same individual customer’s subscription.\n */\n original_transaction_id: string;\n\n /**\n * The date and time that the item was purchased, interpreted as an RFC 3339 date.\n *\n * This value corresponds to the transaction’s `transactionDate` property.\n *\n * For a transaction that restores a previous transaction, the purchase date is the same as the original purchase date. Use [Original Purchase Date](https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW4) to get the date of the original transaction.\n *\n * In an auto-renewable subscription receipt, the purchase date is the date when the subscription was either purchased or renewed (with or without a lapse). For an automatic renewal that occurs on the expiration date of the current period, the purchase date is the start date of the next period, which is identical to the end date of the current period.\n */\n purchase_date: string;\n\n /**\n * For a transaction that restores a previous transaction, the date of the original transaction, interpreted as an RFC 3339 date.\n *\n * This value corresponds to the original transaction’s `transactionDate` property.\n *\n * In an auto-renewable subscription receipt, this indicates the beginning of the subscription period, even if the subscription has been renewed.\n */\n original_purchase_date: string;\n\n /**\n * The expiration date for the subscription, interpreted as an RFC 3339 date.\n *\n * This key is only present for auto-renewable subscription receipts. Use this value to identify the date when the subscription will renew or expire, to determine if a customer should have access to content or service. After validating the latest receipt, if the subscription expiration date for the latest renewal transaction is a past date, it is safe to assume that the subscription has expired.\n */\n expires_date: string;\n\n /**\n * For an expired subscription, the reason for the subscription expiration.\n *\n * This key is only present for a receipt containing an expired auto-renewable subscription. You can use this value to decide whether to display appropriate messaging in your app for customers to resubscribe.\n */\n expiration_intent?: SubscriptionExpirationIntent;\n\n /**\n * For an expired subscription, whether or not Apple is still attempting to automatically renew the subscription.\n *\n * This key is only present for auto-renewable subscription receipts. If the customer’s subscription failed to renew because the App Store was unable to complete the transaction, this value will reflect whether or not the App Store is still trying to renew the subscription.\n */\n is_in_billing_retry_period?: SubscriptionRetryFlag;\n\n /**\n * For a subscription, whether or not it is in the free trial period.\n *\n * This key is only present for auto-renewable subscription receipts. The value for this key is `\"true\"` if the customer’s subscription is currently in the free trial period, or `\"false\"` if not.\n *\n * **Note:** If a previous subscription period in the receipt has the value “true” for either the `is_trial_period` or the `is_in_intro_offer_period` key, the user is not eligible for a free trial or introductory price within that subscription group.\n */\n is_trial_period?: 'true' | 'false';\n\n /**\n * For an auto-renewable subscription, whether or not it is in the introductory price period.\n *\n * This key is only present for auto-renewable subscription receipts. The value for this key is `\"true\"` if the customer’s subscription is currently in an introductory price period, or `\"false\"` if not.\n *\n * **Note:** If a previous subscription period in the receipt has the value “true” for either the `is_trial_period` or the `is_in_intro_offer_period` key, the user is not eligible for a free trial or introductory price within that subscription group.\n */\n is_in_intro_offer_period?: 'true' | 'false';\n\n /**\n * For a transaction that was canceled by Apple customer support, the time and date of the cancellation. For an auto-renewable subscription plan that was upgraded, the time and date of the upgrade transaction. Interpreted as an RFC 3339 date.\n *\n * Treat a canceled receipt the same as if no purchase had ever been made.\n *\n * **Note:** A canceled in-app purchase remains in the receipt indefinitely. Only applicable if the refund was for a non-consumable product, an auto-renewable subscription, a non-renewing subscription, or for a free subscription.\n */\n cancellation_date?: string;\n\n /**\n * For a transaction that was canceled, the reason for cancellation.\n *\n * Use this value along with the cancellation date to identify possible issues in your app that may lead customers to contact Apple customer support.\n */\n cancellation_reason?: CancellationReason;\n\n /**\n * A string that the App Store uses to uniquely identify the application that created the transaction.\n *\n * If your server supports multiple applications, you can use this value to differentiate between them.\n *\n * Apps are assigned an identifier only in the production environment, so this key is not present for receipts created in the test environment.\n *\n * This field is not present for Mac apps.\n *\n * See also [Bundle Identifier](https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW3).\n */\n app_item_id?: string;\n\n /**\n * An arbitrary number that uniquely identifies a revision of your application.\n *\n * This key is not present for receipts created in the test environment. Use this value to identify the version of the app that the customer bought.\n */\n version_external_identifier?: string;\n\n /**\n * The primary key for identifying subscription purchases.\n *\n * This value is a unique ID that identifies purchase events across devices, including subscription renewal purchase events.\n */\n web_order_line_item_id: string;\n\n /**\n * The current renewal status for the auto-renewable subscription.\n *\n * This key is only present for auto-renewable subscription receipts, for active or expired subscriptions. The value for this key should not be interpreted as the customer’s subscription status. You can use this value to display an alternative subscription product in your app, for example, a lower level subscription plan that the customer can downgrade to from their current plan.\n */\n auto_renew_status?: SubscriptionAutoRenewStatus;\n\n /**\n * The current renewal preference for the auto-renewable subscription.\n *\n * This key is only present for auto-renewable subscription receipts. The value for this key corresponds to the `productIdentifier` property of the product that the customer’s subscription renews. You can use this value to present an alternative service level to the customer before the current subscription period ends.\n */\n auto_renew_product_id?: string;\n\n /**\n * The current price consent status for a subscription price increase.\n *\n * This key is only present for auto-renewable subscription receipts if the subscription price was increased without keeping the existing price for active subscribers. You can use this value to track customer adoption of the new price and take appropriate action.\n */\n price_consent_status?: SubscriptionPriceConsentStatus;\n}\n\n/**\n * Payment discount interface @see https://developer.apple.com/documentation/storekit/skpaymentdiscount?language=objc\n */\nexport interface PaymentDiscount {\n /**\n * A string used to uniquely identify a discount offer for a product.\n */\n identifier: string;\n\n /**\n * A string that identifies the key used to generate the signature.\n */\n keyIdentifier: string;\n\n /**\n * A universally unique ID (UUID) value that you define.\n */\n nonce: string;\n\n /**\n * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.\n */\n signature: string;\n\n /**\n * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.\n */\n timestamp: number;\n}\n"],"mappings":";;;;;;IAAYA,uB;;;WAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,u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,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;GAAAA,uB,uCAAAA,uB;;IA6HAC,4B;;;WAAAA,4B;EAAAA,4B;EAAAA,4B;EAAAA,4B;EAAAA,4B;EAAAA,4B;GAAAA,4B,4CAAAA,4B;;IAaAC,qB;;;WAAAA,qB;EAAAA,qB;EAAAA,qB;GAAAA,qB,qCAAAA,qB;;IAOAC,kB;;;WAAAA,kB;EAAAA,kB;EAAAA,kB;GAAAA,kB,kCAAAA,kB;;IAOAC,2B;;;WAAAA,2B;EAAAA,2B;EAAAA,2B;GAAAA,2B,2CAAAA,2B;;IAOAC,8B;;;WAAAA,8B;EAAAA,8B;EAAAA,8B;GAAAA,8B,8CAAAA,8B"}
|
|
1
|
+
{"version":3,"names":[],"sources":["apple.ts"],"sourcesContent":["/**\n * Payment discount interface @see https://developer.apple.com/documentation/storekit/skpaymentdiscount?language=objc\n */\nexport interface PaymentDiscount {\n /**\n * A string used to uniquely identify a discount offer for a product.\n */\n identifier: string;\n\n /**\n * A string that identifies the key used to generate the signature.\n */\n keyIdentifier: string;\n\n /**\n * A universally unique ID (UUID) value that you define.\n */\n nonce: string;\n\n /**\n * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.\n */\n signature: string;\n\n /**\n * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.\n */\n timestamp: number;\n}\n"],"mappings":""}
|