Listener for purchase lifecycle events.

interface PurchaseListener {
    onPurchaseCancelled?: () => void;
    onPurchaseError?: (error: Error) => void;
    onPurchaseStarted?: (rcPackage: Package) => void;
}

Properties

onPurchaseCancelled?: () => void

Called when the user cancels the purchase flow.

onPurchaseError?: (error: Error) => void

Callback called when an error that won't close the paywall occurs. For example, a retryable error during the purchase process.

onPurchaseStarted?: (rcPackage: Package) => void

Called when a purchase flow is about to start for the given package.