purchase
abstract suspend fun purchase(activity: Activity, productDetails: ProductDetails, basePlanId: String?, offerId: String?): PurchaseResult(source)
Called when the user initiates purchasing of a product.
Add your purchase logic here and return its result. You can use Android's Billing APIs, or if you use RevenueCat, you can call Purchases.shared.purchase(product).
Return
A PurchaseResult object, which is the result of your purchase logic. Note: Make sure you handle all cases of PurchaseResult.
Parameters
product Defaults
The ProductDetails the user would like to purchase.
base Plan Id
An optional base plan identifier of the product that's being purchased.
offer Id
An optional offer identifier of the product that's being purchased.