purchaseProductWith

fun Purchases.purchaseProductWith(activity: Activity, storeProduct: StoreProduct, onError: PurchaseErrorFunction = ON_PURCHASE_ERROR_STUB, onSuccess: PurchaseCompletedFunction)

Purchase product.

Parameters

activity

Current activity

storeProduct

The storeProduct of the product you wish to purchase

onSuccess

Will be called after the purchase has completed

onError

Will be called after the purchase has completed with error


fun Purchases.purchaseProductWith(activity: Activity, storeProduct: StoreProduct, upgradeInfo: UpgradeInfo, onError: PurchaseErrorFunction = ON_PURCHASE_ERROR_STUB, onSuccess: ProductChangeCompletedFunction)

Make a purchase.

Parameters

activity

Current activity

storeProduct

The storeProduct of the product you wish to purchase

upgradeInfo

The upgradeInfo you wish to upgrade from, containing the oldSku and the optional prorationMode.

onSuccess

Will be called after the purchase has completed

onError

Will be called after the purchase has completed with error