@qonversion/capacitor-plugin
Version:
Qonversion provides full in-app purchases infrastructure, so you do not need to build your own server for receipt validation. Implement in-app subscriptions, validate user receipts, check subscription status, and provide access to your app features and co
54 lines (53 loc) • 1.86 kB
TypeScript
import { Entitlement } from './Entitlement';
import { QonversionError } from './QonversionError';
import { StoreTransaction } from './StoreTransaction';
import { PurchaseResultStatus, PurchaseResultSource } from './enums';
/**
* Represents the result of a purchase operation.
* Contains the status of the purchase, entitlements, and store transaction details.
*/
export declare class PurchaseResult {
/**
* The status of the purchase operation.
*/
status: PurchaseResultStatus;
/**
* The user's entitlements after the purchase.
* May be null if the purchase failed or is pending.
*/
entitlements: Map<string, Entitlement> | null;
/**
* The error that occurred during the purchase, if any.
*/
error: QonversionError | null;
/**
* Indicates whether the entitlements were generated from a fallback source.
*/
isFallbackGenerated: boolean;
/**
* The source of the purchase result data.
*/
source: PurchaseResultSource;
/**
* The store transaction details from the native platform.
* Contains raw transaction information from Apple App Store or Google Play Store.
*/
storeTransaction: StoreTransaction | null;
constructor(status: PurchaseResultStatus, entitlements: Map<string, Entitlement> | null, error: QonversionError | null, isFallbackGenerated: boolean, source: PurchaseResultSource, storeTransaction: StoreTransaction | null);
/**
* Returns true if the purchase was successful.
*/
get isSuccess(): boolean;
/**
* Returns true if the purchase was canceled by the user.
*/
get isCanceled(): boolean;
/**
* Returns true if the purchase is pending.
*/
get isPending(): boolean;
/**
* Returns true if an error occurred during the purchase.
*/
get isError(): boolean;
}