ZSInAppPurchaseKit

ZSInAppPurchaseKit class is the single entry point to utilize this SDK. It should be initialized as soon as the user details are available.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun applyOfferToCurrentPlan(activity: Activity, zsPlan: ZSPlan, currentPlanCode: String, storeOrderId: String, zsCustomFields: ArrayList<ZSCustomField> = ArrayList(), offerId: String, purchasesUpdatedListener: PurchaseUpdationListener)

Will apply offer to the current subscription of the user based on the product code and offer id details passed. The subscription will be updated in Play Store and the corresponding subscription will be updated in Zoho Billing too.

Link copied to clipboard
fun changePlan(activity: Activity, zsPlan: ZSPlan, oldPlanCode: String, storeOrderId: String, zsCustomFields: ArrayList<ZSCustomField> = ArrayList(), offerId: String, purchasesUpdatedListener: PurchaseUpdationListener)

Will upgrade/downgrade the current subscription of the user based on the product code details passed. The subscription will be updated in Play Store and the corresponding subscription will be updated in Zoho Billing too.

Link copied to clipboard
Link copied to clipboard
fun getPlans(planDetailsListener: PlanDetailsListener, customFieldFilters: ArrayList<ZSCustomFieldFilter> = arrayListOf(), useCache: Boolean = false)

This method is used to get the array of plans that are applicable to the user. The resulting array will contain the plans that are active in both the play store and Zoho Billing.

Link copied to clipboard

This method is used to get list of purchases from the play store.

Link copied to clipboard
fun initiateNewPurchase(activity: Activity, zsPlan: ZSPlan, offerId: String = "", zsCustomFields: ArrayList<ZSCustomField> = ArrayList(), purchasesUpdatedListener: PurchaseUpdationListener)

Will subscribe to the particular plan ZSPlan. The subscription will be activated in Play Store and a corresponding subscription will also be created in Zoho Billing.

Link copied to clipboard

This method is used to check if the current purchase in the play store is associated with the logged in user.

Link copied to clipboard
fun restorePurchase(storeOrderId: String?, zsCustomFields: ArrayList<ZSCustomField> = ArrayList(), restorePurchaseListener: RestorePurchaseListener)

If a subscription is active in Play Store and is yet to be synced in Zoho Billing, this method can be called. This method can be called while the user clicks on the ‘Restore’ button from the subscription screen. This method does not support restoring multiple purchases.

Link copied to clipboard
fun setUserDetails(userID: String, userEmail: String, displayName: String)