store.purchase()

Type Function
Return value none
Revision Release 2024.3703
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.purchase( 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 with 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 with 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).