UNPKG

@namiml/web-sdk

Version:

Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing

43 lines (42 loc) 1.43 kB
import { NamiPurchaseSource } from "../purchase"; import { NamiSKU } from "./sku"; /** * @type NamiPurchase * This object represents a completed purchase in the SDK. A device purchases a NamiSKU and that * purchase makes available a set of NamiEntitlements */ export type NamiPurchase = { sku?: NamiSKU; /** * The store sku reference identifier for this NamiPurchase */ skuId: string; /** * The purchase order ID record or receipt ID associated to this purchase */ transactionIdentifier?: string; /** * For bypass store purchases only, indicates when this purchase will cease to back * an entitlement rendering it as inactive. */ expires?: Date; /** * The source a purchase comes from - either on Google Play (marketplace), through a paywall (campaign). */ purchaseToken?: string; /** * The date and time when the purchase was initiated */ purchaseInitiatedTimestamp?: Date; /** * The source a purchase comes from - either on Google Play (marketplace), through a paywall (campaign). */ purchaseSource?: NamiPurchaseSource; }; export type NamiPurchasesState = 'pending' | 'purchased' | 'consumed' | 'resubscribed' | 'unsubscribed' | 'deferred' | 'failed' | 'cancelled' | 'unknown'; export type NamiPurchaseDetails = { skuId: string; transactionId: string; amount?: number; currency?: string; };