In-App Billing extension helps you to sell digital in-app products and subscriptions in your app.
Events
Error

Triggered when any error occurs in the extension
| Parameter | Type |
|---|---|
| message | text |
InAppMessageResponse

Called when response from In App Message is detected.
| Parameter | Type |
|---|---|
| responseCode | number |
| purchaseToken | text |
ConnectionSuccessful

Called when connection is successful.
ConnectionFailed

Called when connection is failed.
| Parameter | Type |
|---|---|
| message | text |
ConnectionDisconnected

Called when connection is disconnected.
GotProduct

Called when the product has been successfully retrived by GetProduct method.
| Parameter | Type |
|---|---|
| productId | text |
| title | text |
| name | text |
| description | text |
| price | text |
| productDetails | any |
FailedToGetProduct

Called when the product failed to retrieve by GetProduct method.
| Parameter | Type |
|---|---|
| message | text |
GotSubscription

Called when subscription details is successfully retrived.
| Parameter | Type |
|---|---|
| subscriptionId | text |
| subscriptionName | text |
| title | text |
| description | text |
| priceList | list |
| offerTokenList | list |
| offerIdList | list |
| basePlanIdList | list |
| subscriptionDetails | any |
FailedToGetSubscription

Called when subscription details is failed to get.
| Parameter | Type |
|---|---|
| message | text |
ProductPurchaseLaunched

Called when purchase is successfully launched.
ProductPurchaseFailedToLaunch

Called when purchase failed to launch.
| Parameter | Type |
|---|---|
| response | text |
SubscriptionPurchaseLaunched

Called when purchase is successfully launched.
SubscriptionPurchaseFailedToLaunch

Called when purchase failed to launch.
| Parameter | Type |
|---|---|
| response | text |
ProductConsumedSuccessfully

Called when purchase is consumed successfully
| Parameter | Type |
|---|---|
| purchaseToken | text |
ProductConsumeFailed

Called when the purchase failed to consume
| Parameter | Type |
|---|---|
| message | text |
| purchaseToken | text |
PurchaseSuccessful

Called when purchase is successful.
| Parameter | Type |
|---|---|
| purchaseInstance | any |
| purchaseToken | text |
PurchaseFailed

Called when purchase is failed due to any reason.
| Parameter | Type |
|---|---|
| response | text |
PurchaseCancelled

Called when purchase is cancelled.
| Parameter | Type |
|---|---|
| response | text |
GotPurchaseDetails

Called when purchase details have been retrived successfully
| Parameter | Type |
|---|---|
| purchaseState | number |
| purchaseToken | text |
| responseJSON | text |
| orderId | text |
| products | list |
| purchaseTime | number |
| quantity | number |
| signature | text |
QueryPurchasesSuccess

Called when query purchases is successful
| Parameter | Type |
|---|---|
| purchasesList | list |
| response | text |
QueryPurchasesFailed

Called when purchase query failed due to some reason
| Parameter | Type |
|---|---|
| response | text |
QueryPurchaseHistorySuccess

Called when query purchases history is successful
| Parameter | Type |
|---|---|
| purchasesList | list |
| response | text |
QueryPurchaseHistoryFailed

Called when purchase history query failed due to some reason
| Parameter | Type |
|---|---|
| response | text |
AcknowledgeSuccessful

Called when acknowledge successful
| Parameter | Type |
|---|---|
| purchaseToken | text |
AcknowledgeFailed

Called when the purchase is failed to acknowledge
| Parameter | Type |
|---|---|
| response | text |
| purchaseToken | text |
Methods
StartConnection

Starts up BillingClient setup process asynchronously.
EndConnection

Ends the connection with billing client
IsReady

Checks if the client is currently connected to the service, so that requests to other methods will succeed.
Return Type: boolean
IsSubscriptionSupported

Returns if subscription feature is supported or not.
Return Type: boolean
GetProduct

Performs a network query of the details of products available for sale in your app.
| Parameter | Type |
|---|---|
| productId | text |
GetSubscription

Performs a network query of the details of subscription available for sale in your app.
| Parameter | Type |
|---|---|
| subscriptionId | text |
LaunchProductPurchase

Initiates the billing flow for an in-app product purchase.
| Parameter | Type |
|---|---|
| productDetails | any |
LaunchSubscriptionPurchase

Launches the billing-flow for an in-app subscription purchase.
| Parameter | Type |
|---|---|
| subscriptionDetails | any |
| offerToken | text |
ConsumePurchase

Used to consume a purchase
| Parameter | Type |
|---|---|
| purchaseToken | text |
GetPurchaseDetails

Retrieves the purchase details.
| Parameter | Type |
|---|---|
| purchase | any |
QueryPurchases

Returns purchases details for currently owned items bought within your app.
| Parameter | Type |
|---|---|
| productType | text |
QueryPurchasesHistory

Returns purchases history details.
| Parameter | Type |
|---|---|
| productType | text |
GetPurchaseJSON

Returns the JSON format details the purchase.
| Parameter | Type |
|---|---|
| purchase | any |
Return Type: dictionary
IsPurchased

Returns if the given product is purchased or not.
| Parameter | Type |
|---|---|
| productId | text |
| purchasesList | list |
Return Type: boolean
GetPurchaseHistoryRecordJSON

Returns the JSON format record of purchases history from the given purchase record.
| Parameter | Type |
|---|---|
| purchaseRecord | any |
Return Type: dictionary
IsPurchaseAcknowledged

Returns if the given purchase is acknowledged or not.
| Parameter | Type |
|---|---|
| purchase | any |
Return Type: boolean
AcknowledgePurchase

Used to acknowledge a purchase
| Parameter | Type |
|---|---|
| purchaseToken | text |
Properties:
TestMode

Sets if test mode is enabled or not.
ShowInAppMessages

Overlays billing related messages on top of the calling app.
ProductTypeInApp

Product Type InApp
ProductTypeSubscription

Product Type Subscription