store.purchaseSubscription()

Type Function
Return value none
Revision Release 2022.3683
Keywords Google, IAP, in-app purchases, purchase
See also store.init()
store.*

Overview

Initiates a purchase transaction on a provided product by sending out a purchase request to the store, then dispatches a storeTransaction event to the listener defined in store.init().

Gotchas

This call does not work for subscription purchases.

Syntax

store.purchaseSubscription( productIdentifier [, options] )
productIdentifier (required)

String. String representing the product identifier of the item to purchase.

options (optional)

Table. A table that specifies additional parameters of the purchase API call.

Options Reference

The options table contains details about the purchase request.

accountId (optional)

String. Specifies an optional string that is uniquely associated with the user's account in your app. This value would be obfuscated (SHA-256 hash) before sending to Google. For more details see documentation.

obfuscatedAccountId (optional)

String. Specifies an optional obfuscated string that is uniquely associated with the user's account in your app. If set, accountId would be ignored. For more details see documentation.

profileId (optional)

String. Specifies an optional string that is uniquely associated with the user's profile in your app. This value would be obfuscated (SHA-256 hash) before sending to Google. For more details see documentation.

obfuscatedProfileId (optional)

String. Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app. If set, profileId would be ignored. For more details see documentation).